Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

NetDev_Rx() is called by μC/TCP-IP’s Receive task after the Interrupt Service Routine handler has signaled to the Receive task that a receive event has occurred. NetDev_Rx() requires that the device driver return a pointer to the data area containing the received data and return the size of the received frame via pointer.

...

Since NetDev_Rx() can be called to receive management frames and data packets, all wireless receive buffers must contain an offset before the data area to specify the frame type. So to understand data reception, you first need to understand the structure of receive buffers.

Panel
titleFigure - Wireless receive buffer structure

Image Added


Panel
bgColor#f0f0f0

(1)  The buffer offset is specified within the device’s Memory configuration. The offset must be at least equal to one octet to handle the Frame type. The offset can include option control data for demultiplex and or to respect the buffer alignment.

(2) The frame type space is always the first octet of the buffer. If receiving data packet, set the frame type equal to NET_IF_WIFI_DATA_PKT and the packet will be processed by the stack. For a management frame the byte must be set equal to NET_IF_WIFI_MGMT_FRAME, in this case NetDev_MgmtDemux() will be called after return to analyses the management frame and signal the Wireless Manager or update the driver data’s state.

(3) The receive buffer can include extra space to help to demultiplex a management frame or to respect buffer alignment required by the device’s BSP function.

(4) The pointer passed to the network device’s BSP function pointer, NetDev_WiFi_SPI_WrRd(), must point to the frame data area.


Receiving Frames

NetDev_Rx() should perform the following actions:

...