Device Xtra
ABOUT
Created by Kevin Richard Fink
April 5th 2007
THIS XTRA IS PROVIDED AS IS, WITHOUT ANY IMPLIED WARRANTEE! FOLLOW INSTRUCTIONS CAREFULLY AND USE AT YOUR OWN RISK!
This is a work in progress xtra, as such some features are not yet fully
operational. Here is the current status of each call:
Complete features: (stable)
HasNext() -- Returns true if their are any messages received from UDP,
TCP or HID USB
GetNext() -- Returns the next message in the queue received from UDP,
TCP or HID USB
DestroyAllThreads() -- Stops all UDP, TCP, and HID communications
GetListOfDevices() -- Returns a list of every device connected to
the computer.
Beta features: (unstable)
GetListOfHIDDevices() -- Returns the VendorID, VersionNumber and
ProductID of all HID devices connected to your computer.
Alpha features: (Untested) -- Avoid using these
SendDataToHIDDevice(Message) -- sends a message up to 64kbytes to
the first active USB device... avoid multiple USB connections on the same
xtra object. Returns -1 if you did not create a USB connection.
InitGetDataFromHIDDevice( vendorID, ProductID, VersionNumber) --
Creates a communication for the specified USB device
INSTALLATION
Simply extract and copy "DeviceXtra.x32" to your xtra directory of your Director Installation
HOW TO USE
-----------------------------------------------------------------------------
HasNext (Object me)
DESCRIPTION:
This function returns true if their are messages that have not yet
been processed.
USAGE:
object = new(xtra "DeviceXtra")
if object.hasNext() then
alert "THERE IS A NEW MESSAGE!!"
end if
-----------------------------------------------------------------------------
GetNext (Object me)
DESCRIPTION:
This function returns any messages that have not yet been sent to
director, or -1 if their is no messages. For USB it will return a string.
USAGE:
object = new(xtra "DeviceXtra")
if object.hasNext() then
alert object.getNext()
end if
-----------------------------------------------------------------------------
DestroyAllThreads (Object me)
DESCRIPTION:
Basically a closing parameter in this application, it ensures that the memory is
cleaned of any remaining unread messages and closes all open ports that it was using.
USAGE:
object = new(xtra "DeviceXtra")
object.DestroyAllThreads()
-----------------------------------------------------------------------------
GetListOfDevices (Object me)
DESCRIPTION:
Returns a list containing all devices connected to the pc.
USAGE:
object = new(xtra "DeviceXtra")
put object.getListOfDevices()
-----------------------------------------------------------------------------
GetListOfHIDDevices (Object me)
DESCRIPTION:
Returns a list containing all connected HID devices connected to the pc.
Each entry of the list consists of a versionID, versionNumber and a productID
USAGE:
object = new(xtra "DeviceXtra")
put object.getListOfHIDDevices()
-----------------------------------------------------------------------------
SendDataToHIDDevices (Object me, String Message)
DESCRIPTION:
Sends a message to a connected HID device. Extremely unstable.
USAGE:
object = new(xtra "DeviceXtra")
put object.sendDataToHIDDevices("Message")
-----------------------------------------------------------------------------
InitGetDataFromHIDDevice (Object me, Integer vendorID, Integer productID, Integer versionNumber)
DESCRIPTION:
Starts a thread to get all incoming data from the specified USB device...
0 for any value becomes a wildcard. Be as specific as possible to connect to the
right device. Extremely unstable.
USAGE:
object = new(xtra "DeviceXtra")
put object.InitGetDataFromHIDDevice(vendorID, productID, versionNumber)
