react-native-bluebreeze 0.0.12 → 1.0.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 +97 -13
- package/android/build.gradle +2 -3
- package/android/generated/jni/CMakeLists.txt +1 -9
- package/android/generated/jni/RNBlueBreezeSpec-generated.cpp +1 -1
- package/android/generated/jni/react/renderer/components/RNBlueBreezeSpec/RNBlueBreezeSpecJSI.h +234 -279
- package/android/src/main/java/com/bluebreeze/BlueBreezeModule.kt +140 -120
- package/ios/BlueBreezeImpl.swift +30 -24
- package/ios/Bluebreeze.h +1 -1
- package/ios/Bluebreeze.mm +2 -7
- package/ios/generated/{RNBlueBreezeSpecJSI.h → ReactCodegen/RNBlueBreezeSpecJSI.h} +234 -279
- package/lib/commonjs/implementation/bluebreeze_characteristic.js +42 -11
- package/lib/commonjs/implementation/bluebreeze_characteristic.js.map +1 -1
- package/lib/commonjs/implementation/bluebreeze_connection_status.js +2 -0
- package/lib/commonjs/implementation/bluebreeze_connection_status.js.map +1 -0
- package/lib/commonjs/implementation/bluebreeze_device.js +53 -13
- package/lib/commonjs/implementation/bluebreeze_device.js.map +1 -1
- package/lib/commonjs/implementation/bluebreeze_scan_result.js +19 -0
- package/lib/commonjs/implementation/bluebreeze_scan_result.js.map +1 -1
- package/lib/commonjs/implementation/bluebreeze_service.js +9 -0
- package/lib/commonjs/implementation/bluebreeze_service.js.map +1 -1
- package/lib/commonjs/implementation/native_bridge.js +108 -0
- package/lib/commonjs/implementation/native_bridge.js.map +1 -0
- package/lib/commonjs/index.js +29 -100
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/module/implementation/bluebreeze_characteristic.js +43 -10
- package/lib/module/implementation/bluebreeze_characteristic.js.map +1 -1
- package/lib/module/implementation/bluebreeze_connection_status.js +2 -0
- package/lib/module/implementation/bluebreeze_connection_status.js.map +1 -0
- package/lib/module/implementation/bluebreeze_device.js +54 -12
- package/lib/module/implementation/bluebreeze_device.js.map +1 -1
- package/lib/module/implementation/bluebreeze_scan_result.js +19 -0
- package/lib/module/implementation/bluebreeze_scan_result.js.map +1 -1
- package/lib/module/implementation/bluebreeze_service.js +9 -0
- package/lib/module/implementation/bluebreeze_service.js.map +1 -1
- package/lib/module/implementation/native_bridge.js +99 -0
- package/lib/module/implementation/native_bridge.js.map +1 -0
- package/lib/module/index.js +29 -100
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeBlueBreeze.d.ts +1 -1
- package/lib/typescript/commonjs/src/NativeBlueBreeze.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_authorization.d.ts +10 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_authorization.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_characteristic.d.ts +29 -0
- package/lib/typescript/commonjs/src/implementation/bluebreeze_characteristic.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_connection_status.d.ts +7 -0
- package/lib/typescript/commonjs/src/implementation/bluebreeze_connection_status.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/implementation/bluebreeze_device.d.ts +42 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_scan_result.d.ts +11 -0
- package/lib/typescript/commonjs/src/implementation/bluebreeze_scan_result.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_service.d.ts +6 -0
- package/lib/typescript/commonjs/src/implementation/bluebreeze_service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_state.d.ts +16 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_state.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/native_bridge.d.ts +17 -0
- package/lib/typescript/commonjs/src/implementation/native_bridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +0 -13
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeBlueBreeze.d.ts +1 -1
- package/lib/typescript/module/src/NativeBlueBreeze.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_authorization.d.ts +10 -1
- package/lib/typescript/module/src/implementation/bluebreeze_authorization.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_characteristic.d.ts +29 -0
- package/lib/typescript/module/src/implementation/bluebreeze_characteristic.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_connection_status.d.ts +7 -0
- package/lib/typescript/module/src/implementation/bluebreeze_connection_status.d.ts.map +1 -0
- package/lib/typescript/module/src/implementation/bluebreeze_device.d.ts +43 -2
- package/lib/typescript/module/src/implementation/bluebreeze_device.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_scan_result.d.ts +12 -1
- package/lib/typescript/module/src/implementation/bluebreeze_scan_result.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_service.d.ts +7 -1
- package/lib/typescript/module/src/implementation/bluebreeze_service.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_state.d.ts +16 -1
- package/lib/typescript/module/src/implementation/bluebreeze_state.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/native_bridge.d.ts +17 -0
- package/lib/typescript/module/src/implementation/native_bridge.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +6 -19
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +13 -23
- package/react-native-bluebreeze.podspec +1 -1
- package/src/NativeBlueBreeze.ts +1 -1
- package/src/implementation/bluebreeze_authorization.ts +10 -1
- package/src/implementation/bluebreeze_characteristic.ts +48 -10
- package/src/implementation/bluebreeze_connection_status.ts +6 -0
- package/src/implementation/bluebreeze_device.ts +62 -13
- package/src/implementation/bluebreeze_scan_result.ts +18 -0
- package/src/implementation/bluebreeze_service.ts +8 -0
- package/src/implementation/bluebreeze_state.ts +16 -1
- package/src/implementation/native_bridge.ts +196 -0
- package/src/index.tsx +24 -202
- package/android/generated/jni/react/renderer/components/RNBlueBreezeSpec/RNBlueBreezeSpecJSI-generated.cpp +0 -179
- package/ios/generated/RNBlueBreezeSpecJSI-generated.cpp +0 -179
- /package/ios/generated/{RNBlueBreezeSpec → ReactCodegen/RNBlueBreezeSpec}/RNBlueBreezeSpec-generated.mm +0 -0
- /package/ios/generated/{RNBlueBreezeSpec → ReactCodegen/RNBlueBreezeSpec}/RNBlueBreezeSpec.h +0 -0
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
namespace facebook::react {
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
#pragma mark - NativeBlueBreezeBBDeviceCharacteristicDataEvent
|
|
20
19
|
|
|
21
20
|
template <typename P0, typename P1, typename P2, typename P3>
|
|
22
21
|
struct NativeBlueBreezeBBDeviceCharacteristicDataEvent {
|
|
23
|
-
P0 id;
|
|
24
|
-
P1 serviceId;
|
|
25
|
-
P2 characteristicId;
|
|
22
|
+
P0 id{};
|
|
23
|
+
P1 serviceId{};
|
|
24
|
+
P2 characteristicId{};
|
|
26
25
|
P3 value;
|
|
27
26
|
bool operator==(const NativeBlueBreezeBBDeviceCharacteristicDataEvent &other) const {
|
|
28
27
|
return id == other.id && serviceId == other.serviceId && characteristicId == other.characteristicId && value == other.value;
|
|
@@ -49,15 +48,12 @@ struct NativeBlueBreezeBBDeviceCharacteristicDataEventBridging {
|
|
|
49
48
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
50
49
|
return bridging::toJs(rt, value);
|
|
51
50
|
}
|
|
52
|
-
|
|
53
51
|
static jsi::String serviceIdToJs(jsi::Runtime &rt, decltype(types.serviceId) value) {
|
|
54
52
|
return bridging::toJs(rt, value);
|
|
55
53
|
}
|
|
56
|
-
|
|
57
54
|
static jsi::String characteristicIdToJs(jsi::Runtime &rt, decltype(types.characteristicId) value) {
|
|
58
55
|
return bridging::toJs(rt, value);
|
|
59
56
|
}
|
|
60
|
-
|
|
61
57
|
static jsi::Array valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
62
58
|
return bridging::toJs(rt, value);
|
|
63
59
|
}
|
|
@@ -82,9 +78,9 @@ struct NativeBlueBreezeBBDeviceCharacteristicDataEventBridging {
|
|
|
82
78
|
|
|
83
79
|
template <typename P0, typename P1, typename P2, typename P3>
|
|
84
80
|
struct NativeBlueBreezeBBDeviceCharacteristicNotifyEnabledEvent {
|
|
85
|
-
P0 id;
|
|
86
|
-
P1 serviceId;
|
|
87
|
-
P2 characteristicId;
|
|
81
|
+
P0 id{};
|
|
82
|
+
P1 serviceId{};
|
|
83
|
+
P2 characteristicId{};
|
|
88
84
|
P3 value;
|
|
89
85
|
bool operator==(const NativeBlueBreezeBBDeviceCharacteristicNotifyEnabledEvent &other) const {
|
|
90
86
|
return id == other.id && serviceId == other.serviceId && characteristicId == other.characteristicId && value == other.value;
|
|
@@ -111,15 +107,12 @@ struct NativeBlueBreezeBBDeviceCharacteristicNotifyEnabledEventBridging {
|
|
|
111
107
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
112
108
|
return bridging::toJs(rt, value);
|
|
113
109
|
}
|
|
114
|
-
|
|
115
110
|
static jsi::String serviceIdToJs(jsi::Runtime &rt, decltype(types.serviceId) value) {
|
|
116
111
|
return bridging::toJs(rt, value);
|
|
117
112
|
}
|
|
118
|
-
|
|
119
113
|
static jsi::String characteristicIdToJs(jsi::Runtime &rt, decltype(types.characteristicId) value) {
|
|
120
114
|
return bridging::toJs(rt, value);
|
|
121
115
|
}
|
|
122
|
-
|
|
123
116
|
static bool valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
124
117
|
return bridging::toJs(rt, value);
|
|
125
118
|
}
|
|
@@ -144,7 +137,7 @@ struct NativeBlueBreezeBBDeviceCharacteristicNotifyEnabledEventBridging {
|
|
|
144
137
|
|
|
145
138
|
template <typename P0, typename P1>
|
|
146
139
|
struct NativeBlueBreezeSpecDevice {
|
|
147
|
-
P0 id;
|
|
140
|
+
P0 id{};
|
|
148
141
|
P1 name;
|
|
149
142
|
bool operator==(const NativeBlueBreezeSpecDevice &other) const {
|
|
150
143
|
return id == other.id && name == other.name;
|
|
@@ -169,7 +162,6 @@ struct NativeBlueBreezeSpecDeviceBridging {
|
|
|
169
162
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
170
163
|
return bridging::toJs(rt, value);
|
|
171
164
|
}
|
|
172
|
-
|
|
173
165
|
static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) {
|
|
174
166
|
return bridging::toJs(rt, value);
|
|
175
167
|
}
|
|
@@ -194,8 +186,8 @@ struct NativeBlueBreezeSpecDeviceBridging {
|
|
|
194
186
|
|
|
195
187
|
template <typename P0, typename P1, typename P2>
|
|
196
188
|
struct NativeBlueBreezeSpecDeviceCharacteristic {
|
|
197
|
-
P0 id;
|
|
198
|
-
P1 name;
|
|
189
|
+
P0 id{};
|
|
190
|
+
P1 name{};
|
|
199
191
|
P2 properties;
|
|
200
192
|
bool operator==(const NativeBlueBreezeSpecDeviceCharacteristic &other) const {
|
|
201
193
|
return id == other.id && name == other.name && properties == other.properties;
|
|
@@ -221,11 +213,9 @@ struct NativeBlueBreezeSpecDeviceCharacteristicBridging {
|
|
|
221
213
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
222
214
|
return bridging::toJs(rt, value);
|
|
223
215
|
}
|
|
224
|
-
|
|
225
216
|
static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) {
|
|
226
217
|
return bridging::toJs(rt, value);
|
|
227
218
|
}
|
|
228
|
-
|
|
229
219
|
static jsi::Array propertiesToJs(jsi::Runtime &rt, decltype(types.properties) value) {
|
|
230
220
|
return bridging::toJs(rt, value);
|
|
231
221
|
}
|
|
@@ -251,7 +241,7 @@ struct NativeBlueBreezeSpecDeviceCharacteristicBridging {
|
|
|
251
241
|
|
|
252
242
|
template <typename P0, typename P1>
|
|
253
243
|
struct NativeBlueBreezeSpecDeviceConnectionStatus {
|
|
254
|
-
P0 id;
|
|
244
|
+
P0 id{};
|
|
255
245
|
P1 value;
|
|
256
246
|
bool operator==(const NativeBlueBreezeSpecDeviceConnectionStatus &other) const {
|
|
257
247
|
return id == other.id && value == other.value;
|
|
@@ -276,7 +266,6 @@ struct NativeBlueBreezeSpecDeviceConnectionStatusBridging {
|
|
|
276
266
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
277
267
|
return bridging::toJs(rt, value);
|
|
278
268
|
}
|
|
279
|
-
|
|
280
269
|
static jsi::String valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
281
270
|
return bridging::toJs(rt, value);
|
|
282
271
|
}
|
|
@@ -299,7 +288,7 @@ struct NativeBlueBreezeSpecDeviceConnectionStatusBridging {
|
|
|
299
288
|
|
|
300
289
|
template <typename P0, typename P1>
|
|
301
290
|
struct NativeBlueBreezeSpecDeviceMTU {
|
|
302
|
-
P0 id;
|
|
291
|
+
P0 id{};
|
|
303
292
|
P1 value;
|
|
304
293
|
bool operator==(const NativeBlueBreezeSpecDeviceMTU &other) const {
|
|
305
294
|
return id == other.id && value == other.value;
|
|
@@ -324,7 +313,6 @@ struct NativeBlueBreezeSpecDeviceMTUBridging {
|
|
|
324
313
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
325
314
|
return bridging::toJs(rt, value);
|
|
326
315
|
}
|
|
327
|
-
|
|
328
316
|
static double valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
329
317
|
return bridging::toJs(rt, value);
|
|
330
318
|
}
|
|
@@ -347,8 +335,8 @@ struct NativeBlueBreezeSpecDeviceMTUBridging {
|
|
|
347
335
|
|
|
348
336
|
template <typename P0, typename P1, typename P2>
|
|
349
337
|
struct NativeBlueBreezeSpecDeviceService {
|
|
350
|
-
P0 id;
|
|
351
|
-
P1 name;
|
|
338
|
+
P0 id{};
|
|
339
|
+
P1 name{};
|
|
352
340
|
P2 characteristics;
|
|
353
341
|
bool operator==(const NativeBlueBreezeSpecDeviceService &other) const {
|
|
354
342
|
return id == other.id && name == other.name && characteristics == other.characteristics;
|
|
@@ -374,11 +362,9 @@ struct NativeBlueBreezeSpecDeviceServiceBridging {
|
|
|
374
362
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
375
363
|
return bridging::toJs(rt, value);
|
|
376
364
|
}
|
|
377
|
-
|
|
378
365
|
static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) {
|
|
379
366
|
return bridging::toJs(rt, value);
|
|
380
367
|
}
|
|
381
|
-
|
|
382
368
|
static jsi::Array characteristicsToJs(jsi::Runtime &rt, decltype(types.characteristics) value) {
|
|
383
369
|
return bridging::toJs(rt, value);
|
|
384
370
|
}
|
|
@@ -404,7 +390,7 @@ struct NativeBlueBreezeSpecDeviceServiceBridging {
|
|
|
404
390
|
|
|
405
391
|
template <typename P0, typename P1>
|
|
406
392
|
struct NativeBlueBreezeSpecDeviceServices {
|
|
407
|
-
P0 id;
|
|
393
|
+
P0 id{};
|
|
408
394
|
P1 value;
|
|
409
395
|
bool operator==(const NativeBlueBreezeSpecDeviceServices &other) const {
|
|
410
396
|
return id == other.id && value == other.value;
|
|
@@ -429,7 +415,6 @@ struct NativeBlueBreezeSpecDeviceServicesBridging {
|
|
|
429
415
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
430
416
|
return bridging::toJs(rt, value);
|
|
431
417
|
}
|
|
432
|
-
|
|
433
418
|
static jsi::Array valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
434
419
|
return bridging::toJs(rt, value);
|
|
435
420
|
}
|
|
@@ -452,13 +437,13 @@ struct NativeBlueBreezeSpecDeviceServicesBridging {
|
|
|
452
437
|
|
|
453
438
|
template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
|
|
454
439
|
struct NativeBlueBreezeSpecScanResult {
|
|
455
|
-
P0 id;
|
|
456
|
-
P1 name;
|
|
457
|
-
P2 rssi;
|
|
458
|
-
P3 connectable;
|
|
459
|
-
P4 advertisedServices;
|
|
460
|
-
P5 manufacturerId;
|
|
461
|
-
P6 manufacturerName;
|
|
440
|
+
P0 id{};
|
|
441
|
+
P1 name{};
|
|
442
|
+
P2 rssi{};
|
|
443
|
+
P3 connectable{};
|
|
444
|
+
P4 advertisedServices{};
|
|
445
|
+
P5 manufacturerId{};
|
|
446
|
+
P6 manufacturerName{};
|
|
462
447
|
P7 manufacturerData;
|
|
463
448
|
bool operator==(const NativeBlueBreezeSpecScanResult &other) const {
|
|
464
449
|
return id == other.id && name == other.name && rssi == other.rssi && connectable == other.connectable && advertisedServices == other.advertisedServices && manufacturerId == other.manufacturerId && manufacturerName == other.manufacturerName && manufacturerData == other.manufacturerData;
|
|
@@ -489,31 +474,24 @@ struct NativeBlueBreezeSpecScanResultBridging {
|
|
|
489
474
|
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
490
475
|
return bridging::toJs(rt, value);
|
|
491
476
|
}
|
|
492
|
-
|
|
493
477
|
static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) {
|
|
494
478
|
return bridging::toJs(rt, value);
|
|
495
479
|
}
|
|
496
|
-
|
|
497
480
|
static double rssiToJs(jsi::Runtime &rt, decltype(types.rssi) value) {
|
|
498
481
|
return bridging::toJs(rt, value);
|
|
499
482
|
}
|
|
500
|
-
|
|
501
483
|
static bool connectableToJs(jsi::Runtime &rt, decltype(types.connectable) value) {
|
|
502
484
|
return bridging::toJs(rt, value);
|
|
503
485
|
}
|
|
504
|
-
|
|
505
486
|
static jsi::Array advertisedServicesToJs(jsi::Runtime &rt, decltype(types.advertisedServices) value) {
|
|
506
487
|
return bridging::toJs(rt, value);
|
|
507
488
|
}
|
|
508
|
-
|
|
509
489
|
static double manufacturerIdToJs(jsi::Runtime &rt, decltype(types.manufacturerId) value) {
|
|
510
490
|
return bridging::toJs(rt, value);
|
|
511
491
|
}
|
|
512
|
-
|
|
513
492
|
static jsi::String manufacturerNameToJs(jsi::Runtime &rt, decltype(types.manufacturerName) value) {
|
|
514
493
|
return bridging::toJs(rt, value);
|
|
515
494
|
}
|
|
516
|
-
|
|
517
495
|
static jsi::Array manufacturerDataToJs(jsi::Runtime &rt, decltype(types.manufacturerData) value) {
|
|
518
496
|
return bridging::toJs(rt, value);
|
|
519
497
|
}
|
|
@@ -544,315 +522,292 @@ struct NativeBlueBreezeSpecScanResultBridging {
|
|
|
544
522
|
}
|
|
545
523
|
};
|
|
546
524
|
|
|
547
|
-
class JSI_EXPORT NativeBlueBreezeCxxSpecJSI : public TurboModule {
|
|
548
|
-
protected:
|
|
549
|
-
NativeBlueBreezeCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
550
|
-
|
|
551
|
-
public:
|
|
552
|
-
virtual jsi::String state(jsi::Runtime &rt) = 0;
|
|
553
|
-
virtual jsi::String authorizationStatus(jsi::Runtime &rt) = 0;
|
|
554
|
-
virtual void authorizationRequest(jsi::Runtime &rt) = 0;
|
|
555
|
-
virtual void authorizationOpenSettings(jsi::Runtime &rt) = 0;
|
|
556
|
-
virtual bool scanEnabled(jsi::Runtime &rt) = 0;
|
|
557
|
-
virtual void scanStart(jsi::Runtime &rt, std::optional<jsi::Array> ids) = 0;
|
|
558
|
-
virtual void scanStop(jsi::Runtime &rt) = 0;
|
|
559
|
-
virtual jsi::Array devices(jsi::Runtime &rt) = 0;
|
|
560
|
-
virtual jsi::Array deviceServices(jsi::Runtime &rt, jsi::String id) = 0;
|
|
561
|
-
virtual jsi::String deviceConnectionStatus(jsi::Runtime &rt, jsi::String id) = 0;
|
|
562
|
-
virtual double deviceMTU(jsi::Runtime &rt, jsi::String id) = 0;
|
|
563
|
-
virtual jsi::Value deviceConnect(jsi::Runtime &rt, jsi::String id) = 0;
|
|
564
|
-
virtual jsi::Value deviceDisconnect(jsi::Runtime &rt, jsi::String id) = 0;
|
|
565
|
-
virtual jsi::Value deviceDiscoverServices(jsi::Runtime &rt, jsi::String id) = 0;
|
|
566
|
-
virtual jsi::Value deviceRequestMTU(jsi::Runtime &rt, jsi::String id, double mtu) = 0;
|
|
567
|
-
virtual jsi::Array deviceCharacteristicData(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) = 0;
|
|
568
|
-
virtual bool deviceCharacteristicNotifyEnabled(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) = 0;
|
|
569
|
-
virtual jsi::Value deviceCharacteristicRead(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) = 0;
|
|
570
|
-
virtual jsi::Value deviceCharacteristicWrite(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId, jsi::Array data, bool withResponse) = 0;
|
|
571
|
-
virtual jsi::Value deviceCharacteristicSubscribe(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) = 0;
|
|
572
|
-
virtual jsi::Value deviceCharacteristicUnsubscribe(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) = 0;
|
|
573
|
-
|
|
574
|
-
};
|
|
575
525
|
|
|
576
526
|
template <typename T>
|
|
577
527
|
class JSI_EXPORT NativeBlueBreezeCxxSpec : public TurboModule {
|
|
578
528
|
public:
|
|
579
|
-
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
580
|
-
return delegate_.create(rt, propName);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
584
|
-
return delegate_.getPropertyNames(runtime);
|
|
585
|
-
}
|
|
586
|
-
|
|
587
529
|
static constexpr std::string_view kModuleName = "BlueBreeze";
|
|
588
530
|
|
|
589
531
|
protected:
|
|
590
|
-
NativeBlueBreezeCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
532
|
+
NativeBlueBreezeCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeBlueBreezeCxxSpec::kModuleName}, jsInvoker) {
|
|
533
|
+
methodMap_["state"] = MethodMetadata {.argCount = 0, .invoker = __state};
|
|
534
|
+
methodMap_["authorizationStatus"] = MethodMetadata {.argCount = 0, .invoker = __authorizationStatus};
|
|
535
|
+
methodMap_["authorizationRequest"] = MethodMetadata {.argCount = 0, .invoker = __authorizationRequest};
|
|
536
|
+
methodMap_["authorizationOpenSettings"] = MethodMetadata {.argCount = 0, .invoker = __authorizationOpenSettings};
|
|
537
|
+
methodMap_["scanEnabled"] = MethodMetadata {.argCount = 0, .invoker = __scanEnabled};
|
|
538
|
+
methodMap_["scanStart"] = MethodMetadata {.argCount = 1, .invoker = __scanStart};
|
|
539
|
+
methodMap_["scanStop"] = MethodMetadata {.argCount = 0, .invoker = __scanStop};
|
|
540
|
+
methodMap_["devices"] = MethodMetadata {.argCount = 0, .invoker = __devices};
|
|
541
|
+
methodMap_["deviceServices"] = MethodMetadata {.argCount = 1, .invoker = __deviceServices};
|
|
542
|
+
methodMap_["deviceConnectionStatus"] = MethodMetadata {.argCount = 1, .invoker = __deviceConnectionStatus};
|
|
543
|
+
methodMap_["deviceMTU"] = MethodMetadata {.argCount = 1, .invoker = __deviceMTU};
|
|
544
|
+
methodMap_["deviceConnect"] = MethodMetadata {.argCount = 1, .invoker = __deviceConnect};
|
|
545
|
+
methodMap_["deviceDisconnect"] = MethodMetadata {.argCount = 1, .invoker = __deviceDisconnect};
|
|
546
|
+
methodMap_["deviceDiscoverServices"] = MethodMetadata {.argCount = 1, .invoker = __deviceDiscoverServices};
|
|
547
|
+
methodMap_["deviceRequestMTU"] = MethodMetadata {.argCount = 2, .invoker = __deviceRequestMTU};
|
|
548
|
+
methodMap_["deviceCharacteristicData"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicData};
|
|
549
|
+
methodMap_["deviceCharacteristicNotifyEnabled"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicNotifyEnabled};
|
|
550
|
+
methodMap_["deviceCharacteristicRead"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicRead};
|
|
551
|
+
methodMap_["deviceCharacteristicWrite"] = MethodMetadata {.argCount = 5, .invoker = __deviceCharacteristicWrite};
|
|
552
|
+
methodMap_["deviceCharacteristicSubscribe"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicSubscribe};
|
|
553
|
+
methodMap_["deviceCharacteristicUnsubscribe"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicUnsubscribe};
|
|
554
|
+
eventEmitterMap_["stateEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
555
|
+
eventEmitterMap_["authorizationStatusEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
556
|
+
eventEmitterMap_["scanEnabledEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
557
|
+
eventEmitterMap_["scanResultEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
558
|
+
eventEmitterMap_["devicesEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
559
|
+
eventEmitterMap_["deviceServicesEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
560
|
+
eventEmitterMap_["deviceConnectionStatusEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
561
|
+
eventEmitterMap_["deviceMTUEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
562
|
+
eventEmitterMap_["deviceCharacteristicDataEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
563
|
+
eventEmitterMap_["deviceCharacteristicNotifyEnabledEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
564
|
+
}
|
|
565
|
+
|
|
594
566
|
template <typename StateEmitterType> void emitStateEmitter(StateEmitterType value) {
|
|
595
567
|
static_assert(bridging::supportsFromJs<StateEmitterType, jsi::String>, "value cannnot be converted to jsi::String");
|
|
596
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
568
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["stateEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
597
569
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
598
570
|
});
|
|
599
571
|
}
|
|
600
572
|
|
|
601
573
|
template <typename AuthorizationStatusEmitterType> void emitAuthorizationStatusEmitter(AuthorizationStatusEmitterType value) {
|
|
602
574
|
static_assert(bridging::supportsFromJs<AuthorizationStatusEmitterType, jsi::String>, "value cannnot be converted to jsi::String");
|
|
603
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
575
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["authorizationStatusEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
604
576
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
605
577
|
});
|
|
606
578
|
}
|
|
607
579
|
|
|
608
580
|
template <typename ScanEnabledEmitterType> void emitScanEnabledEmitter(ScanEnabledEmitterType value) {
|
|
609
581
|
static_assert(bridging::supportsFromJs<ScanEnabledEmitterType, bool>, "value cannnot be converted to bool");
|
|
610
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
582
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["scanEnabledEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
611
583
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
612
584
|
});
|
|
613
585
|
}
|
|
614
586
|
|
|
615
587
|
template <typename ScanResultEmitterType> void emitScanResultEmitter(ScanResultEmitterType value) {
|
|
616
588
|
static_assert(bridging::supportsFromJs<ScanResultEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
617
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
589
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["scanResultEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
618
590
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
619
591
|
});
|
|
620
592
|
}
|
|
621
593
|
|
|
622
594
|
template <typename DevicesEmitterType> void emitDevicesEmitter(std::vector<DevicesEmitterType> value) {
|
|
623
595
|
static_assert(bridging::supportsFromJs<std::vector<DevicesEmitterType>, jsi::Array>, "value cannnot be converted to jsi::Array");
|
|
624
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
596
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["devicesEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
625
597
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
626
598
|
});
|
|
627
599
|
}
|
|
628
600
|
|
|
629
601
|
template <typename DeviceServicesEmitterType> void emitDeviceServicesEmitter(DeviceServicesEmitterType value) {
|
|
630
602
|
static_assert(bridging::supportsFromJs<DeviceServicesEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
631
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
603
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["deviceServicesEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
632
604
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
633
605
|
});
|
|
634
606
|
}
|
|
635
607
|
|
|
636
608
|
template <typename DeviceConnectionStatusEmitterType> void emitDeviceConnectionStatusEmitter(DeviceConnectionStatusEmitterType value) {
|
|
637
609
|
static_assert(bridging::supportsFromJs<DeviceConnectionStatusEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
638
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
610
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["deviceConnectionStatusEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
639
611
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
640
612
|
});
|
|
641
613
|
}
|
|
642
614
|
|
|
643
615
|
template <typename DeviceMTUEmitterType> void emitDeviceMTUEmitter(DeviceMTUEmitterType value) {
|
|
644
616
|
static_assert(bridging::supportsFromJs<DeviceMTUEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
645
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
617
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["deviceMTUEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
646
618
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
647
619
|
});
|
|
648
620
|
}
|
|
649
621
|
|
|
650
622
|
template <typename DeviceCharacteristicDataEmitterType> void emitDeviceCharacteristicDataEmitter(DeviceCharacteristicDataEmitterType value) {
|
|
651
623
|
static_assert(bridging::supportsFromJs<DeviceCharacteristicDataEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
652
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
624
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["deviceCharacteristicDataEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
653
625
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
654
626
|
});
|
|
655
627
|
}
|
|
656
628
|
|
|
657
629
|
template <typename DeviceCharacteristicNotifyEnabledEmitterType> void emitDeviceCharacteristicNotifyEnabledEmitter(DeviceCharacteristicNotifyEnabledEmitterType value) {
|
|
658
630
|
static_assert(bridging::supportsFromJs<DeviceCharacteristicNotifyEnabledEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
659
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*
|
|
631
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["deviceCharacteristicNotifyEnabledEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
660
632
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
661
633
|
});
|
|
662
634
|
}
|
|
663
|
-
|
|
664
635
|
private:
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
eventEmitterMap_["scanEnabledEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
672
|
-
eventEmitterMap_["scanResultEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
673
|
-
eventEmitterMap_["devicesEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
674
|
-
eventEmitterMap_["deviceServicesEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
675
|
-
eventEmitterMap_["deviceConnectionStatusEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
676
|
-
eventEmitterMap_["deviceMTUEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
677
|
-
eventEmitterMap_["deviceCharacteristicDataEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
678
|
-
eventEmitterMap_["deviceCharacteristicNotifyEnabledEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
jsi::String state(jsi::Runtime &rt) override {
|
|
682
|
-
static_assert(
|
|
683
|
-
bridging::getParameterCount(&T::state) == 1,
|
|
684
|
-
"Expected state(...) to have 1 parameters");
|
|
685
|
-
|
|
686
|
-
return bridging::callFromJs<jsi::String>(
|
|
687
|
-
rt, &T::state, jsInvoker_, instance_);
|
|
688
|
-
}
|
|
689
|
-
jsi::String authorizationStatus(jsi::Runtime &rt) override {
|
|
690
|
-
static_assert(
|
|
691
|
-
bridging::getParameterCount(&T::authorizationStatus) == 1,
|
|
692
|
-
"Expected authorizationStatus(...) to have 1 parameters");
|
|
693
|
-
|
|
694
|
-
return bridging::callFromJs<jsi::String>(
|
|
695
|
-
rt, &T::authorizationStatus, jsInvoker_, instance_);
|
|
696
|
-
}
|
|
697
|
-
void authorizationRequest(jsi::Runtime &rt) override {
|
|
698
|
-
static_assert(
|
|
699
|
-
bridging::getParameterCount(&T::authorizationRequest) == 1,
|
|
700
|
-
"Expected authorizationRequest(...) to have 1 parameters");
|
|
701
|
-
|
|
702
|
-
return bridging::callFromJs<void>(
|
|
703
|
-
rt, &T::authorizationRequest, jsInvoker_, instance_);
|
|
704
|
-
}
|
|
705
|
-
void authorizationOpenSettings(jsi::Runtime &rt) override {
|
|
706
|
-
static_assert(
|
|
707
|
-
bridging::getParameterCount(&T::authorizationOpenSettings) == 1,
|
|
708
|
-
"Expected authorizationOpenSettings(...) to have 1 parameters");
|
|
709
|
-
|
|
710
|
-
return bridging::callFromJs<void>(
|
|
711
|
-
rt, &T::authorizationOpenSettings, jsInvoker_, instance_);
|
|
712
|
-
}
|
|
713
|
-
bool scanEnabled(jsi::Runtime &rt) override {
|
|
714
|
-
static_assert(
|
|
715
|
-
bridging::getParameterCount(&T::scanEnabled) == 1,
|
|
716
|
-
"Expected scanEnabled(...) to have 1 parameters");
|
|
717
|
-
|
|
718
|
-
return bridging::callFromJs<bool>(
|
|
719
|
-
rt, &T::scanEnabled, jsInvoker_, instance_);
|
|
720
|
-
}
|
|
721
|
-
void scanStart(jsi::Runtime &rt, std::optional<jsi::Array> ids) override {
|
|
722
|
-
static_assert(
|
|
723
|
-
bridging::getParameterCount(&T::scanStart) == 2,
|
|
724
|
-
"Expected scanStart(...) to have 2 parameters");
|
|
725
|
-
|
|
726
|
-
return bridging::callFromJs<void>(
|
|
727
|
-
rt, &T::scanStart, jsInvoker_, instance_, std::move(ids));
|
|
728
|
-
}
|
|
729
|
-
void scanStop(jsi::Runtime &rt) override {
|
|
730
|
-
static_assert(
|
|
731
|
-
bridging::getParameterCount(&T::scanStop) == 1,
|
|
732
|
-
"Expected scanStop(...) to have 1 parameters");
|
|
733
|
-
|
|
734
|
-
return bridging::callFromJs<void>(
|
|
735
|
-
rt, &T::scanStop, jsInvoker_, instance_);
|
|
736
|
-
}
|
|
737
|
-
jsi::Array devices(jsi::Runtime &rt) override {
|
|
738
|
-
static_assert(
|
|
739
|
-
bridging::getParameterCount(&T::devices) == 1,
|
|
740
|
-
"Expected devices(...) to have 1 parameters");
|
|
741
|
-
|
|
742
|
-
return bridging::callFromJs<jsi::Array>(
|
|
743
|
-
rt, &T::devices, jsInvoker_, instance_);
|
|
744
|
-
}
|
|
745
|
-
jsi::Array deviceServices(jsi::Runtime &rt, jsi::String id) override {
|
|
746
|
-
static_assert(
|
|
747
|
-
bridging::getParameterCount(&T::deviceServices) == 2,
|
|
748
|
-
"Expected deviceServices(...) to have 2 parameters");
|
|
749
|
-
|
|
750
|
-
return bridging::callFromJs<jsi::Array>(
|
|
751
|
-
rt, &T::deviceServices, jsInvoker_, instance_, std::move(id));
|
|
752
|
-
}
|
|
753
|
-
jsi::String deviceConnectionStatus(jsi::Runtime &rt, jsi::String id) override {
|
|
754
|
-
static_assert(
|
|
755
|
-
bridging::getParameterCount(&T::deviceConnectionStatus) == 2,
|
|
756
|
-
"Expected deviceConnectionStatus(...) to have 2 parameters");
|
|
757
|
-
|
|
758
|
-
return bridging::callFromJs<jsi::String>(
|
|
759
|
-
rt, &T::deviceConnectionStatus, jsInvoker_, instance_, std::move(id));
|
|
760
|
-
}
|
|
761
|
-
double deviceMTU(jsi::Runtime &rt, jsi::String id) override {
|
|
762
|
-
static_assert(
|
|
763
|
-
bridging::getParameterCount(&T::deviceMTU) == 2,
|
|
764
|
-
"Expected deviceMTU(...) to have 2 parameters");
|
|
765
|
-
|
|
766
|
-
return bridging::callFromJs<double>(
|
|
767
|
-
rt, &T::deviceMTU, jsInvoker_, instance_, std::move(id));
|
|
768
|
-
}
|
|
769
|
-
jsi::Value deviceConnect(jsi::Runtime &rt, jsi::String id) override {
|
|
770
|
-
static_assert(
|
|
771
|
-
bridging::getParameterCount(&T::deviceConnect) == 2,
|
|
772
|
-
"Expected deviceConnect(...) to have 2 parameters");
|
|
773
|
-
|
|
774
|
-
return bridging::callFromJs<jsi::Value>(
|
|
775
|
-
rt, &T::deviceConnect, jsInvoker_, instance_, std::move(id));
|
|
776
|
-
}
|
|
777
|
-
jsi::Value deviceDisconnect(jsi::Runtime &rt, jsi::String id) override {
|
|
778
|
-
static_assert(
|
|
779
|
-
bridging::getParameterCount(&T::deviceDisconnect) == 2,
|
|
780
|
-
"Expected deviceDisconnect(...) to have 2 parameters");
|
|
781
|
-
|
|
782
|
-
return bridging::callFromJs<jsi::Value>(
|
|
783
|
-
rt, &T::deviceDisconnect, jsInvoker_, instance_, std::move(id));
|
|
784
|
-
}
|
|
785
|
-
jsi::Value deviceDiscoverServices(jsi::Runtime &rt, jsi::String id) override {
|
|
786
|
-
static_assert(
|
|
787
|
-
bridging::getParameterCount(&T::deviceDiscoverServices) == 2,
|
|
788
|
-
"Expected deviceDiscoverServices(...) to have 2 parameters");
|
|
789
|
-
|
|
790
|
-
return bridging::callFromJs<jsi::Value>(
|
|
791
|
-
rt, &T::deviceDiscoverServices, jsInvoker_, instance_, std::move(id));
|
|
792
|
-
}
|
|
793
|
-
jsi::Value deviceRequestMTU(jsi::Runtime &rt, jsi::String id, double mtu) override {
|
|
794
|
-
static_assert(
|
|
795
|
-
bridging::getParameterCount(&T::deviceRequestMTU) == 3,
|
|
796
|
-
"Expected deviceRequestMTU(...) to have 3 parameters");
|
|
797
|
-
|
|
798
|
-
return bridging::callFromJs<jsi::Value>(
|
|
799
|
-
rt, &T::deviceRequestMTU, jsInvoker_, instance_, std::move(id), std::move(mtu));
|
|
800
|
-
}
|
|
801
|
-
jsi::Array deviceCharacteristicData(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) override {
|
|
802
|
-
static_assert(
|
|
803
|
-
bridging::getParameterCount(&T::deviceCharacteristicData) == 4,
|
|
804
|
-
"Expected deviceCharacteristicData(...) to have 4 parameters");
|
|
805
|
-
|
|
806
|
-
return bridging::callFromJs<jsi::Array>(
|
|
807
|
-
rt, &T::deviceCharacteristicData, jsInvoker_, instance_, std::move(id), std::move(serviceId), std::move(characteristicId));
|
|
808
|
-
}
|
|
809
|
-
bool deviceCharacteristicNotifyEnabled(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) override {
|
|
810
|
-
static_assert(
|
|
811
|
-
bridging::getParameterCount(&T::deviceCharacteristicNotifyEnabled) == 4,
|
|
812
|
-
"Expected deviceCharacteristicNotifyEnabled(...) to have 4 parameters");
|
|
813
|
-
|
|
814
|
-
return bridging::callFromJs<bool>(
|
|
815
|
-
rt, &T::deviceCharacteristicNotifyEnabled, jsInvoker_, instance_, std::move(id), std::move(serviceId), std::move(characteristicId));
|
|
816
|
-
}
|
|
817
|
-
jsi::Value deviceCharacteristicRead(jsi::Runtime &rt, jsi::String id, jsi::String serviceId, jsi::String characteristicId) override {
|
|
818
|
-
static_assert(
|
|
819
|
-
bridging::getParameterCount(&T::deviceCharacteristicRead) == 4,
|
|
820
|
-
"Expected deviceCharacteristicRead(...) to have 4 parameters");
|
|
636
|
+
static jsi::Value __state(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
637
|
+
static_assert(
|
|
638
|
+
bridging::getParameterCount(&T::state) == 1,
|
|
639
|
+
"Expected state(...) to have 1 parameters");
|
|
640
|
+
return bridging::callFromJs<jsi::String>(rt, &T::state, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
641
|
+
}
|
|
821
642
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
"Expected deviceCharacteristicWrite(...) to have 6 parameters");
|
|
643
|
+
static jsi::Value __authorizationStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
644
|
+
static_assert(
|
|
645
|
+
bridging::getParameterCount(&T::authorizationStatus) == 1,
|
|
646
|
+
"Expected authorizationStatus(...) to have 1 parameters");
|
|
647
|
+
return bridging::callFromJs<jsi::String>(rt, &T::authorizationStatus, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
648
|
+
}
|
|
829
649
|
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
"Expected deviceCharacteristicSubscribe(...) to have 4 parameters");
|
|
650
|
+
static jsi::Value __authorizationRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
651
|
+
static_assert(
|
|
652
|
+
bridging::getParameterCount(&T::authorizationRequest) == 1,
|
|
653
|
+
"Expected authorizationRequest(...) to have 1 parameters");
|
|
654
|
+
bridging::callFromJs<void>(rt, &T::authorizationRequest, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
|
|
655
|
+
}
|
|
837
656
|
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
"Expected deviceCharacteristicUnsubscribe(...) to have 4 parameters");
|
|
657
|
+
static jsi::Value __authorizationOpenSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
658
|
+
static_assert(
|
|
659
|
+
bridging::getParameterCount(&T::authorizationOpenSettings) == 1,
|
|
660
|
+
"Expected authorizationOpenSettings(...) to have 1 parameters");
|
|
661
|
+
bridging::callFromJs<void>(rt, &T::authorizationOpenSettings, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
|
|
662
|
+
}
|
|
845
663
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
664
|
+
static jsi::Value __scanEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
665
|
+
static_assert(
|
|
666
|
+
bridging::getParameterCount(&T::scanEnabled) == 1,
|
|
667
|
+
"Expected scanEnabled(...) to have 1 parameters");
|
|
668
|
+
return bridging::callFromJs<bool>(rt, &T::scanEnabled, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
669
|
+
}
|
|
849
670
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
671
|
+
static jsi::Value __scanStart(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
672
|
+
static_assert(
|
|
673
|
+
bridging::getParameterCount(&T::scanStart) == 2,
|
|
674
|
+
"Expected scanStart(...) to have 2 parameters");
|
|
675
|
+
bridging::callFromJs<void>(rt, &T::scanStart, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
676
|
+
count <= 0 || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)));return jsi::Value::undefined();
|
|
677
|
+
}
|
|
854
678
|
|
|
855
|
-
|
|
679
|
+
static jsi::Value __scanStop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
680
|
+
static_assert(
|
|
681
|
+
bridging::getParameterCount(&T::scanStop) == 1,
|
|
682
|
+
"Expected scanStop(...) to have 1 parameters");
|
|
683
|
+
bridging::callFromJs<void>(rt, &T::scanStop, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
static jsi::Value __devices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
687
|
+
static_assert(
|
|
688
|
+
bridging::getParameterCount(&T::devices) == 1,
|
|
689
|
+
"Expected devices(...) to have 1 parameters");
|
|
690
|
+
return bridging::callFromJs<jsi::Array>(rt, &T::devices, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
static jsi::Value __deviceServices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
694
|
+
static_assert(
|
|
695
|
+
bridging::getParameterCount(&T::deviceServices) == 2,
|
|
696
|
+
"Expected deviceServices(...) to have 2 parameters");
|
|
697
|
+
return bridging::callFromJs<jsi::Array>(rt, &T::deviceServices, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
698
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
static jsi::Value __deviceConnectionStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
702
|
+
static_assert(
|
|
703
|
+
bridging::getParameterCount(&T::deviceConnectionStatus) == 2,
|
|
704
|
+
"Expected deviceConnectionStatus(...) to have 2 parameters");
|
|
705
|
+
return bridging::callFromJs<jsi::String>(rt, &T::deviceConnectionStatus, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
706
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
static jsi::Value __deviceMTU(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
710
|
+
static_assert(
|
|
711
|
+
bridging::getParameterCount(&T::deviceMTU) == 2,
|
|
712
|
+
"Expected deviceMTU(...) to have 2 parameters");
|
|
713
|
+
return bridging::callFromJs<double>(rt, &T::deviceMTU, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
714
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
static jsi::Value __deviceConnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
718
|
+
static_assert(
|
|
719
|
+
bridging::getParameterCount(&T::deviceConnect) == 2,
|
|
720
|
+
"Expected deviceConnect(...) to have 2 parameters");
|
|
721
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceConnect, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
722
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
static jsi::Value __deviceDisconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
726
|
+
static_assert(
|
|
727
|
+
bridging::getParameterCount(&T::deviceDisconnect) == 2,
|
|
728
|
+
"Expected deviceDisconnect(...) to have 2 parameters");
|
|
729
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceDisconnect, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
730
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
static jsi::Value __deviceDiscoverServices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
734
|
+
static_assert(
|
|
735
|
+
bridging::getParameterCount(&T::deviceDiscoverServices) == 2,
|
|
736
|
+
"Expected deviceDiscoverServices(...) to have 2 parameters");
|
|
737
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceDiscoverServices, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
738
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
static jsi::Value __deviceRequestMTU(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
742
|
+
static_assert(
|
|
743
|
+
bridging::getParameterCount(&T::deviceRequestMTU) == 3,
|
|
744
|
+
"Expected deviceRequestMTU(...) to have 3 parameters");
|
|
745
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceRequestMTU, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
746
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
747
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber());
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
static jsi::Value __deviceCharacteristicData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
751
|
+
static_assert(
|
|
752
|
+
bridging::getParameterCount(&T::deviceCharacteristicData) == 4,
|
|
753
|
+
"Expected deviceCharacteristicData(...) to have 4 parameters");
|
|
754
|
+
return bridging::callFromJs<jsi::Array>(rt, &T::deviceCharacteristicData, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
755
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
756
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
757
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
static jsi::Value __deviceCharacteristicNotifyEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
761
|
+
static_assert(
|
|
762
|
+
bridging::getParameterCount(&T::deviceCharacteristicNotifyEnabled) == 4,
|
|
763
|
+
"Expected deviceCharacteristicNotifyEnabled(...) to have 4 parameters");
|
|
764
|
+
return bridging::callFromJs<bool>(rt, &T::deviceCharacteristicNotifyEnabled, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
765
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
766
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
767
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
static jsi::Value __deviceCharacteristicRead(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
771
|
+
static_assert(
|
|
772
|
+
bridging::getParameterCount(&T::deviceCharacteristicRead) == 4,
|
|
773
|
+
"Expected deviceCharacteristicRead(...) to have 4 parameters");
|
|
774
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceCharacteristicRead, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
775
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
776
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
777
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
static jsi::Value __deviceCharacteristicWrite(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
781
|
+
static_assert(
|
|
782
|
+
bridging::getParameterCount(&T::deviceCharacteristicWrite) == 6,
|
|
783
|
+
"Expected deviceCharacteristicWrite(...) to have 6 parameters");
|
|
784
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceCharacteristicWrite, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
785
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
786
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
787
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
788
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt),
|
|
789
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asBool());
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
static jsi::Value __deviceCharacteristicSubscribe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
793
|
+
static_assert(
|
|
794
|
+
bridging::getParameterCount(&T::deviceCharacteristicSubscribe) == 4,
|
|
795
|
+
"Expected deviceCharacteristicSubscribe(...) to have 4 parameters");
|
|
796
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceCharacteristicSubscribe, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
797
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
798
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
799
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
static jsi::Value __deviceCharacteristicUnsubscribe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
803
|
+
static_assert(
|
|
804
|
+
bridging::getParameterCount(&T::deviceCharacteristicUnsubscribe) == 4,
|
|
805
|
+
"Expected deviceCharacteristicUnsubscribe(...) to have 4 parameters");
|
|
806
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::deviceCharacteristicUnsubscribe, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
807
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
808
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
809
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
810
|
+
}
|
|
856
811
|
};
|
|
857
812
|
|
|
858
813
|
} // namespace facebook::react
|