.Associate Method

Top  Previous  Next

 

Function:

Causes the Wi-Fi interface to commence association with the wireless network specified by the wln.ssid property.

Syntax:

wln.associate() as accepted_rejected

Returns:

One of accepted_rejected constants:

0- ACCEPTED.

1- REJECTED.

See Also:

Associating With Selected Network, Setting WEP Mode and Keys, Wln Tasks

 


Details

Prior to performing an association attempt, the application must preset the following: WEP mode and keys if required (see wln.wepmode, wln.wepkey1... wln.wepkey4, and wln.setwep), desired network mode (wln.bssmode), network name (wln.ssid), and default channel (wln.defaultibsschannel) in case of ad-hoc network mode . For more information see the Associating With Selected Network topic.

The association process is a task. As such, the wln.associate will be rejected (return 1- REJECTED) if another task is currently in progress. The task will also be rejected if the Wi-Fi interface is already in the associated state (wln.associationstate= 1- PL_WLN_ASSOCIATED), or if the Wi-Fi hardware is not online (wln.enabled= 0- NO). The method will return 0- ACCEPTED if the task is accepted for processing.

The task is completed when the wln.task R/O property becomes 0- PL_WLN_TASK_IDLE. The on_wln_task_complete event will also be generated at that time.

Task completion does not imply success -- association result has to be verified by reading the state of tthe wln.associationstate read-only property after the task is completed.