Transmitting Packets (Wireless)
NetDev_Tx()
is used to notify the wireless device that a new packet is available to be transmitted. It performs the following actions:
- The driver follow the procedure to access the SPI bus, and it takes all necessary steps to initiate transmission of the data by writing to the wireless device’s register using appropriate device’s BSP functions. The driver must configure the device with the number of bytes to transmit. This value contained in the
size
argument. - The driver must write the data stored in the network buffer to the device’s memory. The address of the buffer is specified by
p_data
which can be passed directly to ‘Write Read’ device’s BSP function pointer. - For wireless devices that do not support transmit completed notifications, the packet is assumed to be transmitted successfully, and the driver must perform the following actions.
- Post the address of the just-used network buffer to the transmit buffer de-allocation task by calling
NetOS_IF_TxDeallocTaskPost()
with the pointerp_data
. - Call
NetOS_Dev_TxRdySignal()
with the number of the interface that had just completed transmission.
- Post the address of the just-used network buffer to the transmit buffer de-allocation task by calling
- For wireless devices that do support transmit completed notifications, the previous transmit complete steps should be performed by
NetDev_MgmtDemux()
. NetDev_Tx()
setsp_err
toNET_DEV_ERR_NONE
and return from the transmit function.