.setwpa Method

Function:

Causes the Wi-Fi interface to set new WPA mode and key.This method is an immediate task.

Syntax:

wln.setwpa(wpamode as pl_wln_wpa_modes, algorithm as pl_wln_wpa_algorithms, byref wpakey as string, cast as pl_wln_wpa_unicast_multicast) as accepted_rejected

Returns:

One of accepted_rejected constants:

  • 0 — ACCEPTED
  • 1 — REJECTED

See Also:

Setting WPA Mode and Key, wln.setwep


Part

Description

wpamode

WPA mode to set:

  • 0 — PL_WLN_WPA_DISABLED: WPA is to be disabled
  • 1 — PL_WLN_WPA_WPA1_PSK: WPA1-PSK is to be used
  • 2 — PL_WLN_WPA_WPA2_PSK: WPA2-PSK is to be used

algorithm

Encryption algorithm to be used:

  • 0 — PL_WLN_WPA_ALGORITHM_TKIP: TKIP algorithm
  • 1 — PL_WLN_WPA_ALGORITHM_AES: AES algorithm (also referred to as CCMP)

wpakey

  • GA1000: A string containing new WPA key (must be 16 characters long). The key is not the password to your access point. The key is calculated from the password. The math involved is complex and is better left to the WLN library.
  • WA2000, WM2000, WS1102: A string containing the password itself. These devices perform the WPA key calculation internally.

cast

Always set it to 1 — PL_WLN_WPA_CAST_MULTICAST.