511
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Wi-Fi devices routinely define four WEP keys, but Tibbo hardware only
uses a single key (key 1).
Associating With Selected Network
Association is a process by which your Wi-Fi device establishes a network link with
an access point or another wireless station running an ad-hoc network.
The association process is initiated using the
method. Association
is a required step before you will be able to send and receive the data over the Wi-
Fi. Note that wln.associate is a
and there is a certain correct way of
handling tasks. Also, you can only associate from an idle state (
= 0- PL_WLN_NOT_ASSOCIATED).
Prior to associating, you need to set the
(if required). You also need to
know several key parameters about the network you are associating with:
SSID (name) of this network;
BSSID ("MAC") of this network;
Channel on which this network operates;
BSS mode of this network (whether the network is infrastructure or ad-hoc).
Normally, the SSID is known, but BSSID, channel, and BSS mode require some
digging. The easiest way to sniff out this info is through
. The
fills out
, and
R/O properties. You only need to put them to good use, as
shown here:
'connect to the access point named TIBBO.
wln.wepmode=PL_WLN_WEP_MODE_DISABLED
'This one has WEP switched off --
don't even count on it in real life!
wln.scan("TIBBO")
'scanning for a specific network will give us necessary
parameters
While
wln.task<>PL_WLN_TASK_IDLE
Wend
If
wln.scanresultssid<>""
Then
'scanning failed for some reason
End
If
'now can associate: 'wln.scanresult' properties contain necessary data
after the scanning
wln.associate(wln.scanresultbssid, wln.scanresultssid,
wln.scanresultchannel, wln.scanresultbssmode)
While
wln.task<>PL_WLN_TASK_IDLE
Wend
If
wln.associationstate=PL_WLN_ASSOCIATED
Then
'successful association!
...
End
If
After the association task is completed you have to check the association result.
Mere task completion does not indicate success! The
will
provide the indication.
Once you have achieved association, you can
over the Wi-Fi
interface. Re-association is not allowed, you need to
first.
Disassociation can also happen automatically (for example, if the access point goes
offline or out of range), and the wln object will be able to
this.
513
500
514
509
509
524
525
526
525
514
512
512
513