Vault 7: Projects

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

File
usb_device.h
Syntax
USB_DEVICE_STATE USBGetDeviceState();
Description
This function returns the current state of the device on the USB. This function is used to determine when the device is ready
to communicate on the bus. Applications should not try to send or receive data until this function returns
CONFIGURED_STATE.
It is also important that applications yield as much time as possible to the USBDeviceTasks() function as possible while the
this function returns any value between ATTACHED_STATE through CONFIGURED_STATE.
For more information about the various device states, please refer to the USB specification section 9.1 available from
www.usb.org.
Typical usage:
void main(void)
{
USBDeviceInit()
while(1)
{
USBDeviceTasks();
if((USBGetDeviceState() < CONFIGURED_STATE) ||
(USBIsDeviceSuspended() == true))
{
//Either the device is not configured or we are suspended
// so we don't want to do execute any application code
continue; //go back to the top of the while loop
}
else
{
//Otherwise we are free to run user application code.
UserApplication();
}
}
}
Remarks
None
Preconditions
None
Return Values
Return Values Description
USB_DEVICE_STATE the current state of the device on the bus
Function
USB_DEVICE_STATE USBGetDeviceState(void)
1.4.1.1.1.18 USBGetNextHandle Function
Retrieves the handle to the next endpoint BDT entry that the USBTransferOnePacket() will use.
File
usb_device.h
1.4 Library Interface MLA - USB Library Help Device/Peripheral
51

e-Highlighter

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

Un-highlight all Un-highlight selectionu Highlight selectionh