Vault 7: Projects

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

putsUSBUSART(data);
}
The transfer mechanism for device-to-host(put) is more flexible than host-to-device(get). It can handle a string of data larger
than the maximum size of bulk IN endpoint. A state machine is used to transfer a long string of data over multiple USB
transactions. CDCTxService() must be called periodically to keep sending blocks of data to the host.
Preconditions
USBUSARTIsTxTrfReady() must return true. This indicates that the last transfer is complete and is ready to receive a new
block of data. The string of characters pointed to by 'data' must equal to or smaller than 255 BYTEs.
Parameters
Parameters Description
char *data null-terminated string of constant data. If a null character is
not found, 255 BYTEs of data will be transferred to the host.
Function
void putsUSBUSART(char *data)
1.4.1.3.2.7 putUSBUSART Function
putUSBUSART writes an array of data to the USB. Use this version, is capable of transfering 0x00 (what is typically a NULL
character in any of the string transfer functions).
File
usb_device_cdc.h
Syntax
void putUSBUSART(uint8_t * data, uint8_t Length);
Description
putUSBUSART writes an array of data to the USB. Use this version, is capable of transfering 0x00 (what is typically a NULL
character in any of the string transfer functions).
Typical Usage:
if(USBUSARTIsTxTrfReady())
{
char data[] = {0x00, 0x01, 0x02, 0x03, 0x04};
putUSBUSART(data,5);
}
The transfer mechanism for device-to-host(put) is more flexible than host-to-device(get). It can handle a string of data larger
than the maximum size of bulk IN endpoint. A state machine is used to transfer a long string of data over multiple USB
transactions. CDCTxService() must be called periodically to keep sending blocks of data to the host.
Preconditions
USBUSARTIsTxTrfReady() must return true. This indicates that the last transfer is complete and is ready to receive a new
block of data. The string of characters pointed to by 'data' must equal to or smaller than 255 BYTEs.
Parameters
Parameters Description
char *data pointer to a RAM array of data to be transfered to the host
uint8_t length the number of bytes to be transfered (must be less than 255).
Function
void putUSBUSART(char *data, uint8_t length)
1.4 Library Interface MLA - USB Library Help Device/Peripheral
78

e-Highlighter

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

Un-highlight all Un-highlight selectionu Highlight selectionh