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:

  1. 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.
  2. 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 until MgmtCompleted 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 received NetDev_MgmtProcessResp will be called. Also, WaitRespTimeout_ms should be set to let the Wireless Manager return an error when the response is not received.
  3. If the result is not sent via a response, NetDev_MgmtProcessCmd() must fill the return buffer with appropriate data following the stack format.
  4. NetDev_MgmtExecuteCmd() sets p_err to NET_DEV_ERR_NONE and returns from the execute management command function.