/****************************************************************************
  Function:
    bool USBHostCDC_Api_Send_OUT_Data(uint8_t no_of_bytes, uint8_t* data)

  Description:
    This function is called by application to transmit out data over DATA 
    interface. This function setsup the request to transmit data to the 
    device.

  Precondition:
    None

  Parameters:
    uint8_t    no_of_bytes - No. of Bytes expected from the device.
    uint8_t*   data        - Pointer to application transmit data buffer.


  Return Values:
    true    -   Transfer request is placed successfully.
    false   -   Transfer request failed.

  Remarks:
    None
***************************************************************************/
bool USBHostCDC_Api_Send_OUT_Data(uint16_t no_of_bytes, uint8_t* data)
{
    uint8_t    i;

    for (i=0; (i<USB_MAX_CDC_DEVICES) && (deviceInfoCDC[i].deviceAddress != CDCdeviceAddress); i++);

   if(!USBHostCDCSend_DATA(CDCdeviceAddress, deviceInfoCDC[i].dataInterface.interfaceNum,
                           no_of_bytes,data,deviceInfoCDC[i].dataInterface.endpointOUT))
    {
       return true;
    }
    return false;
}
Ejemplo n.º 2
0
/****************************************************************************
  Function:
    BOOL USBHostCDC_Api_Send_OUT_Data(BYTE no_of_bytes, BYTE* data)

  Description:
    This function is called by application to transmit out data over DATA 
    interface. This function setsup the request to transmit data to the 
    device.

  Precondition:
    None

  Parameters:
    BYTE    no_of_bytes - No. of Bytes expected from the device.
    BYTE*   data        - Pointer to application transmit data buffer.


  Return Values:
    TRUE    -   Transfer request is placed successfully.
    FALSE   -   Transfer request failed.

  Remarks:
    None
***************************************************************************/
BOOL USBHostCDC_Api_Send_OUT_Data(WORD no_of_bytes, BYTE* data)
{
    BYTE    i;

    for (i=0; (i<USB_MAX_CDC_DEVICES) && (deviceInfoCDC[i].deviceAddress != CDCdeviceAddress); i++);

   if(!USBHostCDCSend_DATA(CDCdeviceAddress, deviceInfoCDC[i].dataInterface.interfaceNum,
                           no_of_bytes,data,deviceInfoCDC[i].dataInterface.endpointOUT))
    {
       return TRUE;
    }
    return FALSE;
}