Wln_change()
Description: |
API procedure, sets a different target wireless network for the WLN library. |
Syntax: |
function wln_change(byref ap_name as string, security_mode as pl_wln_security_modes, byref key as string) as en_wln_status_codes |
Returns: |
One of these en_wln_status_codes: WLN_STATUS_OK, WLN_STATUS_NOT_STARTED, WLN_STATUS_INVALID_SECURITY_MODE, WLN_STATUS_INVALID_WEP_KEY, WLN_STATUS_BUSY |
See Also: |
Step-by-step Usage Instructions, Operation Details, Roaming Between Access Points |
Parameter |
Description |
ap_name |
New 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(). |
Details
WLN library operation is non-blocking. Wln_change() 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.
You can't use this function before calling wln_start().