SLAA453A january 2011 – may 2023
A simple demo application is provided which shows how to use the API. The application can be thought of as similar to a COM port terminal application, like Hyperterminal. It sends and receives chunks of data in a similar fashion, except it does over an HID interface.
To operate the program, attach an MSP430 running the HID API stack, using the datapipe function calls. Several examples of this are provided with the API stack distribution. There are examples of single-interface HID, a CDC+HID composite device, and an HID+HID composite device. All of these can be used with this demo application.
The VID and PID fields in the GUI select the VID/PID for which the application should search. After entering them, press the "Set VID/PID" button.
When the VID/PID has been set, the application determines how many physical devices are attached to the system matching this VID/PID. It finds their serial numbers and posts them in the "Serial Number" combo box. It automatically selects the first serial number in the list, and proceeds to determine the number of HID interfaces present on that device. It loads the "Interface" combo box with a string for each one of these interfaces: "HID 0", "HID 1", etc. If there are any HID interfaces found, then "HID 0" is selected by default.
Press the "Connect" button. This opens a data connection with the USB device. If successful, the string below the button indicates it as such. If it is not successful, try the following:
Once the connection is initialized, data can be sent to the device by entering text and pressing "Send". Data received by the application from the device at any time is displayed in the large text field. The receive window can be cleared with the "Clear" button.
If the HID device is removed from the bus while another device is being accessed, or if another HID device of this VID/PID is added, the application automatically updates the pulldown menu list.