# Vault 7: Projects

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

### Protego

# MLA -- USB Library

20 December, 2013

- 1
- 2
…
- 77
- 78
- 79
- 80
- 81
…
- 311
- 312

1.4.1.3.2.8 USBCDCEventHandler Function
Handles events from the USB stack, which may have an effect on the CDC endpoint(s).
File
usb_device_cdc.h
Syntax
bool USBCDCEventHandler(USB_EVENT event, void * pdata, uint16_t size);
Description
Handles events from the USB stack. This function should be called when there is a USB event that needs to be processed
by the CDC driver.
Preconditions
Value of input argument 'len' should be smaller than the maximum endpoint size responsible for receiving bulk data from
USB host for CDC class. Input argument 'buffer' should point to a buffer area that is bigger or equal to the size specified by
'len'.
Parameters
Parameters Description
event the type of event that occured
pdata pointer to the data that caused the event
size the size of the data that is pointed to by pdata
Function
bool USBCDCEventHandler(USB_EVENT event, void *pdata, uint16_t size)
1.4.1.3.2.9 USBCheckCDCRequest Function
File
usb_device_cdc.h
Syntax
void USBCheckCDCRequest();
Description
This routine checks the most recently received SETUP data packet to see if the request is specific to the CDC class. If the
request was a CDC specific request, this function will take care of handling the request and responding appropriately.
Remarks
This function does not change status or do anything if the SETUP packet did not contain a CDC class specific request.
Preconditions
This function should only be called after a control transfer SETUP packet has arrived from the host.
Function
void USBCheckCDCRequest(void)
1.4.1.3.2.10 CDCSetBaudRate Macro
This macro is used set the baud rate reported back to the host during a get line coding request. (optional)
1.4 Library Interface MLA - USB Library Help Device/Peripheral
79

- 1
- 2
…
- 77
- 78
- 79
- 80
- 81
…
- 311
- 312