Go to the documentation of this file.
9 #ifndef SERIALINTERFACE_H
10 #define SERIALINTERFACE_H
XsResultValue writeData(const XsByteArray &data, XsSize *written=0)
Write the data contained in data to the device.
XsIoHandle m_handle
The serial port handle, also indicates if the port is open or not.
bool isOpen(void) const
Return whether the communication port is open or not.
struct XsByteArray XsByteArray
unsigned __int16 uint16_t
uint16_t m_port
The opened COM port nr.
XsResultValue readData(XsSize maxLength, XsByteArray &data)
Read data from the serial port and put it into the data buffer.
XsControlLine
Serial control lines.
uint16_t getPortNumber(void) const
Retrieve the port number that was last successfully opened.
XsBaudRate m_baudrate
The baudrate that was last set to be used by the port.
char m_portname[32]
The name of the open serial port.
void cancelIo(void) const
Cancel any pending io requests.
XsBaudRate
Communication speed.
virtual ~SerialInterface()
Destructor, de-initializes, frees memory allocated for buffers, etc.
XsResultValue m_lastResult
The last result of an operation.
#define XS_DEFAULT_READ_BUFFER_SIZE
The default size of the serial read buffer in bytes.
XsResultValue
Xsens result values.
XsResultValue escape(XsControlLine mask, XsControlLine state)
Manipulate the Serial control lines.
#define XS_DEFAULT_WRITE_BUFFER_SIZE
The default size of the serial write buffer in bytes.
GLsizei GLsizei GLenum GLenum const GLvoid * data
XsIoHandle getHandle(void) const
Return the handle of the port.
XsBaudRate getBaudrate(void) const
Return the baudrate that is currently being used by the port.
XsResultValue closeLive(void)
Close the serial communication port.
XsResultValue setTimeout(uint32_t ms)
Set the default timeout value to use in blocking operations.
size_t XsSize
XsSize must be unsigned number!
XsResultValue flushData(void)
Flush all data in the buffers to and from the device.
XsResultValue getLastResult(void) const
Return the error code of the last operation.
XsResultValue open(const XsPortInfo &portInfo, uint32_t readBufSize=XS_DEFAULT_READ_BUFFER_SIZE, uint32_t writeBufSize=XS_DEFAULT_WRITE_BUFFER_SIZE)
Open a communication channel to the given port info.
#define XSENS_DISABLE_COPY(className)
Add this macro to the start of a class definition to prevent automatic creation of copy functions.
uint32_t getTimeout(void) const
Return the current timeout value.
XsResultValue waitForData(XsSize maxLength, XsByteArray &data)
Wait for data to arrive or a timeout to occur.
XsResultValue close(void)
Close the serial communication port.
The low-level serial communication class.
uint32_t m_endTime
The time at which an operation will end in ms, used by several functions.
void getPortName(XsString &portname) const
Retrieve the port name that was last successfully opened.
unsigned __int32 uint32_t
SerialInterface()
Default constructor, initializes all members to their default values.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |