react-native-ble-manager
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -71,5 +71,8 @@ 'use strict'; | ||
scan(serviceUUIDs, seconds) { | ||
scan(serviceUUIDs, seconds, allowDuplicates) { | ||
return new Promise((fulfill, reject) => { | ||
bleManager.scan(serviceUUIDs, seconds,(success) => { | ||
if (allowDuplicates == null) { | ||
allowDuplicates = false; | ||
} | ||
bleManager.scan(serviceUUIDs, seconds, allowDuplicates, (success) => { | ||
fulfill(); | ||
@@ -76,0 +79,0 @@ }); |
{ | ||
"name": "react-native-ble-manager", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A BLE module for react native.", | ||
@@ -18,3 +18,4 @@ "main": "BleManager", | ||
"ble", | ||
"bluetooth" | ||
"bluetooth", | ||
"low energy" | ||
], | ||
@@ -21,0 +22,0 @@ "license": "Apache-2.0", |
@@ -72,6 +72,7 @@ # react-native-ble-manager | ||
- `seconds` - `Integer` - the amount of seconds to scan. | ||
- `allowDuplicates` - `Boolean` - [iOS only] allow duplicates in device scanning | ||
__Examples__ | ||
```js | ||
BleManager.scan([], 5) | ||
BleManager.scan([], 5, true) | ||
.then(() => { | ||
@@ -81,3 +82,3 @@ // Success code | ||
}); | ||
``` | ||
@@ -172,3 +173,3 @@ | ||
- `characteristicUUID` - `String` - the UUID of the characteristic. | ||
__Examples__ | ||
@@ -196,3 +197,3 @@ ```js | ||
- `data` - `String` - the data to write in Base64 format. | ||
To get the `data` into base64 format, you will need a library like `base64-js`. Install `base64-js`: | ||
@@ -232,4 +233,4 @@ | ||
'BleManagerStopScan', | ||
() => { | ||
// Scanning is stopped | ||
() => { | ||
// Scanning is stopped | ||
} | ||
@@ -249,3 +250,3 @@ ); | ||
'BleManagerDidUpdateState', | ||
(args) => { | ||
(args) => { | ||
// The new state: args.state | ||
@@ -267,3 +268,3 @@ } | ||
'BleManagerDiscoverPeripheral', | ||
(args) => { | ||
(args) => { | ||
// The id: args.id | ||
@@ -288,2 +289,1 @@ // The name: args.name | ||
- `peripheral` - `String` - the id of the peripheral | ||
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
112578
73
0