Start Back Next End
  
ZBasic System Library
ZBasic Microcontrollers
49
Wifi.Scan
Type
Function returning UnsignedInteger
Invocation
Wifi.Scan(nodeList, count)
Parameter
Method
Type
Description
nodeList
ByRef
array of WifiScan_t
The array in which to return information about
available access points.
count
ByVal
anyIntegral
The number of elements in the nodeList array.
Discussion
This function invokes a scan of available Wi-Fi access points, returning the information in the passed
array (up to its maximum number of elements).  The return value indicates how many elements of the
passed array were populated.  Note that the array is populated with information on the available access
points in the order in which they were detected, without regard to signal strength or any other attribute of
the access point.
Each element of the scan node array has the pre-defined structure as shown below.
Structure WifiScan_t
   Dim ssid as String          ' SSID
   Dim chan as Byte            ' channel number
   Dim auth as Byte            ' authorization mode
   Dim rssi as Integer         ' relative signal strength
   Dim mac(1 to 6) as Byte     ' MAC address
End Structure
This pre-defined structure may be included in your application by using the following compiler directive:
Option Include WifiScan_t
The auth member of the WifiScan_t structure contains an indicator of the authorization mode of the
access point as described in the table below.
Access Point Authorization Mode Values
Value
Meaning
0
No encryption, i.e. an open access point.
1
WEP encryption.
2
WPA/PSK encryption.
3
WPA2/PSK encryption.
4
WPA/WPA2/PSK encryption.
The rssi member of the WifiScan_t structure gives the relative signal string in units of decibels.  The
values are generally negative and the less negative values represent stronger signals.
The mac member of the WifiScan_t structure is an array of bytes giving the MAC address of the
access point.
N.B.: This routine must not be called from the UserInit() routine.
Previous page Top Next page