cordova-plugin-ble-central
Advanced tools
Comparing version 1.7.0-alpha.1 to 1.7.0-alpha.2
{ | ||
"name": "cordova-plugin-ble-central", | ||
"version": "1.7.0-alpha.1", | ||
"version": "1.7.0-alpha.2", | ||
"description": "Bluetooth Low Energy (BLE) Central Plugin", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -248,4 +248,5 @@ # Bluetooth Low Energy (BLE) Central Plugin for Apache Cordova | ||
- **options**: an object specifying a set of name-value pairs. The currently acceptable options are: | ||
- _reportDuplicates_: _true_ if duplicate devices should be reported, _false_ (default) if devices should only be reported once. [optional] | ||
- _scanMode_: String defines [setScanMode()](https://developer.android.com/reference/kotlin/android/bluetooth/le/ScanSettings.Builder#setscanmode) argument on Android. | ||
- _reportDuplicates_: _true_ if duplicate devices should be reported, _false_ (default) if devices should only be reported once. | ||
- _duration_: time in seconds to scan for. (default) Scans forever when not specified. | ||
- _scanMode_: String defines [setScanMode()](https://developer.android.com/reference/kotlin/android/bluetooth/le/ScanSettings.Builder#setscanmode) argument on Android. Default on Android is _lowPower_. When interactive scanning from an app, _lowLatency_ can boost how quickly the device is found, at the expense of using more battery power. | ||
Can be one of: _lowPower_ | _balanced_ | _lowLatency_ | _opportunistic_ | ||
@@ -252,0 +253,0 @@ - _callbackType_: String defines [setCallbackType()](https://developer.android.com/reference/kotlin/android/bluetooth/le/ScanSettings.Builder#setcallbacktype) argument on Android. |
@@ -19,10 +19,3 @@ | ||
deviceInfos: new Map(), | ||
scan: function(services, seconds, success, failure) { | ||
return this.startScanWithOptions(services, {}, success, failure); | ||
}, | ||
startScan: function(services, success, failure) { | ||
return this.startScanWithOptions(services, {}, success, failure); | ||
}, | ||
startScanWithOptions: function(services, options, success, failure) { | ||
startScanWithOptions: function (services, options, success, failure) { | ||
if (!navigator.bluetooth) { | ||
@@ -29,0 +22,0 @@ failure('Bluetooth is not supported on this browser.'); |
@@ -48,2 +48,4 @@ declare namespace BLECentralPlugin { | ||
reportDuplicates?: boolean; | ||
/** Scanning duration in seconds */ | ||
duration?: number; | ||
} | ||
@@ -50,0 +52,0 @@ |
@@ -54,15 +54,7 @@ // (c) 2014-2016 Don Coleman | ||
scan: function (services, seconds, success, failure) { | ||
var successWrapper = function (peripheral) { | ||
convertToNativeJS(peripheral); | ||
success(peripheral); | ||
}; | ||
cordova.exec(successWrapper, failure, 'BLE', 'scan', [services, seconds]); | ||
module.exports.startScanWithOptions(services, { duration: seconds }, success, failure); | ||
}, | ||
startScan: function (services, success, failure) { | ||
var successWrapper = function (peripheral) { | ||
convertToNativeJS(peripheral); | ||
success(peripheral); | ||
}; | ||
cordova.exec(successWrapper, failure, 'BLE', 'startScan', [services]); | ||
module.exports.startScanWithOptions(services, undefined, success, failure); | ||
}, | ||
@@ -69,0 +61,0 @@ |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85
1480
444759
2834