react-native-ble-manager
Advanced tools
Comparing version
@@ -253,3 +253,3 @@ "use strict"; | ||
// (ANDROID) Match as many advertisement per filter as hw could allow | ||
// dependes on current capability and availability of the resources in hw. | ||
// depends on current capability and availability of the resources in hw. | ||
if (scanningOptions.numberOfMatches == null) { | ||
@@ -264,7 +264,15 @@ scanningOptions.numberOfMatches = 3; | ||
// (ANDROID) Defaults to SCAN_MODE_LOW_POWER on android | ||
// (ANDROID) Defaults to SCAN_MODE_LOW_POWER | ||
if (scanningOptions.scanMode == null) { | ||
scanningOptions.scanMode = 0; | ||
} | ||
// (ANDROID) Defaults to CALLBACK_TYPE_ALL_MATCHES | ||
// WARN: sometimes, setting a scanSetting instead of leaving it untouched might result in unexpected behaviors. | ||
// https://github.com/dariuszseweryn/RxAndroidBle/issues/462 | ||
if (scanningOptions.callbackType == null) { | ||
scanningOptions.callbackType = 1; | ||
} | ||
// (ANDROID) Defaults to 0ms (report results immediately). | ||
if (scanningOptions.reportDelay == null) { | ||
@@ -271,0 +279,0 @@ scanningOptions.reportDelay = 0; |
@@ -29,2 +29,3 @@ declare module "react-native-ble-manager" { | ||
matchMode?: number; | ||
callbackType?: number; | ||
scanMode?: number; | ||
@@ -31,0 +32,0 @@ reportDelay?: number; |
{ | ||
"name": "react-native-ble-manager", | ||
"version": "8.6.0", | ||
"version": "8.7.0", | ||
"description": "A BLE module for react native.", | ||
@@ -5,0 +5,0 @@ "main": "BleManager", |
@@ -125,3 +125,3 @@ # react-native-ble-manager | ||
Scan for availables peripherals. | ||
Scan for available peripherals. | ||
Returns a `Promise` object. | ||
@@ -135,6 +135,7 @@ | ||
- `scanningOptions` - `JSON` - [Android only] after Android 5.0, user can control specific ble scan behaviors: | ||
- `numberOfMatches` - `Number` - [Android only] corresponding to [`setNumOfMatches`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setNumOfMatches(int)>) | ||
- `matchMode` - `Number` - [Android only] corresponding to [`setMatchMode`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setMatchMode(int)>) | ||
- `scanMode` - `Number` - [Android only] corresponding to [`setScanMode`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setScanMode(int)>) | ||
- `reportDelay` - `Number` - [Android only] corresponding to [`setReportDelay`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setReportDelay(long)>) | ||
- `numberOfMatches` - `Number` - [Android only] corresponding to [`setNumOfMatches`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setNumOfMatches(int)>). Defaults to `ScanSettings.MATCH_NUM_MAX_ADVERTISEMENT`. | ||
- `matchMode` - `Number` - [Android only] corresponding to [`setMatchMode`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setMatchMode(int)>). Defaults to `ScanSettings.MATCH_MODE_AGGRESSIVE`. | ||
- `callbackType` - `Number` - [Android only] corresponding to [`setCallbackType`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setCallbackType(int)>). Defaults `ScanSettings.CALLBACK_TYPE_ALL_MATCHES`. | ||
- `scanMode` - `Number` - [Android only] corresponding to [`setScanMode`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setScanMode(int)>). Defaults to `ScanSettings.SCAN_MODE_LOW_POWER`. | ||
- `reportDelay` - `Number` - [Android only] corresponding to [`setReportDelay`](<https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setReportDelay(long)>). Defaults to `0ms`. | ||
- `phy` - `Number` - [Android only] corresponding to [`setPhy`](https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder#setPhy(int)) | ||
@@ -141,0 +142,0 @@ - `legacy` - `Boolean` - [Android only] corresponding to [`setLegacy`](https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder#setLegacy(boolean)) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
216995
1.27%2821
1%841
0.12%