source.
hidapi
(vendorID, productID, nReadBuffer, nWriteBuffer)¶Interface to the hidapi library
Notes
handle
¶vendorID
¶numeric – Vendor-ID of the USB device.
productID
¶numeric – Product-ID of the USB device.
nReadBuffer
¶numeric – Read-buffer size in bytes.
nWriteBuffer
¶numeric – Write-buffer size in bytes. Needs to be 1 Byte bigger than actual packet.
slib
¶string – Name of shared library file (without file extension). Defaults to ‘hidapi’.
sheader
¶string – Name of shared library header. Defaults to ‘hidapi.h’.
Example
hidHandle = hidapi(1684,0005,1024,1025); %|br|
close
(hid)¶Close the connection to a hid device.
Notes
enumerate
(hid, vendorID, productID)¶Enumerates the info about the hid device with the given vendorID and productID and returns a string with the returned hid information.
Parameters: |
|
---|
Notes
Enumerate the hid devices
error
(hid)¶Return the hid device error string if a function produced an error.
Notes
exit
(hid)¶hidapi.exit Exit hidapi
hid.exit() exits the hidapi library.
Notes:: - You should not have to call this function directly.
getHIDInfoString
(hid, info)¶Get the corresponding hid info from the hid device.
Notes
See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING, HIDAPI.GETSERIALNUMBERSTRING.
Read buffer nReadBuffer length
getManufacturersString
(hid)¶Get manufacturers string from hid object using getHIDInfoString.
getProductString
(hid)¶Get product string from hid object using getProductString.
getSerialNumberString
(hid)¶Get serial number from hid object using getSerialNumberString.
init
(hid)¶Inits the hidapi library.
Notes
open
(hid)¶Open a connection with a hid device
Notes
Create a null pointer for the hid_open function (depends on OS)
read
(hid)¶Read from a hid device and returns the read bytes.
Notes
Read buffer of nReadBuffer length
read_timeout
(hid, timeOut)¶Read from a hid device with a timeout and return the read bytes.
Parameters: | timeOut (numeric >= 0) – Milliseconds after which a timeout-error occurs if no packet could be read. |
---|
Read buffer of nReadBuffer length
setNonBlocking
(hid, nonblock)¶Set the non blocking flag on the hid device connection.
Parameters: | nonblock (numeric in {0,1}) – 0 disables nonblocking, 1 enables nonblocking |
---|
write
(hid, wmsg, reportID)¶Write to a hid device.
Notes
Append a 0 at the front for HID report ID