| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
RNDIS Class Device Mode Driver
RNDIS (Networking) Class Driver

## Detailed Description

# Module Source Dependencies

The following files must be built with any user project that uses this module:

- nxpUSBlib/Drivers/USB/Class/Device/RNDIS.c (Makefile source module name: NXPUSBLIB_SRC_USBCLASS)

# Module Description

Device Mode USB Class driver framework interface, for the RNDIS USB Class driver.

## Data Structures
struct | USB_ClassInfo_RNDIS_Device_t
| RNDIS Class Device Mode Configuration and State Structure. More...

## Functions
bool | RNDIS_Device_ConfigureEndpoints (USB_ClassInfo_RNDIS_Device_t *const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
| Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the given RNDIS interface is selected.
void | RNDIS_Device_ProcessControlRequest (USB_ClassInfo_RNDIS_Device_t *const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
| Processes incoming control requests from the host, that are directed to the given RNDIS class interface. This should be linked to the library EVENT_USB_Device_ControlRequest() event.
void | RNDIS_Device_USBTask (USB_ClassInfo_RNDIS_Device_t *const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1)
| General management task for a given RNDIS class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().
bool | RNDIS_Device_IsPacketReceived (USB_ClassInfo_RNDIS_Device_t *const RNDISInterfaceInfo)
| Determines if a packet is currently waiting for the device to read in and process.
uint8_t | RNDIS_Device_ReadPacket (USB_ClassInfo_RNDIS_Device_t *const RNDISInterfaceInfo, void *Buffer, uint16_t *const PacketLength)
| Retrieves the next pending packet from the device, discarding the remainder of the RNDIS packet header to leave only the packet contents for processing by the device in the nominated buffer.
uint8_t | RNDIS_Device_SendPacket (USB_ClassInfo_RNDIS_Device_t *const RNDISInterfaceInfo, void *Buffer, const uint16_t PacketLength)
| Sends the given packet to the attached RNDIS device, after adding a RNDIS packet message header.

## Function Documentation

bool RNDIS_Device_ConfigureEndpoints | ( | USB_ClassInfo_RNDIS_Device_t *const | RNDISInterfaceInfo | ) |

Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the given RNDIS interface is selected.

Parameters

  RNDISInterfaceInfo | : Pointer to a structure containing a RNDIS Class configuration and state.

Returns
  Boolean `true` if the endpoints were successfully configured, `false` otherwise.

Definition at line 116 of file RNDISClassDevice.c.

bool RNDIS_Device_IsPacketReceived | ( | USB_ClassInfo_RNDIS_Device_t *const | RNDISInterfaceInfo | ) |

Determines if a packet is currently waiting for the device to read in and process.

Precondition
  This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.

Parameters

  RNDISInterfaceInfo | : Pointer to a structure containing an RNDIS Class configuration and state.

Returns
  Boolean `true` if a packet is waiting to be read in by the host, `false` otherwise.

Definition at line 463 of file RNDISClassDevice.c.

void RNDIS_Device_ProcessControlRequest | ( | USB_ClassInfo_RNDIS_Device_t *const | RNDISInterfaceInfo | ) |

Processes incoming control requests from the host, that are directed to the given RNDIS class interface. This should be linked to the library EVENT_USB_Device_ControlRequest() event.

Parameters

  RNDISInterfaceInfo | : Pointer to a structure containing a RNDIS Class configuration and state.

Returns
  Nothing

Definition at line 73 of file RNDISClassDevice.c.

uint8_t RNDIS_Device_ReadPacket | ( | USB_ClassInfo_RNDIS_Device_t *const | RNDISInterfaceInfo,
|  | void * | Buffer,
|  | uint16_t *const | PacketLength
| ) |  |

Retrieves the next pending packet from the device, discarding the remainder of the RNDIS packet header to leave only the packet contents for processing by the device in the nominated buffer.

Precondition
  This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.

Parameters

  RNDISInterfaceInfo | : Pointer to a structure containing an RNDIS Class configuration and state.
  Buffer | : Pointer to a buffer where the packer data is to be written to.
  PacketLength | : Pointer to where the length in bytes of the read packet is to be stored.

Returns
  A value from the Endpoint_Stream_RW_ErrorCodes_t enum.

Definition at line 475 of file RNDISClassDevice.c.

uint8_t RNDIS_Device_SendPacket | ( | USB_ClassInfo_RNDIS_Device_t *const | RNDISInterfaceInfo,
|  | void * | Buffer,
|  | const uint16_t | PacketLength
| ) |  |

Sends the given packet to the attached RNDIS device, after adding a RNDIS packet message header.

Precondition
  This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or the call will fail.

Parameters

  RNDISInterfaceInfo | : Pointer to a structure containing an RNDIS Class configuration and state.
  Buffer | : Pointer to a buffer where the packer data is to be read from.
  PacketLength | : Length in bytes of the packet to send.

Returns
  A value from the Endpoint_Stream_RW_ErrorCodes_t enum.

Definition at line 510 of file RNDISClassDevice.c.

void RNDIS_Device_USBTask | ( | USB_ClassInfo_RNDIS_Device_t *const | RNDISInterfaceInfo | ) |

General management task for a given RNDIS class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().

Parameters

  RNDISInterfaceInfo | : Pointer to a structure containing a RNDIS Class configuration and state.

Returns
  Nothing

Definition at line 163 of file RNDISClassDevice.c.