There's a fair amount going on here, with multiple sources of asynchronous events. Here's a sequence diagram of how all of these functions fit together:

Here are a few noteworthy items from the preceding diagram:
- Calls to TransmitUsbData and TransmitUsbDataLossy are non-blocking. If space is available, data is transferred into the stream buffer, txStream, and the number of bytes copied is returned. Partial messages may be copied into the buffer (which happens under extremely high load when the buffer gets filled).
- Two things need to happen before a packet of data is sent via USBD_CDC_TransmitPacket: