Display and Logger fully functional. Keypad task completed - yet to be tested git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@219 05563f52-14a8-4384-a975-3d1654cca0fa
79 lines
2.3 KiB
C
79 lines
2.3 KiB
C
// -----------------------------------------------------------------------------
|
|
/// @file IODevice.c
|
|
/// @brief Description
|
|
// -----------------------------------------------------------------------------
|
|
// Micro-Key bv
|
|
// Industrieweg 28, 9804 TG Noordhorn
|
|
// Postbus 92, 9800 AB Zuidhorn
|
|
// The Netherlands
|
|
// Tel: +31 594 503020
|
|
// Fax: +31 594 505825
|
|
// Email: support@microkey.nl
|
|
// Web: www.microkey.nl
|
|
// -----------------------------------------------------------------------------
|
|
/// $Revision$
|
|
/// $Author$
|
|
/// $Date$
|
|
// (c) 2017 Micro-Key bv
|
|
// -----------------------------------------------------------------------------
|
|
|
|
/// @file IODevice.c
|
|
/// @ingroup {group_name}
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Include files
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#include "IODevice.h"
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Constant and macro definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Type definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// File-scope variables
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Function declarations
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Function definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
ErrorStatus IODevice_construct (struct IODevice* self, ReadFunction read, WriteFunction write)
|
|
{
|
|
ErrorStatus returnValue = SUCCESS;
|
|
|
|
self->_write = write;
|
|
self->_read = read;
|
|
|
|
return returnValue;
|
|
}
|
|
|
|
ErrorStatus IODevice_write(const struct IODevice* self, const char* buffer, size_t length)
|
|
{
|
|
ErrorStatus returnValue = SUCCESS;
|
|
|
|
if (self->_write != NULL)
|
|
{
|
|
self->_write(self, buffer, length);
|
|
}
|
|
|
|
return returnValue;
|
|
}
|