11 #pragma warning(disable:4996)
31 typedef void(*DataWrittenHandler)(
void* userData,
const char* rawData,
size_t length);
52 virtual void write(
const char data[],
size_t length);
54 virtual void read(
char dataBuffer[],
size_t numOfBytesToRead,
size_t &numOfBytesActuallyRead);
void(* DataReceivedHandler)(void *userData)
Callback handler signature that can receive notification when new data has been received on the port...
Definition: port.h:24
virtual void unregisterDataReceivedHandler()
Unregisters the registered callback method.
void registerDataWrittenHandler(void *userData, DataWrittenHandler handler)
Registers a callback method for notification when new data is written.
MemoryPort()
Creates a new MemoryPort.
Interface for a simple port.
Definition: port.h:12
virtual void write(const char data[], size_t length)
Writes out data to the simple port.
Useful test class for taking place where vn::common::ISimplePort may be used.
Definition: memoryport.h:29
void SendDataBackDoor(const uint8_t data[], size_t length)
Sends data to the MemoryPort which can then be read by read.
virtual void close()
Closes the simple port.
virtual void read(char dataBuffer[], size_t numOfBytesToRead, size_t &numOfBytesActuallyRead)
Allows reading data from the simple port.
Identifies a derived class as being unable to be copied and prevents copy attempts.
Definition: nocopy.h:21
virtual void registerDataReceivedHandler(void *userData, DataReceivedHandler handler)
Registers a callback method for notification when new data is received on the port.
virtual void open()
Opens the simple port.
void unregisterDataWrittenHandler()
Unregisters the registered callback method.
virtual bool isOpen()
Indicates if the simple port is open.