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