USB Library
USBGetSuspendState Function
Syntax
bool USBGetSuspendState();
Description

This function indicates if the USB port that this device is attached to is currently suspended. When suspended, it will not be able to transfer data over the bus. This function can be used by the application to skip over section of code that do not need to execute if the device is unable to send data over the bus. This function can also be used to help determine when it is legal to perform USB remote wakeup signaling, for devices supporting this feature. 

Typical usage:

   void main(void)
   {
       USBDeviceInit()
       while(1)
       {
           USBDeviceTasks();
           if((USBGetDeviceState() < CONFIGURED_STATE) ||
              (USBGetSuspendState() == 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
           {
               //Otherwise we are free to run user application code.
               UserApplication();
           }
       }
   }
Preconditions

None

Return Values
Return Values 
Description 
true 
the USB port this device is attached to is suspended. 
false 
the USB port this device is attached to is not suspended. 
Remarks

This function is the same as USBIsBusSuspended().

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