Added new RNDIS Host class driver and the beginnings of a RNDISEthernetHost Class Driver demo.
Fixed all Class drivers to ensure they have appropriate guards on each function to ensure the device is enumerated before running, fixed error codes on all guards to return "DeviceDisconnected" where possble. Renamed HOST_SENDCONTROL_DeviceDisconnect enum value to HOST_SENDCONTROL_DeviceDisconnected to be in line with the rest of the library enum error codes.
This commit is contained in:
parent
f37d21bbe9
commit
5aa2b26261
30 changed files with 3408 additions and 71 deletions
|
@ -273,7 +273,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCI
|
|||
uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, char* Data, const uint16_t Length)
|
||||
{
|
||||
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
|
||||
return PIPE_READYWAIT_NoError;
|
||||
return PIPE_READYWAIT_DeviceDisconnected;
|
||||
|
||||
uint8_t ErrorCode;
|
||||
|
||||
|
@ -300,7 +300,7 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, ch
|
|||
uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data)
|
||||
{
|
||||
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
|
||||
return PIPE_READYWAIT_NoError;;
|
||||
return PIPE_READYWAIT_DeviceDisconnected;
|
||||
|
||||
uint8_t ErrorCode;
|
||||
|
||||
|
@ -338,7 +338,7 @@ uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
|
|||
uint16_t BytesInPipe = 0;
|
||||
|
||||
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
|
||||
return BytesInPipe;
|
||||
return 0;
|
||||
|
||||
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
|
||||
Pipe_SetPipeToken(PIPE_TOKEN_IN);
|
||||
|
@ -358,7 +358,7 @@ uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
|
|||
uint8_t ReceivedByte = 0;
|
||||
|
||||
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
|
||||
return ReceivedByte;
|
||||
return 0;
|
||||
|
||||
Pipe_SelectPipe(CDCInterfaceInfo->Config.DataINPipeNumber);
|
||||
Pipe_SetPipeToken(PIPE_TOKEN_IN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue