Setting WPA Mode and Key
The wln.setwpa method allows you to specify the WPA mode and key. Note that wln.setwpa is an immediate task and there is a certain correct way of handling tasks.
The wln.setwpa method will be rejected (return 1 — REJECTED) if the Wi-Fi add-on module is not booted property (wln.enabled = 0 — NO).
Tibbo devices only support the "personal" WPA modes WPA-PSK and WPA2-PSK.
The wln.setwpa method works differently on the GA1000 and WA2000.
The GA1000 is unable to handle WPA and WPA2 security completely on its own. The module requires help in the calculation of the so-called pre-shared key. The algorithm for this calculation is very complex and we are not going to explain it here. All this complexity is handled nicely by our WLN library.
The WA2000 handles everything related to WPA and WPA2 security internally. To set the WPA mode, call wln.setwpa, like this:
'ap_password is the password of the access point
If you are switching from an access point using WPA security to another access point with no security or WEP security, you still need to execute wln.setwpa(PL_WLN_WPA_DISABLED,0,"",0)!