How to Execute Management Command
NetDev_MgmtExcuteCmd()
is used to notify the wireless device that a new management command must be executed. It performs the following actions:
- The driver follow the procedure to access the SPI bus and it takes all necessary steps to initiate the management command by writing to the wireless device’s register using appropriate device’s BSP functions. The driver must use the command data argument to send the data needed by the wireless device to perform the management command.
- Update the pointer to the device’s Wireless Manager context state argument following how the command result must be handled by the Wireless Manager.
- If the management command requires multiple calls to
NetDev_MgmtExecuteCmd()
before completion,MgmtCompleted
should be set to false. By doing this,NetDev_MgmtExecuteCmd
is called in loop untilMgmtCompleted
comes equal to true or an error is returned. - If the management command requires to wait a response before completing the management command process,
WaitResp
must be set equal to true. In this case, once the response is receivedNetDev_MgmtProcessResp
will be called. Also,WaitRespTimeout_ms
should be set to let the Wireless Manager return an error when the response is not received.
- If the management command requires multiple calls to
- If the result is not sent via a response,
NetDev_MgmtProcessCmd()
must fill the return buffer with appropriate data following the stack format. NetDev_MgmtExecuteCmd()
setsp_err
toNET_DEV_ERR_NONE
and returns from the execute management command function.