By popular demand here is an example of a HID transport. Note that we are still in Alpha stage meaning that stuff will change. Most notable we will be adding a wrapper class around the transport system to make it easier to write code that can talk any of the protocols without change.
if ( a ) then
-- do something smart with the data coming in here
-- remove the print line above when done analyzing the protocol.
-- print all attached HID devices.
-- create a HID transport channel.
hid = transport.New(transport.constants.transport.USBHID)
-- HID devices always prepend a report ID number, for most this is unimportant, but you might need it.
-- Set the CALLBACK method to read the incoming data.
-- Open the actually channel to the HID device
-- You'll need to have enough of the parameters below to uniquely identify the
-- Open ( <VendorID>, <ProductID>, <Manufacterer>, <Serial Number>, <Device Name>)
-- Any of those parameters can be 'nil', which means match any device.