diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-01-30 21:02:31 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-01-30 21:02:31 +0000 |
| commit | 13b277cfcbcd1b72a99e1cd935b00e2adb784a01 (patch) | |
| tree | b67e5b8295633262ed839e1c74f81a65b4dd59ea /LUFA/Drivers/USB/Class/Device/CDC.c | |
| parent | 7ddd744fcae1d66f975b01ba9333d4a3e3862db6 (diff) | |
Renamed the PRNT_Host_SendString(), CDC_Host_SendString() and CDC_Device_SendString() functions to *_SendData(), and added new versions of the *_SendString() routines that expect a null terminated string instead.
Added new Serial_SendData() function to the Serial driver.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1647 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/CDC.c')
| -rw-r--r-- | LUFA/Drivers/USB/Class/Device/CDC.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index e3d1c4de..838bd712 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -154,14 +154,24 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) } uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const char* const Data, - const uint16_t Length) + const char* const String) { if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) return ENDPOINT_RWSTREAM_DeviceDisconnected; Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber); - return Endpoint_Write_Stream_LE(Data, Length, NULL); + return Endpoint_Write_Stream_LE(String, strlen(String), NULL); +} + +uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const Buffer, + const uint16_t Length) +{ + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber); + return Endpoint_Write_Stream_LE(Buffer, Length, NULL); } uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, |
