An Abstract Base Class for various connection types.
Destroys the Connection_Impl_Base object
Initializes and opens the current connection.
Gets a description of the connection as a string
A description of the connection
Closes the current connection.
Reopens a connection that has been disconnected.
virtual void registerParser( |
| ) = 0 |
Registers a function to handle the parsing of data when it is read in.
parseFunction | The function to call to parse data that is read in. |
Error_Connection: The connection is already in use.
Unregisters the function to handle the parsing of data when it is read in
Throws an exception if a connection error has occurred.
Error_Connection: a connection error has occurred.
virtual void write( |
| ) = 0 |
Writes bytes to the port via the BoostCommunication object.
data const ByteStream& | the bytes that will be written to the port. |
Error_Connection: a connection error has occurred, such as the device being unplugged.
virtual void write( |
| ) = 0 |
Writes the given bytes to the port via the BoostCommunication object.
bytes const Bytes& | The bytes to write. |
Error_Connection: a connection error has occurred, such as the device being unplugged.
Resets the read buffer.
Gets the read position from the byte buffer.
Gets the append position from the byte buffer.
virtual void rawByteMode( |
| ) = 0 |
Puts the connection into "Raw Byte Mode." "Raw Byte Mode" stops the data from being sent/parsed from any attached devices (BaseStation, InertialNode, etc.) and instead sends all data into a raw circular data buffer that can be accessed by calling getRawBytes on this Connection object. Disabling this mode will start sending all data back to the previous attached device, if still available.
enable bool | whether to enable raw byte mode (true), or disable raw byte mode (false). |
Error_Connection: The connection has been disconnected.
virtual void getRawBytes( |
| ) = 0 |
Gets all of the raw bytes that are available that have been collected when the Connection is in "Raw Byte Mode." If the Connection has not been put into "Raw Byte Mode" by calling rawByteMode, no data can be retrieved from this function.
bytes | A Bytes vector to hold the result. |
timeout uint32 | the timeout, in milliseconds, to wait for the data if necessary (default of 0). |
maxBytes uint32 | The maximum number of bytes to return. If this is 0 (default), all bytes will be returned. |