Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

In order to begin sending/receiving packets to the device, you must first find and “connect” to the device. As configured by
default, the application is looking for USB devices with VID = 0x04D8 and PID = 0x0204. The device descriptor in the
firmware project meant to be used with this demo uses the same VID/PID. To run the demo program the USB device with
the correct precompiled .hex file. If you are connecting the device for the first time, Windows pops up a window asking you to
install the driver for the device. When asked for the driver point it to the inf file provided along with the demo. Windows takes
while to install the driver for the USB device that is just plugged in. Open the Device manager and ensure that the USB
device is listed under the ‘Libusb Demo Devices’. Once the driver is installed hit the “Connect” button, the other pushbuttons
should become enabled. If hitting the connect button has no effect, it is likely the USB device is either not connected, or has
not been programmed with the correct firmware.
Hitting the Toggle LED(s) should send a single packet of general purpose generic data to the Custom class USB peripheral
device. The data will arrive on the Bulk OUT endpoint. The firmware has been configured to receive this generic data packet,
parse the packet looking for the “Toggle LED(s)” command, and should respond appropriately by controlling the LED(s) on
the demo board.
The “Get Pushbutton State” button will send one packet of data over the USB to the peripheral device (to the Bulk OUT
endpoint) requesting the current pushbutton state. The firmware will process the received Get Pushbutton State command,
and will prepare an appropriate response packet depending upon the pushbutton state.
The PC then requests a packet of data from the device (which will be taken from the Bulk IN endpoint). Once the PC
application receives the response packet, it will update the pushbutton state label.
Try experimenting with the application by holding down the appropriate pushbutton on the demo board, and then
simultaneously clicking on the “Get Pushbutton State” button. Then try to repeat the process, but this time without holding
down the pushbutton on the demo board.
To make for a more fluid and gratifying end user experience, a real USB application would probably want to launch a
separate thread to periodically poll the pushbutton state, so as to get updates regularly. This is not done in this simple demo,
so as to avoid cluttering the PC application project with source code that is not related to USB communication.
In order to build the application navigate to the “<Install Directory>\USB Device - LibUSB - Generic Driver Demo\Linux
Application\Qt3” directory and execute the command “make”.
1.6.13.3 Android 3.1+
Running the demo on an Android device.
Description
There are two main ways to get the example application on to the target Android device: the Android Market and by
compiling the source code.
1. The demo application can be downloaded from Microchip’s Android Marketplace page:
https://market.android.com/developer?pub=Microchip+Technology+Inc
1.6 Demos MLA - USB Library Help Device - Vendor Driver Basic Demo
283

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh