react-native-ble-manager 12.2.2 → 12.3.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/android/src/main/java/it/innove/DefaultPeripheral.java +6 -2
- package/android/src/main/java/it/innove/DefaultScanManager.java +158 -15
- package/dist/cjs/types.d.ts +5 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/types.d.ts +5 -1
- package/dist/esm/types.js.map +1 -1
- package/package.json +12 -18
- package/src/types.ts +5 -1
|
@@ -16,7 +16,7 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
16
16
|
|
|
17
17
|
import java.nio.ByteBuffer;
|
|
18
18
|
import java.util.Map;
|
|
19
|
-
|
|
19
|
+
import java.util.Objects;
|
|
20
20
|
|
|
21
21
|
@SuppressLint("MissingPermission")
|
|
22
22
|
public class DefaultPeripheral extends Peripheral {
|
|
@@ -40,7 +40,11 @@ public class DefaultPeripheral extends Peripheral {
|
|
|
40
40
|
WritableMap advertising = Arguments.createMap();
|
|
41
41
|
|
|
42
42
|
try {
|
|
43
|
-
|
|
43
|
+
String name = device.getName();
|
|
44
|
+
if (name == null) {
|
|
45
|
+
name = Objects.requireNonNull(scanResult.getScanRecord()).getDeviceName();
|
|
46
|
+
}
|
|
47
|
+
map.putString("name", name);
|
|
44
48
|
map.putString("id", device.getAddress()); // mac address
|
|
45
49
|
map.putInt("rssi", advertisingRSSI);
|
|
46
50
|
|
|
@@ -7,19 +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.BluetoothDevice;
|
|
11
10
|
import android.bluetooth.le.BluetoothLeScanner;
|
|
12
11
|
import android.bluetooth.le.ScanCallback;
|
|
13
12
|
import android.bluetooth.le.ScanFilter;
|
|
14
13
|
import android.bluetooth.le.ScanRecord;
|
|
15
14
|
import android.bluetooth.le.ScanResult;
|
|
16
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;
|
|
17
21
|
import android.content.pm.PackageManager;
|
|
18
22
|
import android.os.Build;
|
|
19
23
|
import android.os.ParcelUuid;
|
|
20
24
|
import android.util.Log;
|
|
21
25
|
|
|
22
26
|
import androidx.core.app.ActivityCompat;
|
|
27
|
+
import androidx.core.content.ContextCompat;
|
|
23
28
|
|
|
24
29
|
import com.facebook.react.bridge.Arguments;
|
|
25
30
|
import com.facebook.react.bridge.Callback;
|
|
@@ -36,6 +41,14 @@ import java.util.List;
|
|
|
36
41
|
public class DefaultScanManager extends ScanManager {
|
|
37
42
|
|
|
38
43
|
private boolean isScanning = false;
|
|
44
|
+
private PendingIntent scanPendingIntent;
|
|
45
|
+
private BroadcastReceiver scanReceiver;
|
|
46
|
+
private boolean scanReceiverRegistered = false;
|
|
47
|
+
private boolean scanningWithIntent = false;
|
|
48
|
+
private static final String ACTION_SCAN_RESULT = "it.innove.BleManager.ACTION_SCAN_RESULT";
|
|
49
|
+
private static final String EXTRA_LIST_SCAN_RESULT = "android.bluetooth.le.extra.LIST_SCAN_RESULT";
|
|
50
|
+
private static final String EXTRA_SCAN_RESULT = "android.bluetooth.le.extra.SCAN_RESULT";
|
|
51
|
+
private static final String EXTRA_ERROR_CODE = "android.bluetooth.le.extra.ERROR_CODE";
|
|
39
52
|
|
|
40
53
|
public DefaultScanManager(ReactApplicationContext reactContext, BleManager bleManager) {
|
|
41
54
|
super(reactContext, bleManager);
|
|
@@ -47,10 +60,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
47
60
|
// update scanSessionId to prevent stopping next scan by running timeout thread
|
|
48
61
|
scanSessionId.incrementAndGet();
|
|
49
62
|
|
|
50
|
-
|
|
51
|
-
if (scanner != null)
|
|
52
|
-
scanner.stopScan(mScanCallback);
|
|
53
|
-
isScanning = false;
|
|
63
|
+
stopActiveScan();
|
|
54
64
|
callback.invoke();
|
|
55
65
|
}
|
|
56
66
|
|
|
@@ -103,11 +113,17 @@ public class DefaultScanManager extends ScanManager {
|
|
|
103
113
|
|
|
104
114
|
|
|
105
115
|
if (options.hasKey("exactAdvertisingName")) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
ReadableArray exactAdvertisingNameArray = options.getArray("exactAdvertisingName");
|
|
117
|
+
if (exactAdvertisingNameArray == null) {
|
|
118
|
+
Log.w(BleManager.LOG_TAG, "exactAdvertisingName key present but array is null");
|
|
119
|
+
}
|
|
120
|
+
if (exactAdvertisingNameArray != null) {
|
|
121
|
+
ArrayList<Object> expectedNames = exactAdvertisingNameArray.toArrayList();
|
|
122
|
+
Log.d(BleManager.LOG_TAG, "Filter on advertising names:" + expectedNames);
|
|
123
|
+
for (Object name : expectedNames) {
|
|
124
|
+
ScanFilter filter = new ScanFilter.Builder().setDeviceName(name.toString()).build();
|
|
125
|
+
filters.add(filter);
|
|
126
|
+
}
|
|
111
127
|
}
|
|
112
128
|
}
|
|
113
129
|
|
|
@@ -154,7 +170,55 @@ public class DefaultScanManager extends ScanManager {
|
|
|
154
170
|
}
|
|
155
171
|
}
|
|
156
172
|
|
|
157
|
-
|
|
173
|
+
boolean useScanIntent = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
|
174
|
+
&& options.hasKey("useScanIntent")
|
|
175
|
+
&& options.getBoolean("useScanIntent");
|
|
176
|
+
|
|
177
|
+
if (useScanIntent && Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
|
178
|
+
callback.invoke("useScanIntent requires Android O (API 26) or higher");
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (isScanning) {
|
|
183
|
+
scanSessionId.incrementAndGet();
|
|
184
|
+
stopActiveScan();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
BluetoothLeScanner scanner = getBluetoothAdapter().getBluetoothLeScanner();
|
|
188
|
+
if (scanner == null) {
|
|
189
|
+
callback.invoke("No BLE scanner available");
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
if (useScanIntent) {
|
|
195
|
+
Log.i(BleManager.LOG_TAG, "Scan with intent");
|
|
196
|
+
ensureScanReceiver();
|
|
197
|
+
Intent intent = new Intent(ACTION_SCAN_RESULT);
|
|
198
|
+
intent.setPackage(context.getPackageName());
|
|
199
|
+
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
|
|
200
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
201
|
+
flags |= PendingIntent.FLAG_MUTABLE;
|
|
202
|
+
}
|
|
203
|
+
scanPendingIntent = PendingIntent.getBroadcast(context, 0, intent, flags);
|
|
204
|
+
scanner.startScan(filters, scanSettingsBuilder.build(), scanPendingIntent);
|
|
205
|
+
scanningWithIntent = true;
|
|
206
|
+
} else {
|
|
207
|
+
scanner.startScan(filters, scanSettingsBuilder.build(), mScanCallback);
|
|
208
|
+
scanningWithIntent = false;
|
|
209
|
+
}
|
|
210
|
+
} catch (Exception e) {
|
|
211
|
+
if (useScanIntent) {
|
|
212
|
+
if (scanPendingIntent != null) {
|
|
213
|
+
scanPendingIntent.cancel();
|
|
214
|
+
scanPendingIntent = null;
|
|
215
|
+
}
|
|
216
|
+
unregisterScanReceiver();
|
|
217
|
+
}
|
|
218
|
+
callback.invoke("Failed to start scan: " + e.getMessage());
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
158
222
|
isScanning = true;
|
|
159
223
|
|
|
160
224
|
if (scanSeconds > 0) {
|
|
@@ -165,7 +229,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
165
229
|
public void run() {
|
|
166
230
|
|
|
167
231
|
try {
|
|
168
|
-
Thread.sleep(scanSeconds *
|
|
232
|
+
Thread.sleep(scanSeconds * 1000L);
|
|
169
233
|
} catch (InterruptedException ignored) {
|
|
170
234
|
}
|
|
171
235
|
|
|
@@ -177,9 +241,7 @@ public class DefaultScanManager extends ScanManager {
|
|
|
177
241
|
// check current scan session was not stopped
|
|
178
242
|
if (scanSessionId.intValue() == currentScanSession) {
|
|
179
243
|
if (btAdapter.getState() == BluetoothAdapter.STATE_ON) {
|
|
180
|
-
|
|
181
|
-
if (scanner != null) scanner.stopScan(mScanCallback);
|
|
182
|
-
isScanning = false;
|
|
244
|
+
stopActiveScan();
|
|
183
245
|
}
|
|
184
246
|
|
|
185
247
|
WritableMap map = Arguments.createMap();
|
|
@@ -269,4 +331,85 @@ public class DefaultScanManager extends ScanManager {
|
|
|
269
331
|
public void setScanning(boolean scanning) {
|
|
270
332
|
isScanning = scanning;
|
|
271
333
|
}
|
|
334
|
+
|
|
335
|
+
private void stopActiveScan() {
|
|
336
|
+
BluetoothLeScanner scanner = getBluetoothAdapter() != null ? getBluetoothAdapter().getBluetoothLeScanner() : null;
|
|
337
|
+
if (scanner != null) {
|
|
338
|
+
try {
|
|
339
|
+
if (scanningWithIntent && scanPendingIntent != null) {
|
|
340
|
+
scanner.stopScan(scanPendingIntent);
|
|
341
|
+
} else {
|
|
342
|
+
scanner.stopScan(mScanCallback);
|
|
343
|
+
}
|
|
344
|
+
} catch (IllegalArgumentException | IllegalStateException ignored) {
|
|
345
|
+
Log.w(BleManager.LOG_TAG, "stopScan ignored error: " + ignored.getMessage());
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (scanPendingIntent != null) {
|
|
349
|
+
scanPendingIntent.cancel();
|
|
350
|
+
scanPendingIntent = null;
|
|
351
|
+
}
|
|
352
|
+
unregisterScanReceiver();
|
|
353
|
+
scanningWithIntent = false;
|
|
354
|
+
isScanning = false;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
private void ensureScanReceiver() {
|
|
358
|
+
if (scanReceiver == null) {
|
|
359
|
+
scanReceiver = new BroadcastReceiver() {
|
|
360
|
+
@Override
|
|
361
|
+
public void onReceive(Context context, Intent intent) {
|
|
362
|
+
if (!ACTION_SCAN_RESULT.equals(intent.getAction())) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (intent.hasExtra(EXTRA_ERROR_CODE)) {
|
|
367
|
+
final int errorCode = intent.getIntExtra(EXTRA_ERROR_CODE, ScanCallback.SCAN_FAILED_INTERNAL_ERROR);
|
|
368
|
+
runOnUiThread(new Runnable() {
|
|
369
|
+
@Override
|
|
370
|
+
public void run() {
|
|
371
|
+
stopActiveScan();
|
|
372
|
+
WritableMap map = Arguments.createMap();
|
|
373
|
+
map.putInt("status", errorCode);
|
|
374
|
+
bleManager.emitOnStopScan(map);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
final ArrayList<ScanResult> results = intent.getParcelableArrayListExtra(EXTRA_LIST_SCAN_RESULT);
|
|
381
|
+
final ScanResult singleResult = intent.getParcelableExtra(EXTRA_SCAN_RESULT);
|
|
382
|
+
|
|
383
|
+
runOnUiThread(new Runnable() {
|
|
384
|
+
@Override
|
|
385
|
+
public void run() {
|
|
386
|
+
if (results != null) {
|
|
387
|
+
for (ScanResult result : results) {
|
|
388
|
+
onDiscoveredPeripheral(result);
|
|
389
|
+
}
|
|
390
|
+
} else if (singleResult != null) {
|
|
391
|
+
onDiscoveredPeripheral(singleResult);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (!scanReceiverRegistered) {
|
|
400
|
+
IntentFilter intentFilter = new IntentFilter(ACTION_SCAN_RESULT);
|
|
401
|
+
ContextCompat.registerReceiver(context, scanReceiver, intentFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
|
|
402
|
+
scanReceiverRegistered = true;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
private void unregisterScanReceiver() {
|
|
407
|
+
if (scanReceiverRegistered) {
|
|
408
|
+
try {
|
|
409
|
+
context.unregisterReceiver(scanReceiver);
|
|
410
|
+
} catch (IllegalArgumentException ignored) {
|
|
411
|
+
}
|
|
412
|
+
scanReceiverRegistered = false;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
272
415
|
}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -149,9 +149,13 @@ export interface ScanOptions {
|
|
|
149
149
|
* When using compaion mode, only associate single peripheral.
|
|
150
150
|
*
|
|
151
151
|
* See: https://developer.android.com/reference/android/companion/AssociationRequest.Builder#setSingleDevice(boolean)
|
|
152
|
-
|
|
152
|
+
*/
|
|
153
153
|
single?: boolean;
|
|
154
154
|
companion?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* [Android O+] Deliver scan results using a PendingIntent instead of the default callback.
|
|
157
|
+
*/
|
|
158
|
+
useScanIntent?: boolean;
|
|
155
159
|
}
|
|
156
160
|
export interface CompanionScanOptions {
|
|
157
161
|
/**
|
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,sCAA0B,CAAA;AAC5B,CAAC,EAxBW,QAAQ,wBAAR,QAAQ,QAwBnB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA;;;KAGK;AACL,IAAY,QAw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,kBAAkB,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,4BAAZ,YAAY,QAmBvB"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -149,9 +149,13 @@ export interface ScanOptions {
|
|
|
149
149
|
* When using compaion mode, only associate single peripheral.
|
|
150
150
|
*
|
|
151
151
|
* See: https://developer.android.com/reference/android/companion/AssociationRequest.Builder#setSingleDevice(boolean)
|
|
152
|
-
|
|
152
|
+
*/
|
|
153
153
|
single?: boolean;
|
|
154
154
|
companion?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* [Android O+] Deliver scan results using a PendingIntent instead of the default callback.
|
|
157
|
+
*/
|
|
158
|
+
useScanIntent?: boolean;
|
|
155
159
|
}
|
|
156
160
|
export interface CompanionScanOptions {
|
|
157
161
|
/**
|
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,yCAA6B,CAAA;IAC7B,qBAAS,CAAA;IACT,uBAAW,CAAA;IACX;;OAEG;IACH,oCAAwB,CAAA;IACxB;;OAEG;IACH,sCAA0B,CAAA;AAC5B,CAAC,EAxBW,QAAQ,KAAR,QAAQ,QAwBnB;
|
|
1
|
+
{"version":3,"file":"types.js","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AEG;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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ble-manager",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.0",
|
|
4
4
|
"description": "A BLE module for react native.",
|
|
5
5
|
"homepage": "https://innoveit.github.io/react-native-ble-manager/",
|
|
6
6
|
"repository": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"postversion": "git push --follow-tags"
|
|
64
64
|
},
|
|
65
65
|
"resolutions": {
|
|
66
|
-
"@types/react": "^
|
|
66
|
+
"@types/react": "^19.2.2"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "*",
|
|
@@ -71,22 +71,16 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@commitlint/config-conventional": "^19.6.0",
|
|
74
|
-
"@react-native/eslint-config": "^0.
|
|
75
|
-
"@
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"prettier": "^3.3.3",
|
|
85
|
-
"react": "18.3.1",
|
|
86
|
-
"react-native": "0.76.2",
|
|
87
|
-
"@react-native/gradle-plugin": "^0.76.2",
|
|
88
|
-
"turbo": "^2.3.0",
|
|
89
|
-
"typescript": "^5.6.3",
|
|
74
|
+
"@react-native/eslint-config": "^0.82.1",
|
|
75
|
+
"@types/react": "^19.2.2",
|
|
76
|
+
"eslint": "^9.39.1",
|
|
77
|
+
"eslint-config-prettier": "^10.1.8",
|
|
78
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
79
|
+
"prettier": "^3.6.2",
|
|
80
|
+
"react": "19.2.0",
|
|
81
|
+
"react-native": "0.82.1",
|
|
82
|
+
"@react-native/gradle-plugin": "^0.82.1",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
90
84
|
"@expo/config-plugins": "^9.0.10",
|
|
91
85
|
"expo-module-scripts": "^4.0.2"
|
|
92
86
|
},
|
package/src/types.ts
CHANGED
|
@@ -155,9 +155,13 @@ export interface ScanOptions {
|
|
|
155
155
|
* When using compaion mode, only associate single peripheral.
|
|
156
156
|
*
|
|
157
157
|
* See: https://developer.android.com/reference/android/companion/AssociationRequest.Builder#setSingleDevice(boolean)
|
|
158
|
-
|
|
158
|
+
*/
|
|
159
159
|
single?: boolean;
|
|
160
160
|
companion?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* [Android O+] Deliver scan results using a PendingIntent instead of the default callback.
|
|
163
|
+
*/
|
|
164
|
+
useScanIntent?: boolean;
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
export interface CompanionScanOptions {
|