Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Embed: (wiki syntax)

« Back to documentation index

WLAN Methods

WLAN Methods
[Network]

Methods for joining/leaving a WLAN. More...

Functions

WiconnectResult join (const char *ssid=NULL, const char *password=NULL, const Callback &completeHandler=Callback())
 Join a WiFi network.
WiconnectResult leave ()
 Leave a WiFi network.
WiconnectResult getNetworkStatus (NetworkStatus *statusPtr)
 Get connection status to WiFi network.
WiconnectResult getNetworkJoinResult (NetworkJoinResult *joinResultPtr)
 Get the result of joining the network.
WiconnectResult getSignalStrength (NetworkSignalStrength *signalStrengthPtr)
 Get NetworkSignalStrength of WiFi network module is connected.
WiconnectResult getRssi (int32_t *rssiPtr)
 Get the RSSI in dBm of WiFi network.
WiconnectResult getMacAddress (MacAddress *macAddress)
 Get MAC address of the WiFi module.

Detailed Description

Methods for joining/leaving a WLAN.


Function Documentation

WiconnectResult getMacAddress ( MacAddress macAddress ) [inherited]

Get MAC address of the WiFi module.

WiconnectResult getNetworkJoinResult ( NetworkJoinResult joinResultPtr ) [inherited]

Get the result of joining the network.

Refer to NetworkJoinResult for more info.

Parameters:
[out]joinResultPtrPoint to a NetworkJoinResult which will hold the result of joining the network
Returns:
Result of method. See WiconnectResult
WiconnectResult getNetworkStatus ( NetworkStatus statusPtr ) [inherited]

Get connection status to WiFi network.

Refer to NetworkStatus for more info.

Parameters:
[out]statusPtrPoint to a NetworkStatus which will hold current network status of module
Returns:
Result of method. See WiconnectResult
WiconnectResult getRssi ( int32_t *  rssiPtr ) [inherited]

Get the RSSI in dBm of WiFi network.

WiconnectResult getSignalStrength ( NetworkSignalStrength signalStrengthPtr ) [inherited]

Get NetworkSignalStrength of WiFi network module is connected.

WiconnectResult join ( const char *  ssid = NULL,
const char *  password = NULL,
const Callback completeHandler = Callback() 
) [inherited]

Join a WiFi network.

This command has an optional background processing feature. Background processing is enabled if the completeHandler parameter is specified. If enabled, the library will poll the module every second for the join status (essentially it'll call getNetworkStatus() every second in the background). When the module join sequence complete the callback will be executed. The background processing is disabled when leave() is called.

* If completeHandler parameter is NOT specified: This command will BLOCK/return WICONNECT_PROCESSING until the module has either successfully joined the network or failed. * If the completeHandler parameter IS specified: This command will return and use the background processing feature described above.

Note:
only the 'result' parameter of the callback handler is valid.

Refer to Asynchronous Processing for more info.

Parameters:
[in]ssidOptional, optionally set the SSID of the network to join
[in]passwordOptional, optionally set the passkey of the network to join Note: to join an OPEN network, set this parameter to a null string (i.e. "")
[in]completeHandlerOptional, callback to be executed when the join sequence completes. The 'result' callback parameter contains the WiconnectResult of joining. The 'arg1' parameter is a NetworkJoinResult of joining.
Returns:
Result of method. See WiconnectResult
WiconnectResult leave (  ) [inherited]

Leave a WiFi network.

This method may be called to either terminate a join sequence or leave a previously connected networked.

Returns:
Result of method. See WiconnectResult