Stopping a Network Device (Wireless)
NetDev_Stop()
is called once each time an interface is stopped.
NetDev_Stop()
must perform the following operations:
- Disable the receiver and transmitter.
- Disable all local MAC interrupt sources.
- Clear all local MAC interrupt status flags.
- Power down the wireless device via network device’s BSP function pointer,
NetDev_WiFi_Stop()
. - For wireless devices which can queued up packet to transmit, free all transmit buffer not yet transmitted by calling
NetOS_IF_DeallocTaskPost()
with the address of the transmit buffer data areas. - Set perr to
NET_DEV_ERR_NONE
if no error occurs. Otherwise, setperr
to an appropriate network device error code.
Some wireless module return result of commands via a response. The device’s Wireless Manager function pointer, NetWiFiMgr_Mgmt()
should be used to perform these type of command since it will return only when the response is received and processed.