Wln_start()

Top  Previous  Next

Description:

API procedure, commences attempts to bring up (boot) the Wi-Fi interface, find and associate with the specified wireless network, and then keep associated at all times.

Syntax:

wln_start(byref ap_name as string, security_mode as pl_wln_security_modes, byref key as string, domain as pl_wln_domains) as en_wln_status_codes

Returns:

One of these en_wln_status_codes: WLN_STATUS_OK, WLN_STATUS_OUT_OF_SOCKETS, WLN_STATUS_INSUFFICIENT_BUFFER_SPACE, WLN_STATUS_MISSING_FIRMWARE_FILE, WLN_STATUS_BOOT_FAILURE, WLN_STATUS_INVALID_SECURITY_MODE, WLN_STATUS_INVALID_WEP_KEY

See Also:

Step-by-step Usage Instructions, Operation Details, The Simplest Example

 


Part

Description

ap_name

The SSID (name) of the wireless network to associate with.

security_mode

One of pl_wln_security_modes:

0- WLN_SECURITY_MODE_DISABLED,

1- WLN_SECURITY_MODE_WEP64,

2- WLN_SECURITY_MODE_WEP128,

3- WLN_SECURITY_MODE_WPA1 (will be accepted only if WLN_WPA is defined as 1),

4- WLN_SECURITY_MODE_WPA2 (will be accepted only if WLN_WPA is defined as 1)

key

For WEP64 mode, a string of 10 HEX characters (characters `0`~`9`, `A`~`F`, or `a`~`f` ). For WEP128 mode, a string of 26 HEX characters. For WPA1-PSK and WPA2-PSK modes, this is the pre-shared master key, which is not the "human" password. The key can be calculated using wln_wpa_mkey_get().

domain

Defines the set of channels on which the Wi-Fi interface will operate. Possible values are:

0- PL_WLN_DOMAIN_FCC (default): FCC domain (US). Allowed channels: 1-11.

1- PL_WLN_DOMAIN_EU: European Union. Allowed channels: 1-13.

2- PL_WLN_DOMAIN_JAPAN: Japan. Allowed channels: 1-14.

3- PL_WLN_DOMAIN_OTHER: All other countries. Allowed channels: 1-11.

Details

WLN library operation is non-blocking. Wln_start() will quickly return control to your application and the rest of the library's operation will continue in the background.

The WLN library uses active scanning (wln.activescan) and, therefore, will be able to find access points that do not broadcast their SSIDs.

If several access points with the same SSID are in range, the WLN library will automatically select the access point with the strongest signal.