10 #define USBINTERFACE_H
24 #define _strnicmp strncasecmp
An IoInterface for dealing specifically with Xsens USB devices.
bool isOpen(void) const
Return whether the USB communication port is open or not.
XsResultValue close(void)
Close the USB communication port.
virtual XsResultValue writeData(const XsByteArray &data, XsSize *written=NULL)
Write the data to the USB port.
uint32_t getTimeout(void) const
Return the current timeout value.
uint8_t usbBus() const
The USB bus number this device is on (libusb/linux only)
XsResultValue open(const XsPortInfo &portInfo, uint32_t readBufSize=0, uint32_t writeBufSize=0)
Open a communication channel to the given USB port name.
virtual XsResultValue readData(XsSize maxLength, XsByteArray &data)
Read data from the USB port and put it into the data buffer.
XsResultValue setTimeout(uint32_t ms)
Set the default timeout value to use in blocking operations.
XsResultValue closeUsb(void)
Close the USB communication port.
void getPortName(XsString &portname) const
Retrieve the port name that was last successfully opened.
virtual XsResultValue waitForData(XsSize maxLength, XsByteArray &data)
Wait for data to arrive or a timeout to occur.
void setRawIo(bool enable)
Sets the RAWIO mode of the USB interface.
XsResultValue flushData(void)
Flush all data in the buffers to and from the device.
UsbInterface()
Default constructor, initializes all members to their default values.
~UsbInterface()
Destructor, de-initializes, frees memory allocated for buffers, etc.
XsResultValue getLastResult(void) const
Return the error code of the last operation.
uint8_t usbAddress() const
The address of the device (libusb/linux only)
bool getRawIo(void)
Retrieves the state of the RAWIO mode of the USB interface.
Private object for UsbInterface.
GLsizei GLsizei GLenum GLenum const GLvoid * data
GLuint GLsizei GLsizei * length
XsResultValue
Xsens result values.
unsigned __int32 uint32_t
virtual XsResultValue waitForData(XsSize maxLength, XsByteArray &data)
Wait for data to arrive or a timeout to occur.
#define XSENS_DISABLE_COPY(className)
Add this macro to the start of a class definition to prevent automatic creation of copy functions.
struct XsByteArray XsByteArray
size_t XsSize
XsSize must be unsigned number!