![]() |
VectorNav C++ Library
|
Useful test class for taking place where vn::common::ISimplePort may be used. More...
#include <memoryport.h>
Public Member Functions | |
| MemoryPort () | |
| Creates a new MemoryPort. | |
| virtual void | open () |
| Opens the simple port. | |
| virtual void | close () |
| Closes the simple port. | |
| virtual bool | isOpen () |
| Indicates if the simple port is open. More... | |
| virtual void | write (const char data[], size_t length) |
| Writes out data to the simple port. More... | |
| virtual void | read (char dataBuffer[], size_t numOfBytesToRead, size_t &numOfBytesActuallyRead) |
| Allows reading data from the simple port. More... | |
| virtual void | registerDataReceivedHandler (void *userData, DataReceivedHandler handler) |
| Registers a callback method for notification when new data is received on the port. More... | |
| 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. More... | |
| void | unregisterDataWrittenHandler () |
| Unregisters the registered callback method. | |
| void | SendDataBackDoor (const uint8_t data[], size_t length) |
| Sends data to the MemoryPort which can then be read by read. More... | |
| void | SendDataBackDoor (const char data[], size_t length) |
| Sends data to the MemoryPort which can then be read by read. More... | |
| void | SendDataBackDoor (const std::string data) |
| Sends data to the MemoryPort which can then be read by read. More... | |
Additional Inherited Members | |
Public Types inherited from vn::xplat::IPort | |
| typedef void(* | DataReceivedHandler) (void *userData) |
| Callback handler signature that can receive notification when new data has been received on the port. More... | |
Useful test class for taking place where vn::common::ISimplePort may be used.
|
virtual |
Indicates if the simple port is open.
true if the serial port is open; otherwise false. Implements vn::xplat::IPort.
|
virtual |
Allows reading data from the simple port.
| [out] | dataBuffer | The data buffer to write the read data bytes to. |
| [in] | numOfBytesToRead | The number of bytes to attempt reading from the simple port. |
| [out] | numOfBytesActuallyRead | The number of bytes actually read from the simple port. |
Implements vn::xplat::IPort.
|
virtual |
Registers a callback method for notification when new data is received on the port.
| [in] | userData | Pointer to user data, which will be provided to the callback method. |
| [in] | handler | The callback method. |
Implements vn::xplat::IPort.
| void vn::util::MemoryPort::registerDataWrittenHandler | ( | void * | userData, |
| DataWrittenHandler | handler | ||
| ) |
Registers a callback method for notification when new data is written.
| [in] | userData | Pointer to user data, which will be provided to the callback method. |
| [in] | handler | The callback method. |
| void vn::util::MemoryPort::SendDataBackDoor | ( | const uint8_t | data[], |
| size_t | length | ||
| ) |
Sends data to the MemoryPort which can then be read by read.
| [in] | data | Data buffer containing the data. |
| [in] | length | The number of data bytes. |
| void vn::util::MemoryPort::SendDataBackDoor | ( | const char | data[], |
| size_t | length | ||
| ) |
Sends data to the MemoryPort which can then be read by read.
| [in] | data | Data buffer containing the data. |
| [in] | length | The number of data bytes. |
| void vn::util::MemoryPort::SendDataBackDoor | ( | const std::string | data | ) |
Sends data to the MemoryPort which can then be read by read.
| [in] | data | The data to send. |
|
virtual |
Writes out data to the simple port.
| [in] | data | The data array to write out. |
| [in] | length | The length of the data array to write out. |
Implements vn::xplat::IPort.
1.8.10