struct Core::Usb::IUsbHidInstance
Overview
#include <coreusbhid.h> struct IUsbHidInstance { // methods virtual void getManufacturer (StringResult& string) const = 0; virtual void getProduct (StringResult& string) const = 0; virtual void getSerialNumber (StringResult& string) const = 0; virtual uint16 getVendorId () const = 0; virtual uint16 getProductId () const = 0; virtual int writeToDevice (const uint8* data, int length) = 0; virtual int readFromDevice (uint8* data, int length, int timeout = 0) = 0; };
Detailed Documentation
Methods
virtual void getManufacturer (StringResult& string) const = 0
Get the name of the device manufacturer.
This may or may not correspond to the name associated with the vendorId.
virtual void getProduct (StringResult& string) const = 0
Get the name of the product.
virtual void getSerialNumber (StringResult& string) const = 0
Get the serial number.
This string is not necessarily alpha-numeric.
virtual uint16 getVendorId () const = 0
Get the vendorId of this device.
virtual uint16 getProductId () const = 0
Get the productId of this device.
virtual int writeToDevice (const uint8* data, int length) = 0
Write data to the device.
The device must be open. The first byte must contain the Report ID, or 0 if the device only has one report. It returns the number of bytes written.
virtual int readFromDevice (uint8* data, int length, int timeout = 0) = 0
Synchronously poll data from the device.
The device must be open. If (and only if) the device has multiple reports, the first byte is the Report ID. It polls at most length bytes and returns the number of bytes read in at most timeout milliseconds.