cordova-plugin-hotspot
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "cordova-plugin-hotspot", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Cordova WiFi Hotspot Plugin", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -149,2 +149,26 @@ # Cordova HotSpot Plugin | ||
#### Start Hotspot | ||
```javascript | ||
cordova.plugins.hotspot.startHotspot( | ||
function () { | ||
// Hotspot is started | ||
},function () { | ||
// Error | ||
} | ||
); | ||
``` | ||
#### Configure Hotspot | ||
```javascript | ||
cordova.plugins.hotspot.configureHotspot(ssid, mode, password, | ||
function () { | ||
// Hotspot is started | ||
},function () { | ||
// Error | ||
} | ||
); | ||
``` | ||
#### Stop Hotspot | ||
@@ -214,2 +238,14 @@ | ||
#### Connect to Wifi | ||
```javascript | ||
cordova.plugins.hotspot.connectToHotspot(ssid, password, | ||
function () { | ||
// connected | ||
},function () { | ||
// not connected | ||
} | ||
); | ||
``` | ||
### Check if device is connected to internet via Wifi | ||
@@ -216,0 +252,0 @@ |
@@ -57,3 +57,3 @@ /* | ||
* @param {Function} successCB | ||
* A callback function to be called when connected successful | ||
* A callback function to be called when start was successful | ||
* @param {Object} errorCB | ||
@@ -67,2 +67,42 @@ * A callback function to be called when connection was not successful | ||
}, | ||
/** | ||
* Start a default WiFi Hotspot | ||
* | ||
* @param {Function} successCB | ||
* A callback function to be called when start was successful | ||
* @param {Object} errorCB | ||
* A callback function to be called when start was not successful | ||
*/ | ||
startHotspot: function (successCB, errorCB) { | ||
cordova.exec(successCB, function (err) { | ||
errorCB(err); | ||
}, "HotSpotPlugin", "startHotspot", []); | ||
}, | ||
/** | ||
* Configure a running WiFi Hotspot | ||
* | ||
* @param {String} ssid | ||
* SSID to connect | ||
* @param {String} mode | ||
* wireless mode (Open, WEP, WPA, WPA_PSK) | ||
* @param {String} password | ||
* password to use | ||
* @param {Function} successCB | ||
* A callback function to be called when configuration was successful | ||
* @param {Object} errorCB | ||
* A callback function to be called when configuration was not successful | ||
*/ | ||
configureHotspot: function (ssid, mode, password, successCB, errorCB) { | ||
cordova.exec(successCB, function (err) { | ||
errorCB(err); | ||
}, "HotSpotPlugin", "configureHotspot", [ssid, password, mode]); | ||
}, | ||
/** | ||
* Stop a running default WiFi Hotspot | ||
* | ||
* @param {Function} successCB | ||
* A callback function to be called when stop was successful | ||
* @param {Object} errorCB | ||
* A callback function to be called when stop was not successful | ||
*/ | ||
stopHotspot: function (successCB, errorCB) { | ||
@@ -69,0 +109,0 @@ cordova.exec(successCB, function (err) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28523279
408
345