Versions Compared

Key

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

Leaving Wireless Access Point

When an application needs to leave a wireless access point, it can do so by calling the NetIF_WiFi_Leave() API function with the necessary parameters.

A call to NetIF_WiFi_Leave() is shown below.

 

 

Listing 5-22 Call to NetIF_WiFi_Leave()

L5-22(1) NetIF_WiFi_Leave() requires two arguments. The first function argument is the interface number. The interface number is acquired upon successful addition of the interface and upon the successful start of the interface.

L5-22(2) The last argument is a pointer to a NET_ERR to contain the return error code. The return error variable will contain the value NET_IF_WIFI_ERR_NONE if the leave process has been completed successfully.

There are very few things that could cause a network interface to leave improperly. You should always inspect the return error code and take the appropriate action if an error occurs. Once the error is resolved, the application may again attempt to call NetIF_WiFi_Leave().