cordova-plugin-hotspot
Advanced tools
Comparing version 0.6.3 to 0.6.4
{ | ||
"name": "cordova-plugin-hotspot", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "Cordova WiFi Hotspot Plugin", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -39,2 +39,17 @@ # Cordova HotSpot Plugin | ||
### Get connection configuration | ||
```javascript | ||
cordova.plugins.hotspot.getConnectionInfo( | ||
function (result) { | ||
// SSID | ||
// BSSID | ||
// linkSpeed | ||
// IPAddress | ||
},function () { | ||
// error | ||
} | ||
); | ||
``` | ||
### Get network configuration | ||
@@ -238,2 +253,14 @@ | ||
#### Toggle Wifi | ||
```javascript | ||
cordova.plugins.hotspot.toggleWifi( | ||
function (isActive) { | ||
// wifi is on | ||
},function (err) { | ||
// error | ||
} | ||
); | ||
``` | ||
#### Connect to Wifi | ||
@@ -240,0 +267,0 @@ |
@@ -47,3 +47,21 @@ /* | ||
}, | ||
/** | ||
* Method to Toggle wifi ON/OFF | ||
* | ||
* @param {Function} callback | ||
* A callback function with true or false as response,true if wifi ON and false if wifi OFF | ||
*/ | ||
toggleWifi: function (callback) { | ||
cordova.exec(function (code) { | ||
if (code === 1) { | ||
successCB(true); | ||
} else { | ||
successCB(false); | ||
} | ||
}, function (err) { | ||
errorCB(err); | ||
}, "HotSpotPlugin", "toggleWifi", [ssid, password, mode]); | ||
}, | ||
/** | ||
* Create a WiFi Hotspot | ||
@@ -335,2 +353,15 @@ * | ||
/** | ||
* Get current connection information, e.g SSID, linkSpeed,IPAddress etc | ||
* | ||
* @param {Function} successCB | ||
* A callback function to be called with all information | ||
* @param {Object} errorCB | ||
* An error callback | ||
*/ | ||
getConnectionInfo: function (successCB, errorCB) { | ||
cordova.exec(successCB, function (err) { | ||
errorCB(err); | ||
}, 'HotSpotPlugin', 'getConnectionInfo', []); | ||
}, | ||
/** | ||
* Ping a host | ||
@@ -337,0 +368,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28527634
3033
372