react-native-ble-manager 11.6.4 → 11.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/android/src/main/java/it/innove/DefaultScanManager.java +164 -29
- package/dist/cjs/types.d.ts +5 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/types.d.ts +5 -0
- package/dist/esm/types.js.map +1 -1
- package/package.json +1 -1
- package/src/types.ts +5 -0
package/README.md
CHANGED
|
@@ -7,17 +7,24 @@ import android.Manifest;
|
|
|
7
7
|
import android.annotation.SuppressLint;
|
|
8
8
|
import android.bluetooth.BluetoothAdapter;
|
|
9
9
|
import android.bluetooth.BluetoothDevice;
|
|
10
|
+
import android.bluetooth.le.BluetoothLeScanner;
|
|
10
11
|
import android.bluetooth.le.ScanCallback;
|
|
11
12
|
import android.bluetooth.le.ScanFilter;
|
|
12
13
|
import android.bluetooth.le.ScanRecord;
|
|
13
14
|
import android.bluetooth.le.ScanResult;
|
|
14
15
|
import android.bluetooth.le.ScanSettings;
|
|
16
|
+
import android.app.PendingIntent;
|
|
17
|
+
import android.content.BroadcastReceiver;
|
|
18
|
+
import android.content.Context;
|
|
19
|
+
import android.content.Intent;
|
|
20
|
+
import android.content.IntentFilter;
|
|
15
21
|
import android.content.pm.PackageManager;
|
|
16
22
|
import android.os.Build;
|
|
17
23
|
import android.os.ParcelUuid;
|
|
18
24
|
import android.util.Log;
|
|
19
25
|
|
|
20
26
|
import androidx.core.app.ActivityCompat;
|
|
27
|
+
import androidx.core.content.ContextCompat;
|
|
21
28
|
|
|
22
29
|
import com.facebook.react.bridge.Arguments;
|
|
23
30
|
import com.facebook.react.bridge.Callback;
|
|
@@ -29,11 +36,20 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
29
36
|
import java.util.ArrayList;
|
|
30
37
|
import java.util.Arrays;
|
|
31
38
|
import java.util.List;
|
|
39
|
+
import java.util.Objects;
|
|
32
40
|
|
|
33
41
|
@SuppressLint("MissingPermission")
|
|
34
42
|
public class DefaultScanManager extends ScanManager {
|
|
35
43
|
|
|
36
44
|
private boolean isScanning = false;
|
|
45
|
+
private PendingIntent scanPendingIntent;
|
|
46
|
+
private BroadcastReceiver scanReceiver;
|
|
47
|
+
private boolean scanReceiverRegistered = false;
|
|
48
|
+
private boolean scanningWithIntent = false;
|
|
49
|
+
private static final String ACTION_SCAN_RESULT = "it.innove.BleManager.ACTION_SCAN_RESULT";
|
|
50
|
+
private static final String EXTRA_LIST_SCAN_RESULT = "android.bluetooth.le.extra.LIST_SCAN_RESULT";
|
|
51
|
+
private static final String EXTRA_SCAN_RESULT = "android.bluetooth.le.extra.SCAN_RESULT";
|
|
52
|
+
private static final String EXTRA_ERROR_CODE = "android.bluetooth.le.extra.ERROR_CODE";
|
|
37
53
|
|
|
38
54
|
public DefaultScanManager(ReactApplicationContext reactContext, BleManager bleManager) {
|
|
39
55
|
super(reactContext, bleManager);
|
|
@@ -45,8 +61,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
45
61
|
// update scanSessionId to prevent stopping next scan by running timeout thread
|
|
46
62
|
scanSessionId.incrementAndGet();
|
|
47
63
|
|
|
48
|
-
|
|
49
|
-
isScanning = false;
|
|
64
|
+
stopActiveScan();
|
|
50
65
|
callback.invoke();
|
|
51
66
|
}
|
|
52
67
|
|
|
@@ -63,16 +78,14 @@ public class DefaultScanManager extends ScanManager {
|
|
|
63
78
|
scanSettingsBuilder.setScanMode(options.getInt("scanMode"));
|
|
64
79
|
}
|
|
65
80
|
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
scanSettingsBuilder.setCallbackType(options.getInt("callbackType"));
|
|
75
|
-
}
|
|
81
|
+
if (options.hasKey("numberOfMatches")) {
|
|
82
|
+
scanSettingsBuilder.setNumOfMatches(options.getInt("numberOfMatches"));
|
|
83
|
+
}
|
|
84
|
+
if (options.hasKey("matchMode")) {
|
|
85
|
+
scanSettingsBuilder.setMatchMode(options.getInt("matchMode"));
|
|
86
|
+
}
|
|
87
|
+
if (options.hasKey("callbackType")) {
|
|
88
|
+
scanSettingsBuilder.setCallbackType(options.getInt("callbackType"));
|
|
76
89
|
}
|
|
77
90
|
|
|
78
91
|
if (options.hasKey("reportDelay")) {
|
|
@@ -99,7 +112,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
99
112
|
|
|
100
113
|
|
|
101
114
|
if (options.hasKey("exactAdvertisingName")) {
|
|
102
|
-
ArrayList<Object> expectedNames = options.getArray("exactAdvertisingName").toArrayList();
|
|
115
|
+
ArrayList<Object> expectedNames = Objects.requireNonNull(options.getArray("exactAdvertisingName")).toArrayList();
|
|
103
116
|
Log.d(BleManager.LOG_TAG, "Filter on advertising names:" + expectedNames);
|
|
104
117
|
for (Object name : expectedNames) {
|
|
105
118
|
ScanFilter filter = new ScanFilter.Builder().setDeviceName(name.toString()).build();
|
|
@@ -132,25 +145,66 @@ public class DefaultScanManager extends ScanManager {
|
|
|
132
145
|
return;
|
|
133
146
|
}
|
|
134
147
|
Log.d(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
BleManager.LOG_TAG,
|
|
149
|
+
String.format(
|
|
150
|
+
"Filter on manufacturerId: %d; manufacturerData: %s; manufacturerDataMask: %s",
|
|
151
|
+
manufacturerId,
|
|
152
|
+
Arrays.toString(manufacturerDataBytes),
|
|
153
|
+
Arrays.toString(manufacturerDataMaskBytes)
|
|
154
|
+
)
|
|
142
155
|
);
|
|
143
156
|
ScanFilter filter = new ScanFilter.Builder()
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
.setManufacturerData(
|
|
158
|
+
manufacturerId,
|
|
159
|
+
manufacturerDataBytes,
|
|
160
|
+
manufacturerDataMaskBytes
|
|
161
|
+
).build();
|
|
149
162
|
filters.add(filter);
|
|
150
163
|
}
|
|
151
164
|
}
|
|
152
165
|
|
|
153
|
-
|
|
166
|
+
boolean useScanIntent = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && options.hasKey("useScanIntent") && options.getBoolean("useScanIntent");
|
|
167
|
+
|
|
168
|
+
if (isScanning) {
|
|
169
|
+
scanSessionId.incrementAndGet();
|
|
170
|
+
stopActiveScan();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
BluetoothLeScanner scanner = getBluetoothAdapter().getBluetoothLeScanner();
|
|
174
|
+
if (scanner == null) {
|
|
175
|
+
callback.invoke("No BLE scanner available");
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
if (useScanIntent) {
|
|
181
|
+
Log.i(BleManager.LOG_TAG, "Scan with intent");
|
|
182
|
+
ensureScanReceiver();
|
|
183
|
+
Intent intent = new Intent(ACTION_SCAN_RESULT);
|
|
184
|
+
intent.setPackage(context.getPackageName());
|
|
185
|
+
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
|
|
186
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
187
|
+
flags |= PendingIntent.FLAG_MUTABLE;
|
|
188
|
+
}
|
|
189
|
+
scanPendingIntent = PendingIntent.getBroadcast(context, 0, intent, flags);
|
|
190
|
+
scanner.startScan(filters, scanSettingsBuilder.build(), scanPendingIntent);
|
|
191
|
+
scanningWithIntent = true;
|
|
192
|
+
} else {
|
|
193
|
+
scanner.startScan(filters, scanSettingsBuilder.build(), mScanCallback);
|
|
194
|
+
scanningWithIntent = false;
|
|
195
|
+
}
|
|
196
|
+
} catch (Exception e) {
|
|
197
|
+
if (useScanIntent) {
|
|
198
|
+
if (scanPendingIntent != null) {
|
|
199
|
+
scanPendingIntent.cancel();
|
|
200
|
+
scanPendingIntent = null;
|
|
201
|
+
}
|
|
202
|
+
unregisterScanReceiver();
|
|
203
|
+
}
|
|
204
|
+
callback.invoke("Failed to start scan: " + e.getMessage());
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
154
208
|
isScanning = true;
|
|
155
209
|
|
|
156
210
|
if (scanSeconds > 0) {
|
|
@@ -161,7 +215,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
161
215
|
public void run() {
|
|
162
216
|
|
|
163
217
|
try {
|
|
164
|
-
Thread.sleep(scanSeconds *
|
|
218
|
+
Thread.sleep(scanSeconds * 1000L);
|
|
165
219
|
} catch (InterruptedException ignored) {
|
|
166
220
|
}
|
|
167
221
|
|
|
@@ -173,8 +227,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
173
227
|
// check current scan session was not stopped
|
|
174
228
|
if (scanSessionId.intValue() == currentScanSession) {
|
|
175
229
|
if (btAdapter.getState() == BluetoothAdapter.STATE_ON) {
|
|
176
|
-
|
|
177
|
-
isScanning = false;
|
|
230
|
+
stopActiveScan();
|
|
178
231
|
}
|
|
179
232
|
|
|
180
233
|
WritableMap map = Arguments.createMap();
|
|
@@ -264,4 +317,86 @@ public class DefaultScanManager extends ScanManager {
|
|
|
264
317
|
public void setScanning(boolean scanning) {
|
|
265
318
|
isScanning = scanning;
|
|
266
319
|
}
|
|
320
|
+
|
|
321
|
+
private void stopActiveScan() {
|
|
322
|
+
BluetoothLeScanner scanner = getBluetoothAdapter() != null ? getBluetoothAdapter().getBluetoothLeScanner() : null;
|
|
323
|
+
if (scanner != null) {
|
|
324
|
+
try {
|
|
325
|
+
if (scanningWithIntent && scanPendingIntent != null) {
|
|
326
|
+
scanner.stopScan(scanPendingIntent);
|
|
327
|
+
} else {
|
|
328
|
+
scanner.stopScan(mScanCallback);
|
|
329
|
+
}
|
|
330
|
+
} catch (IllegalArgumentException | IllegalStateException ignored) {
|
|
331
|
+
Log.w(BleManager.LOG_TAG, "stopScan ignored error: " + ignored.getMessage());
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (scanPendingIntent != null) {
|
|
335
|
+
scanPendingIntent.cancel();
|
|
336
|
+
scanPendingIntent = null;
|
|
337
|
+
}
|
|
338
|
+
unregisterScanReceiver();
|
|
339
|
+
scanningWithIntent = false;
|
|
340
|
+
isScanning = false;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
private void ensureScanReceiver() {
|
|
344
|
+
if (scanReceiver == null) {
|
|
345
|
+
scanReceiver = new BroadcastReceiver() {
|
|
346
|
+
@Override
|
|
347
|
+
public void onReceive(Context context, Intent intent) {
|
|
348
|
+
if (!ACTION_SCAN_RESULT.equals(intent.getAction())) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (intent.hasExtra(EXTRA_ERROR_CODE)) {
|
|
353
|
+
final int errorCode = intent.getIntExtra(EXTRA_ERROR_CODE, ScanCallback.SCAN_FAILED_INTERNAL_ERROR);
|
|
354
|
+
runOnUiThread(new Runnable() {
|
|
355
|
+
@Override
|
|
356
|
+
public void run() {
|
|
357
|
+
stopActiveScan();
|
|
358
|
+
isScanning = false;
|
|
359
|
+
WritableMap map = Arguments.createMap();
|
|
360
|
+
map.putInt("status", errorCode);
|
|
361
|
+
bleManager.sendEvent("BleManagerStopScan", map);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
final ArrayList<ScanResult> results = intent.getParcelableArrayListExtra(EXTRA_LIST_SCAN_RESULT);
|
|
368
|
+
final ScanResult singleResult = intent.getParcelableExtra(EXTRA_SCAN_RESULT);
|
|
369
|
+
|
|
370
|
+
runOnUiThread(new Runnable() {
|
|
371
|
+
@Override
|
|
372
|
+
public void run() {
|
|
373
|
+
if (results != null) {
|
|
374
|
+
for (ScanResult result : results) {
|
|
375
|
+
onDiscoveredPeripheral(result);
|
|
376
|
+
}
|
|
377
|
+
} else if (singleResult != null) {
|
|
378
|
+
onDiscoveredPeripheral(singleResult);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (!scanReceiverRegistered) {
|
|
387
|
+
IntentFilter intentFilter = new IntentFilter(ACTION_SCAN_RESULT);
|
|
388
|
+
ContextCompat.registerReceiver(context, scanReceiver, intentFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
|
|
389
|
+
scanReceiverRegistered = true;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
private void unregisterScanReceiver() {
|
|
394
|
+
if (scanReceiverRegistered) {
|
|
395
|
+
try {
|
|
396
|
+
context.unregisterReceiver(scanReceiver);
|
|
397
|
+
} catch (IllegalArgumentException ignored) {
|
|
398
|
+
}
|
|
399
|
+
scanReceiverRegistered = false;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
267
402
|
}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -152,6 +152,11 @@ export interface ScanOptions {
|
|
|
152
152
|
*/
|
|
153
153
|
single?: boolean;
|
|
154
154
|
companion?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Deliver scan results via a PendingIntent instead of the default ScanCallback.
|
|
157
|
+
* Useful when you need background delivery.
|
|
158
|
+
*/
|
|
159
|
+
useScanIntent?: boolean;
|
|
155
160
|
}
|
|
156
161
|
export interface CompanionScanOptions {
|
|
157
162
|
/**
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA;;;KAGK;AACL,IAAY,QAwBX;AAxBD,WAAY,QAAQ;IAClB;;OAEG;IACH,+BAAmB,CAAA;IACnB;;OAEG;IACH,mCAAuB,CAAA;IACvB,uCAA2B,CAAA;IAC3B;;OAEG;IACH,yCAA6B,CAAA;IAC7B,qBAAS,CAAA;IACT,uBAAW,CAAA;IACX;;OAEG;IACH,oCAAwB,CAAA;IACxB;;OAEG;IACH,s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AS,CAAA;IACT,qDAAS,CAAA;IACT,2DAAY,CAAA;IACZ,uEAAmB,CAAA;AACrB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB;AAED;;GAEG;AACH,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mEAAY,CAAA;IACZ,2DAAQ,CAAA;IACR,yDAAO,CAAA;AACT,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAsCD,IAAY,YAmBX;AAnBD,WAAY,YAAY;IACtB,qEAAqD,CAAA;IACrD,yDAAyC,CAAA;IACzC,6EAA6D,CAAA;IAC7D,uGAAuF,CAAA;IACvF,2EAA2D,CAAA;IAC3D,iFAAiE,CAAA;IACjE;;OAEG;IACH,2EAA2D,CAAA;IAC3D;;OAEG;IACH,qGAAqF,CAAA;IACrF;;OAEG;IACH,mGAAmF,CAAA;AACrF,CAAC,EAnBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAmBvB"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -152,6 +152,11 @@ export interface ScanOptions {
|
|
|
152
152
|
*/
|
|
153
153
|
single?: boolean;
|
|
154
154
|
companion?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Deliver scan results via a PendingIntent instead of the default ScanCallback.
|
|
157
|
+
* Useful when you need background delivery.
|
|
158
|
+
*/
|
|
159
|
+
useScanIntent?: boolean;
|
|
155
160
|
}
|
|
156
161
|
export interface CompanionScanOptions {
|
|
157
162
|
/**
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;KAGK;AACL,MAAM,CAAN,IAAY,QAwBX;AAxBD,WAAY,QAAQ;IAClB;;OAEG;IACH,+BAAmB,CAAA;IACnB;;OAEG;IACH,mCAAuB,CAAA;IACvB,uCAA2B,CAAA;IAC3B;;OAEG;IACH,yCAA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,QAI5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,qDAAS,CAAA;IACT,qDAAS,CAAA;IACT,2DAAY,CAAA;IACZ,uEAAmB,CAAA;AACrB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mEAAY,CAAA;IACZ,2DAAQ,CAAA;IACR,yDAAO,CAAA;AACT,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAsCD,MAAM,CAAN,IAAY,YAmBX;AAnBD,WAAY,YAAY;IACtB,qEAAqD,CAAA;IACrD,yDAAyC,CAAA;IACzC,6EAA6D,CAAA;IAC7D,uGAAuF,CAAA;IACvF,2EAA2D,CAAA;IAC3D,iFAAiE,CAAA;IACjE;;OAEG;IACH,2EAA2D,CAAA;IAC3D;;OAEG;IACH,qGAAqF,CAAA;IACrF;;OAEG;IACH,mGAAmF,CAAA;AACrF,CAAC,EAnBW,YAAY,KAAZ,YAAY,QAmBvB"}
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -158,6 +158,11 @@ export interface ScanOptions {
|
|
|
158
158
|
*/
|
|
159
159
|
single?: boolean;
|
|
160
160
|
companion?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Deliver scan results via a PendingIntent instead of the default ScanCallback.
|
|
163
|
+
* Useful when you need background delivery.
|
|
164
|
+
*/
|
|
165
|
+
useScanIntent?: boolean;
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
export interface CompanionScanOptions {
|