Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
1.4.1.3.2.5 putrsUSBUSART Function
putrsUSBUSART writes a string of data to the USB including the null character. Use this version, 'putrs', to transfer data
literals and data located in program memory.
File
usb_device_cdc.h
Syntax
void putrsUSBUSART(const char * data);
Description
putrsUSBUSART writes a string of data to the USB including the null character. Use this version, 'putrs', to transfer data
literals and data located in program memory.
Typical Usage:
if(USBUSARTIsTxTrfReady())
{
putrsUSBUSART("Hello World");
}
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
const const 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 putrsUSBUSART(const const char *data)
1.4.1.3.2.6 putsUSBUSART Function
putsUSBUSART writes a string of data to the USB including the null character. Use this version, 'puts', to transfer data from
a RAM buffer.
File
usb_device_cdc.h
Syntax
void putsUSBUSART(char * data);
Description
putsUSBUSART writes a string of data to the USB including the null character. Use this version, 'puts', to transfer data from
a RAM buffer.
Typical Usage:
if(USBUSARTIsTxTrfReady())
{
char data[] = "Hello World";
1.4 Library Interface MLA - USB Library Help Device/Peripheral
77
Protego_Release_01_05-Related-OEM-Documentation-MLA_v2013_12_20-help_mla_usb.pdf