Joining A Wireless Access Point

When a wireless network interface is started, it becomes an active interface that is not yet capable of transmitting and receiving data, since no operational link to a network medium is configured. Once the interface has found a wireless network, it must join it to get an operational link. A wireless network interface should be able to join any time after the network interface has been successfully started and before having joined any other wireless access points. See NetIF_WiFi_Join for more information.

The application developer may join a wireless network by calling the NetIF_WiFi_Join() API function with the necessary parameters. A call to NetIF_WiFi_Join() is shown below.

Listing - Calling NetIF_Join()
NET_ERR         err;

ap_ctn = NetIF_WiFi_Join(if_nbr,                              (1)
                         NET_IF_WIFI_NET_TYPE_INFRASTRUCTURE, (2)
                         NET_IF_WIFI_DATA_RATE_AUTO,          (3)
                         NET_IF_WIFI_SECURITY_WPA2,           (4)
                         NET_IF_WIFI_PWR_LEVEL_HI,            (5)
                        "network_ssid",                       (6)
                        "network_password",                   (7)
                        &err);                                (8)
  1. NetIF_WiFi_Join() requires eight arguments. The first function argument is the interface number that the application wants to join with. The interface number is acquired upon successfully adding and starting the interface.
  2. The second argument is wireless network type.
  3. The third argument is data rate use to communicate on the wireless network.
  4. The fourth argument is the wireless security configured for the wireless network to join.
  5. The fifth argument is the wireless radio power level used to communicate on the wireless network.
  6. The sixth argument is a pointer to a string that contains the SSID of the wireless access point to join.
  7. The seventh argument is a pointer to a string that contains the pre-shared key of the wireless access point to join.
  8. The last argument is a pointer to a NET_ERR that contains the return error code. The return error variable will contain the value NET_IF_WIFI_ERR_NONE if the join process has been completed successfully.


There are very few things that could cause a network interface to not join properly. The application developer 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_Join().