Handle operation on wifi sensor.

Usage

wifi keyword is needed to instanciate this sting.

var wifi = require('wifi');

Data accessors

Methods

Events

Full Example

var wifi = require('wifi');
var recorder = require('recorder');

var dataResult = wifi.data();


recorder.save({
    'NONE Authentication' : wifi.isAuthentication(wifi.NONE),
    'bssid' : wifi.bssid(),
    'frequency' : wifi.frequency(),
    'rssi' : wifi.rssi(),
    'ssid' : wifi.ssid(),
    'CONNECTED State' : wifi.isState(wifi.CONNECTED),
    'timestamp' : wifi.timestamp(),
    'json' : wifi.data()
});

wifi.onStateChanged(function(data) {
    recorder.save(data);
    recorder.sync();
});

wifi.onSsidChanged(function(data) {
    recorder.save(data);
    recorder.sync();
});

wifi.onScanCompleted(function(data) {
    recorder.save(data);
    recorder.sync();
});

authentication

Retrieve the Authentication mode used by the network.

authentication();

Parameters

  • None.

Return

bssid

Retrieve the Basic Service Set IDentifier.

bssid();

Parameters

  • None.

Return

  • bssid : String, Basic Service Set IDentifier

frequency

Retrieve the Interface frequency.

frequency();

Parameters

  • None.

Return

  • frequency : Double, Interface frequency

isAuthentication

Test the current authentication value against the given one.

isAuthentication(value);

Parameters

Return

  • Boolean

isState

Test the current state value against the given one.

isState(value);

Parameters

Return

  • Boolean

rssi

Retrieve the Received Signal Strength Indication.

rssi();

Parameters

  • None.

Return

  • rssi : Double, Received Signal Strength Indication

ssid

Retrieve the Service Set IDentifier.

ssid();

Parameters

  • None.

Return

  • ssid : String, Service Set IDentifier

state

Retrieve the Description of the WiFi interface state.

state();

Parameters

  • None.

Return

  • state : WifiState, Description of the WiFi interface state

timestamp

Retrieve the represents the time of the operation..

timestamp();

Parameters

  • None.

Return

  • timestamp : Long, represents the time of the operation.

data

Returns every available seed.

data();

Parameters

  • None.

Returns

onStateChanged

Starts a listener on the wifi state and executes some actions when it changes.

onStateChanged(callback);

Parameters

Return

  • token : Token used for canceling event listener.

onSsidChanged

Starts a listener on the wifi ssid and executes some actions when it changes.

onSsidChanged(callback);

Parameters

Return

  • token : Token used for canceling event listener.

onScanCompleted

Starts a listener on the wifi scan and executes some actions when it changes.

onScanCompleted(callback);

Parameters

Return

  • token : Token used for canceling event listener.