USB Library
CDCTxService Function
Syntax
void CDCTxService();
Description

CDCTxService handles device-to-host transaction(s). This function should be called once per Main Program loop after the device reaches the configured state (after the CDCIniEP() function has already executed). This function is needed, in order to advance the internal software state machine that takes care of sending multiple transactions worth of IN USB data to the host, associated with CDC serial data. Failure to call CDCTxService() periodically will prevent data from being sent to the USB host, over the CDC serial data interface. 

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
        {
            //Keep trying to send data to the PC as required
            CDCTxService();

            //Run application code.
            UserApplication();
        }
    }
}
Preconditions

CDCIniEP() function should have already exectuted/the device should be in the CONFIGURED_STATE.

Remarks

None

MLA - USB Library Help Version : 2.16
http://www.microchip.com/mla