react-native-bluebreeze 1.0.2 → 1.1.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 +31 -4
- package/android/build.gradle +1 -1
- package/android/generated/java/com/bluebreeze/NativeBlueBreezeSpec.java +0 -8
- package/android/generated/jni/RNBlueBreezeSpec-generated.cpp +0 -7
- package/android/generated/jni/react/renderer/components/RNBlueBreezeSpec/RNBlueBreezeSpecJSI.h +0 -78
- package/android/src/main/java/com/bluebreeze/BlueBreezeModule.kt +9 -41
- package/ios/BlueBreezeImpl.swift +10 -25
- package/ios/Bluebreeze.mm +0 -9
- package/ios/generated/ReactCodegen/RNBlueBreezeSpec/RNBlueBreezeSpec-generated.mm +0 -12
- package/ios/generated/ReactCodegen/RNBlueBreezeSpec/RNBlueBreezeSpec.h +0 -4
- package/ios/generated/ReactCodegen/RNBlueBreezeSpecJSI.h +0 -78
- package/lib/commonjs/NativeBlueBreeze.js.map +1 -1
- package/lib/commonjs/implementation/bluebreeze_characteristic.js +5 -6
- package/lib/commonjs/implementation/bluebreeze_characteristic.js.map +1 -1
- package/lib/commonjs/implementation/bluebreeze_observable.js +53 -0
- package/lib/commonjs/implementation/bluebreeze_observable.js.map +1 -0
- package/lib/commonjs/implementation/native_bridge.js +7 -20
- package/lib/commonjs/implementation/native_bridge.js.map +1 -1
- package/lib/commonjs/index.js +11 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeBlueBreeze.js.map +1 -1
- package/lib/module/implementation/bluebreeze_characteristic.js +6 -7
- package/lib/module/implementation/bluebreeze_characteristic.js.map +1 -1
- package/lib/module/implementation/bluebreeze_observable.js +49 -0
- package/lib/module/implementation/bluebreeze_observable.js.map +1 -0
- package/lib/module/implementation/native_bridge.js +6 -18
- package/lib/module/implementation/native_bridge.js.map +1 -1
- package/lib/module/index.js +7 -6
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeBlueBreeze.d.ts +0 -8
- package/lib/typescript/commonjs/src/NativeBlueBreeze.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_characteristic.d.ts +7 -7
- package/lib/typescript/commonjs/src/implementation/bluebreeze_characteristic.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_device.d.ts +4 -4
- package/lib/typescript/commonjs/src/implementation/bluebreeze_device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/implementation/bluebreeze_observable.d.ts +32 -0
- package/lib/typescript/commonjs/src/implementation/bluebreeze_observable.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/implementation/native_bridge.d.ts +6 -7
- package/lib/typescript/commonjs/src/implementation/native_bridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +7 -6
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeBlueBreeze.d.ts +0 -8
- package/lib/typescript/module/src/NativeBlueBreeze.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_characteristic.d.ts +7 -7
- package/lib/typescript/module/src/implementation/bluebreeze_characteristic.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_device.d.ts +4 -4
- package/lib/typescript/module/src/implementation/bluebreeze_device.d.ts.map +1 -1
- package/lib/typescript/module/src/implementation/bluebreeze_observable.d.ts +32 -0
- package/lib/typescript/module/src/implementation/bluebreeze_observable.d.ts.map +1 -0
- package/lib/typescript/module/src/implementation/native_bridge.d.ts +6 -7
- package/lib/typescript/module/src/implementation/native_bridge.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +7 -6
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-bluebreeze.podspec +1 -1
- package/src/NativeBlueBreeze.ts +0 -11
- package/src/implementation/bluebreeze_characteristic.ts +8 -11
- package/src/implementation/bluebreeze_device.ts +4 -4
- package/src/implementation/bluebreeze_observable.ts +48 -0
- package/src/implementation/native_bridge.ts +20 -52
- package/src/index.tsx +7 -5
|
@@ -74,65 +74,6 @@ struct NativeBlueBreezeBBDeviceCharacteristicDataEventBridging {
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
#pragma mark - NativeBlueBreezeBBDeviceCharacteristicNotificationsEvent
|
|
78
|
-
|
|
79
|
-
template <typename P0, typename P1, typename P2, typename P3>
|
|
80
|
-
struct NativeBlueBreezeBBDeviceCharacteristicNotificationsEvent {
|
|
81
|
-
P0 id{};
|
|
82
|
-
P1 serviceId{};
|
|
83
|
-
P2 characteristicId{};
|
|
84
|
-
P3 value;
|
|
85
|
-
bool operator==(const NativeBlueBreezeBBDeviceCharacteristicNotificationsEvent &other) const {
|
|
86
|
-
return id == other.id && serviceId == other.serviceId && characteristicId == other.characteristicId && value == other.value;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
template <typename T>
|
|
91
|
-
struct NativeBlueBreezeBBDeviceCharacteristicNotificationsEventBridging {
|
|
92
|
-
static T types;
|
|
93
|
-
|
|
94
|
-
static T fromJs(
|
|
95
|
-
jsi::Runtime &rt,
|
|
96
|
-
const jsi::Object &value,
|
|
97
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
98
|
-
T result{
|
|
99
|
-
bridging::fromJs<decltype(types.id)>(rt, value.getProperty(rt, "id"), jsInvoker),
|
|
100
|
-
bridging::fromJs<decltype(types.serviceId)>(rt, value.getProperty(rt, "serviceId"), jsInvoker),
|
|
101
|
-
bridging::fromJs<decltype(types.characteristicId)>(rt, value.getProperty(rt, "characteristicId"), jsInvoker),
|
|
102
|
-
bridging::fromJs<decltype(types.value)>(rt, value.getProperty(rt, "value"), jsInvoker)};
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
#ifdef DEBUG
|
|
107
|
-
static jsi::String idToJs(jsi::Runtime &rt, decltype(types.id) value) {
|
|
108
|
-
return bridging::toJs(rt, value);
|
|
109
|
-
}
|
|
110
|
-
static jsi::String serviceIdToJs(jsi::Runtime &rt, decltype(types.serviceId) value) {
|
|
111
|
-
return bridging::toJs(rt, value);
|
|
112
|
-
}
|
|
113
|
-
static jsi::String characteristicIdToJs(jsi::Runtime &rt, decltype(types.characteristicId) value) {
|
|
114
|
-
return bridging::toJs(rt, value);
|
|
115
|
-
}
|
|
116
|
-
static jsi::Array valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
117
|
-
return bridging::toJs(rt, value);
|
|
118
|
-
}
|
|
119
|
-
#endif
|
|
120
|
-
|
|
121
|
-
static jsi::Object toJs(
|
|
122
|
-
jsi::Runtime &rt,
|
|
123
|
-
const T &value,
|
|
124
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
125
|
-
auto result = facebook::jsi::Object(rt);
|
|
126
|
-
result.setProperty(rt, "id", bridging::toJs(rt, value.id, jsInvoker));
|
|
127
|
-
result.setProperty(rt, "serviceId", bridging::toJs(rt, value.serviceId, jsInvoker));
|
|
128
|
-
result.setProperty(rt, "characteristicId", bridging::toJs(rt, value.characteristicId, jsInvoker));
|
|
129
|
-
result.setProperty(rt, "value", bridging::toJs(rt, value.value, jsInvoker));
|
|
130
|
-
return result;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
77
|
#pragma mark - NativeBlueBreezeBBDeviceCharacteristicNotifyEnabledEvent
|
|
137
78
|
|
|
138
79
|
template <typename P0, typename P1, typename P2, typename P3>
|
|
@@ -606,7 +547,6 @@ protected:
|
|
|
606
547
|
methodMap_["deviceRequestMTU"] = MethodMetadata {.argCount = 2, .invoker = __deviceRequestMTU};
|
|
607
548
|
methodMap_["deviceCharacteristicData"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicData};
|
|
608
549
|
methodMap_["deviceCharacteristicNotifyEnabled"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicNotifyEnabled};
|
|
609
|
-
methodMap_["deviceCharacteristicNotifications"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicNotifications};
|
|
610
550
|
methodMap_["deviceCharacteristicRead"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicRead};
|
|
611
551
|
methodMap_["deviceCharacteristicWrite"] = MethodMetadata {.argCount = 5, .invoker = __deviceCharacteristicWrite};
|
|
612
552
|
methodMap_["deviceCharacteristicSubscribe"] = MethodMetadata {.argCount = 3, .invoker = __deviceCharacteristicSubscribe};
|
|
@@ -621,7 +561,6 @@ protected:
|
|
|
621
561
|
eventEmitterMap_["deviceMTUEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
622
562
|
eventEmitterMap_["deviceCharacteristicDataEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
623
563
|
eventEmitterMap_["deviceCharacteristicNotifyEnabledEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
624
|
-
eventEmitterMap_["deviceCharacteristicNotificationsEmitter"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
625
564
|
}
|
|
626
565
|
|
|
627
566
|
template <typename StateEmitterType> void emitStateEmitter(StateEmitterType value) {
|
|
@@ -693,13 +632,6 @@ protected:
|
|
|
693
632
|
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
694
633
|
});
|
|
695
634
|
}
|
|
696
|
-
|
|
697
|
-
template <typename DeviceCharacteristicNotificationsEmitterType> void emitDeviceCharacteristicNotificationsEmitter(DeviceCharacteristicNotificationsEmitterType value) {
|
|
698
|
-
static_assert(bridging::supportsFromJs<DeviceCharacteristicNotificationsEmitterType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
699
|
-
static_cast<AsyncEventEmitter<jsi::Value>&>(*eventEmitterMap_["deviceCharacteristicNotificationsEmitter"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
700
|
-
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
701
|
-
});
|
|
702
|
-
}
|
|
703
635
|
private:
|
|
704
636
|
static jsi::Value __state(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
705
637
|
static_assert(
|
|
@@ -835,16 +767,6 @@ private:
|
|
|
835
767
|
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
836
768
|
}
|
|
837
769
|
|
|
838
|
-
static jsi::Value __deviceCharacteristicNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
839
|
-
static_assert(
|
|
840
|
-
bridging::getParameterCount(&T::deviceCharacteristicNotifications) == 4,
|
|
841
|
-
"Expected deviceCharacteristicNotifications(...) to have 4 parameters");
|
|
842
|
-
return bridging::callFromJs<jsi::Array>(rt, &T::deviceCharacteristicNotifications, static_cast<NativeBlueBreezeCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
843
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
844
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
845
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt));
|
|
846
|
-
}
|
|
847
|
-
|
|
848
770
|
static jsi::Value __deviceCharacteristicRead(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
849
771
|
static_assert(
|
|
850
772
|
bridging::getParameterCount(&T::deviceCharacteristicRead) == 4,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBlueBreeze.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAGA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBlueBreeze.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AA2DA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAyDeC,gCAAmB,CAACC,YAAY,CAAO,YAAY,CAAC","ignoreList":[]}
|
|
@@ -17,8 +17,7 @@ class BBCharacteristic {
|
|
|
17
17
|
this.name = name;
|
|
18
18
|
this.properties = properties;
|
|
19
19
|
this.data = (0, _native_bridge.deviceCharacteristicData)(deviceId, serviceId, id);
|
|
20
|
-
this.
|
|
21
|
-
this.notifications = (0, _native_bridge.deviceCharacteristicNotifications)(deviceId, serviceId, id);
|
|
20
|
+
this.isNotifying = (0, _native_bridge.deviceCharacteristicNotifyEnabled)(deviceId, serviceId, id);
|
|
22
21
|
this.read = () => (0, _native_bridge.deviceCharacteristicRead)(deviceId, serviceId, id);
|
|
23
22
|
this.write = (data, withResponse) => (0, _native_bridge.deviceCharacteristicWrite)(deviceId, serviceId, id, data, withResponse);
|
|
24
23
|
this.subscribe = () => (0, _native_bridge.deviceCharacteristicSubscribe)(deviceId, serviceId, id);
|
|
@@ -31,13 +30,13 @@ class BBCharacteristic {
|
|
|
31
30
|
|
|
32
31
|
/** The GATT properties this characteristic declares. */
|
|
33
32
|
|
|
34
|
-
/**
|
|
35
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The last value read or notified for this characteristic. Empty until first populated.
|
|
35
|
+
* Use `data.updates` to receive only the values that arrive from now on.
|
|
36
|
+
*/
|
|
36
37
|
|
|
37
38
|
/** Whether this app is currently subscribed to notifications for this characteristic. */
|
|
38
39
|
|
|
39
|
-
/** The notification stream for this characteristic. Does not replay past values. */
|
|
40
|
-
|
|
41
40
|
/**
|
|
42
41
|
* Reads this characteristic's current value, also updating {@link data}.
|
|
43
42
|
* @throws if the read fails or times out.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_native_bridge","require","BBCharacteristic","constructor","deviceId","serviceId","id","name","properties","data","deviceCharacteristicData","
|
|
1
|
+
{"version":3,"names":["_native_bridge","require","BBCharacteristic","constructor","deviceId","serviceId","id","name","properties","data","deviceCharacteristicData","isNotifying","deviceCharacteristicNotifyEnabled","read","deviceCharacteristicRead","write","withResponse","deviceCharacteristicWrite","subscribe","deviceCharacteristicSubscribe","unsubscribe","deviceCharacteristicUnsubscribe","exports"],"sourceRoot":"../../../src","sources":["implementation/bluebreeze_characteristic.ts"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CACPC,QAAgB,EAChBC,SAAiB,EACjBC,EAAU,EACVC,IAAwB,EACxBC,UAAoB,EACtB;IACE,IAAI,CAACF,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAE5B,IAAI,CAACC,IAAI,GAAG,IAAAC,uCAAwB,EAACN,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IAE7D,IAAI,CAACK,WAAW,GAAG,IAAAC,gDAAiC,EAACR,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IAE7E,IAAI,CAACO,IAAI,GAAG,MAAM,IAAAC,uCAAwB,EAACV,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IACnE,IAAI,CAACS,KAAK,GAAG,CAACN,IAAc,EAAEO,YAAqB,KAAK,IAAAC,wCAAyB,EAACb,QAAQ,EAAEC,SAAS,EAAEC,EAAE,EAAEG,IAAI,EAAEO,YAAY,CAAC;IAC9H,IAAI,CAACE,SAAS,GAAG,MAAM,IAAAC,4CAA6B,EAACf,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IAC7E,IAAI,CAACc,WAAW,GAAG,MAAM,IAAAC,8CAA+B,EAACjB,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;EACrF;;EAEA;;EAGA;;EAGA;;EAGA;AACJ;AACA;AACA;;EAGI;;EAGA;AACJ;AACA;AACA;;EAGI;AACJ;AACA;AACA;AACA;AACA;;EAGI;AACJ;AACA;AACA;;EAGI;AACJ;AACA;AACA;AAEA;AAACgB,OAAA,CAAApB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BBObservable = void 0;
|
|
7
|
+
var _reactNativeValueEmitter = require("react-native-value-emitter");
|
|
8
|
+
/**
|
|
9
|
+
* An observable value, used for every piece of state BlueBreeze exposes (`BlueBreeze.state`,
|
|
10
|
+
* {@link BBDevice.connectionStatus}, {@link BBCharacteristic.data}, and so on).
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* characteristic.data.value // the current value
|
|
14
|
+
* characteristic.data.values.onValue((data) => {}) // the current value, then new values
|
|
15
|
+
* characteristic.data.updates.onValue((data) => {}) // only new values
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Streams work with `useValueEmitter` from `react-native-value-emitter`, which unsubscribes
|
|
19
|
+
* automatically when the component unmounts.
|
|
20
|
+
*/
|
|
21
|
+
class BBObservable {
|
|
22
|
+
constructor(initialValue) {
|
|
23
|
+
this._values = new _reactNativeValueEmitter.StateValueEmitter(initialValue);
|
|
24
|
+
}
|
|
25
|
+
_updates = new _reactNativeValueEmitter.ValueEmitter();
|
|
26
|
+
|
|
27
|
+
/** The current value. */
|
|
28
|
+
get value() {
|
|
29
|
+
return this._values.value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A stream that calls each handler with the current {@link value} first, then with every new one. */
|
|
33
|
+
get values() {
|
|
34
|
+
return this._values;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A stream of only the values published from now on, without the current {@link value}. */
|
|
38
|
+
get updates() {
|
|
39
|
+
return this._updates;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Publishes a new value. Internal to BlueBreeze: called when the native module reports an
|
|
44
|
+
* update, not meant to be called by apps.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
add(value) {
|
|
48
|
+
this._values.add(value);
|
|
49
|
+
this._updates.add(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.BBObservable = BBObservable;
|
|
53
|
+
//# sourceMappingURL=bluebreeze_observable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeValueEmitter","require","BBObservable","constructor","initialValue","_values","StateValueEmitter","_updates","ValueEmitter","value","values","updates","add","exports"],"sourceRoot":"../../../src","sources":["implementation/bluebreeze_observable.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,CAAI;EACzBC,WAAWA,CAACC,YAAe,EAAE;IACzB,IAAI,CAACC,OAAO,GAAG,IAAIC,0CAAiB,CAAIF,YAAY,CAAC;EACzD;EAGiBG,QAAQ,GAAG,IAAIC,qCAAY,CAAI,CAAC;;EAEjD;EACA,IAAIC,KAAKA,CAAA,EAAM;IACX,OAAO,IAAI,CAACJ,OAAO,CAACI,KAAK;EAC7B;;EAEA;EACA,IAAIC,MAAMA,CAAA,EAAoB;IAC1B,OAAO,IAAI,CAACL,OAAO;EACvB;;EAEA;EACA,IAAIM,OAAOA,CAAA,EAAoB;IAC3B,OAAO,IAAI,CAACJ,QAAQ;EACxB;;EAEA;AACJ;AACA;AACA;AACA;EACIK,GAAGA,CAACH,KAAQ,EAAE;IACV,IAAI,CAACJ,OAAO,CAACO,GAAG,CAACH,KAAK,CAAC;IACvB,IAAI,CAACF,QAAQ,CAACK,GAAG,CAACH,KAAK,CAAC;EAC5B;AACJ;AAACI,OAAA,CAAAX,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.deviceServices = exports.deviceRequestMTU = exports.deviceMTU = exports.deviceDiscoverServices = exports.deviceDisconnect = exports.deviceConnectionStatus = exports.deviceConnect = exports.deviceCharacteristicWrite = exports.deviceCharacteristicUnsubscribe = exports.deviceCharacteristicSubscribe = exports.deviceCharacteristicRead = exports.deviceCharacteristicNotifyEnabled = exports.
|
|
7
|
-
var _reactNativeValueEmitter = require("react-native-value-emitter");
|
|
6
|
+
exports.deviceServices = exports.deviceRequestMTU = exports.deviceMTU = exports.deviceDiscoverServices = exports.deviceDisconnect = exports.deviceConnectionStatus = exports.deviceConnect = exports.deviceCharacteristicWrite = exports.deviceCharacteristicUnsubscribe = exports.deviceCharacteristicSubscribe = exports.deviceCharacteristicRead = exports.deviceCharacteristicNotifyEnabled = exports.deviceCharacteristicData = void 0;
|
|
8
7
|
var _NativeBlueBreeze = _interopRequireDefault(require("../NativeBlueBreeze.js"));
|
|
9
8
|
var _bluebreeze_characteristic = require("./bluebreeze_characteristic.js");
|
|
9
|
+
var _bluebreeze_observable = require("./bluebreeze_observable.js");
|
|
10
10
|
var _bluebreeze_service = require("./bluebreeze_service.js");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
/**
|
|
@@ -28,7 +28,7 @@ function mapGetOrSet(map, key, defaultValue) {
|
|
|
28
28
|
|
|
29
29
|
const _deviceServices = new Map();
|
|
30
30
|
const deviceServices = id => {
|
|
31
|
-
return mapGetOrSet(_deviceServices, id, () => new
|
|
31
|
+
return mapGetOrSet(_deviceServices, id, () => new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.deviceServices(id).map(s => convertDeviceService(id, s))));
|
|
32
32
|
};
|
|
33
33
|
exports.deviceServices = deviceServices;
|
|
34
34
|
_NativeBlueBreeze.default.deviceServicesEmitter(value => {
|
|
@@ -39,7 +39,7 @@ _NativeBlueBreeze.default.deviceServicesEmitter(value => {
|
|
|
39
39
|
|
|
40
40
|
const _deviceConnectionStatus = new Map();
|
|
41
41
|
const deviceConnectionStatus = id => {
|
|
42
|
-
return mapGetOrSet(_deviceConnectionStatus, id, () => new
|
|
42
|
+
return mapGetOrSet(_deviceConnectionStatus, id, () => new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.deviceConnectionStatus(id)));
|
|
43
43
|
};
|
|
44
44
|
exports.deviceConnectionStatus = deviceConnectionStatus;
|
|
45
45
|
_NativeBlueBreeze.default.deviceConnectionStatusEmitter(value => {
|
|
@@ -50,7 +50,7 @@ _NativeBlueBreeze.default.deviceConnectionStatusEmitter(value => {
|
|
|
50
50
|
|
|
51
51
|
const _deviceMTU = new Map();
|
|
52
52
|
const deviceMTU = id => {
|
|
53
|
-
return mapGetOrSet(_deviceMTU, id, () => new
|
|
53
|
+
return mapGetOrSet(_deviceMTU, id, () => new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.deviceMTU(id)));
|
|
54
54
|
};
|
|
55
55
|
exports.deviceMTU = deviceMTU;
|
|
56
56
|
_NativeBlueBreeze.default.deviceMTUEmitter(value => {
|
|
@@ -70,7 +70,7 @@ const _deviceCharacteristicData = new Map();
|
|
|
70
70
|
const deviceCharacteristicData = (id, serviceId, characteristicId) => {
|
|
71
71
|
const deviceMap = mapGetOrSet(_deviceCharacteristicData, id, () => new Map());
|
|
72
72
|
const serviceMap = mapGetOrSet(deviceMap, serviceId, () => new Map());
|
|
73
|
-
return mapGetOrSet(serviceMap, characteristicId, () => new
|
|
73
|
+
return mapGetOrSet(serviceMap, characteristicId, () => new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.deviceCharacteristicData(id, serviceId, characteristicId)));
|
|
74
74
|
};
|
|
75
75
|
exports.deviceCharacteristicData = deviceCharacteristicData;
|
|
76
76
|
_NativeBlueBreeze.default.deviceCharacteristicDataEmitter(value => {
|
|
@@ -83,26 +83,13 @@ const _deviceCharacteristicNotifyEnabled = new Map();
|
|
|
83
83
|
const deviceCharacteristicNotifyEnabled = (id, serviceId, characteristicId) => {
|
|
84
84
|
const deviceMap = mapGetOrSet(_deviceCharacteristicNotifyEnabled, id, () => new Map());
|
|
85
85
|
const serviceMap = mapGetOrSet(deviceMap, serviceId, () => new Map());
|
|
86
|
-
return mapGetOrSet(serviceMap, characteristicId, () => new
|
|
86
|
+
return mapGetOrSet(serviceMap, characteristicId, () => new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.deviceCharacteristicNotifyEnabled(id, serviceId, characteristicId)));
|
|
87
87
|
};
|
|
88
88
|
exports.deviceCharacteristicNotifyEnabled = deviceCharacteristicNotifyEnabled;
|
|
89
89
|
_NativeBlueBreeze.default.deviceCharacteristicNotifyEnabledEmitter(value => {
|
|
90
90
|
deviceCharacteristicNotifyEnabled(value.id, value.serviceId, value.characteristicId).add(value.value);
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
// Device characteristic notifications
|
|
94
|
-
|
|
95
|
-
const _deviceCharacteristicNotifications = new Map();
|
|
96
|
-
const deviceCharacteristicNotifications = (id, serviceId, characteristicId) => {
|
|
97
|
-
const deviceMap = mapGetOrSet(_deviceCharacteristicNotifications, id, () => new Map());
|
|
98
|
-
const serviceMap = mapGetOrSet(deviceMap, serviceId, () => new Map());
|
|
99
|
-
return mapGetOrSet(serviceMap, characteristicId, () => new _reactNativeValueEmitter.ValueEmitter());
|
|
100
|
-
};
|
|
101
|
-
exports.deviceCharacteristicNotifications = deviceCharacteristicNotifications;
|
|
102
|
-
_NativeBlueBreeze.default.deviceCharacteristicNotificationsEmitter(value => {
|
|
103
|
-
deviceCharacteristicNotifications(value.id, value.serviceId, value.characteristicId).add(value.value);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
93
|
// Device characteristic operations
|
|
107
94
|
|
|
108
95
|
const deviceCharacteristicRead = exports.deviceCharacteristicRead = _NativeBlueBreeze.default.deviceCharacteristicRead;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_NativeBlueBreeze","_interopRequireDefault","require","_bluebreeze_characteristic","_bluebreeze_observable","_bluebreeze_service","e","__esModule","default","mapGetOrSet","map","key","defaultValue","get","undefined","set","_deviceServices","Map","deviceServices","id","BBObservable","NativeBlueBreeze","s","convertDeviceService","exports","deviceServicesEmitter","value","add","_deviceConnectionStatus","deviceConnectionStatus","deviceConnectionStatusEmitter","_deviceMTU","deviceMTU","deviceMTUEmitter","deviceConnect","deviceDisconnect","deviceDiscoverServices","deviceRequestMTU","_deviceCharacteristicData","deviceCharacteristicData","serviceId","characteristicId","deviceMap","serviceMap","deviceCharacteristicDataEmitter","_deviceCharacteristicNotifyEnabled","deviceCharacteristicNotifyEnabled","deviceCharacteristicNotifyEnabledEmitter","deviceCharacteristicRead","deviceCharacteristicWrite","deviceCharacteristicSubscribe","deviceCharacteristicUnsubscribe","deviceId","service","BBService","name","characteristics","c","convertDeviceCharacteristic","characteristic","BBCharacteristic","properties"],"sourceRoot":"../../../src","sources":["implementation/native_bridge.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,mBAAA,GAAAH,OAAA;AAAgD,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASG,WAAWA,CAAIC,GAAmB,EAAEC,GAAW,EAAEC,YAAqB,EAAK;EAChF,IAAIF,GAAG,CAACG,GAAG,CAACF,GAAG,CAAC,IAAIG,SAAS,EAAE;IAC3BJ,GAAG,CAACK,GAAG,CAACJ,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AAE5E,MAAMC,6BAA6B,GAAA1B,OAAA,CAAA0B,6BAAA,GAAG7B,yBAAgB,CAAC6B,6BAA6B;AAEpF,MAAMC,+BAA+B,GAAA3B,OAAA,CAAA2B,+BAAA,GAAG9B,yBAAgB,CAAC8B,+BAA+B;;AAE/F;;AAEA,MAAM5B,oBAAoB,GAAGA,CACzB6B,QAAgB,EAChBC,OAA0B,KACd;EACZ,OAAO,IAAIC,6BAAS,CAChBD,OAAO,CAAClC,EAAE,EACVkC,OAAO,CAACE,IAAI,EACZF,OAAO,CAACG,eAAe,CAAC9C,GAAG,CACtB+C,CAAC,IAAKC,2BAA2B,CAACN,QAAQ,EAAEC,OAAO,CAAClC,EAAE,EAAEsC,CAAC,CAC9D,CACJ,CAAC;AACL,CAAC;AAED,MAAMC,2BAA2B,GAAGA,CAChCN,QAAgB,EAChBZ,SAAiB,EACjBmB,cAAwC,KACrB;EACnB,OAAO,IAAIC,2CAAgB,CACvBR,QAAQ,EACRZ,SAAS,EACTmB,cAAc,CAACxC,EAAE,EACjBwC,cAAc,CAACJ,IAAI,EACnBI,cAAc,CAACE,UACnB,CAAC;AACL,CAAC","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "BBDevice", {
|
|
|
15
15
|
return _bluebreeze_device.BBDevice;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "BBObservable", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _bluebreeze_observable.BBObservable;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "BBScanResult", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function () {
|
|
@@ -31,6 +37,7 @@ exports.default = void 0;
|
|
|
31
37
|
var _reactNativeValueEmitter = require("react-native-value-emitter");
|
|
32
38
|
var _bluebreeze_characteristic = require("./implementation/bluebreeze_characteristic.js");
|
|
33
39
|
var _bluebreeze_device = require("./implementation/bluebreeze_device.js");
|
|
40
|
+
var _bluebreeze_observable = require("./implementation/bluebreeze_observable.js");
|
|
34
41
|
var _bluebreeze_scan_result = require("./implementation/bluebreeze_scan_result.js");
|
|
35
42
|
var _bluebreeze_service = require("./implementation/bluebreeze_service.js");
|
|
36
43
|
var _NativeBlueBreeze = _interopRequireDefault(require("./NativeBlueBreeze.js"));
|
|
@@ -38,7 +45,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
38
45
|
// State
|
|
39
46
|
|
|
40
47
|
/** The power/availability state of the device's Bluetooth adapter. */
|
|
41
|
-
const state = new
|
|
48
|
+
const state = new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.state());
|
|
42
49
|
_NativeBlueBreeze.default.stateEmitter(value => {
|
|
43
50
|
state.add(value);
|
|
44
51
|
});
|
|
@@ -46,7 +53,7 @@ _NativeBlueBreeze.default.stateEmitter(value => {
|
|
|
46
53
|
// Authorization to use BLE
|
|
47
54
|
|
|
48
55
|
/** Whether this app is currently allowed to use Bluetooth. */
|
|
49
|
-
const authorizationStatus = new
|
|
56
|
+
const authorizationStatus = new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.authorizationStatus());
|
|
50
57
|
_NativeBlueBreeze.default.authorizationStatusEmitter(value => {
|
|
51
58
|
authorizationStatus.add(value);
|
|
52
59
|
});
|
|
@@ -60,7 +67,7 @@ const authorizationOpenSettings = _NativeBlueBreeze.default.authorizationOpenSet
|
|
|
60
67
|
// Scanning
|
|
61
68
|
|
|
62
69
|
/** Whether a BLE scan is currently running. */
|
|
63
|
-
const scanEnabled = new
|
|
70
|
+
const scanEnabled = new _bluebreeze_observable.BBObservable(_NativeBlueBreeze.default.scanEnabled());
|
|
64
71
|
_NativeBlueBreeze.default.scanEnabledEmitter(value => {
|
|
65
72
|
scanEnabled.add(value);
|
|
66
73
|
});
|
|
@@ -95,7 +102,7 @@ const scanStop = _NativeBlueBreeze.default.scanStop;
|
|
|
95
102
|
* platform device ID. A device is added here the moment it's first seen in a scan result and
|
|
96
103
|
* stays here for the app's lifetime.
|
|
97
104
|
*/
|
|
98
|
-
const devices = new
|
|
105
|
+
const devices = new _bluebreeze_observable.BBObservable(new Map(_NativeBlueBreeze.default.devices().map(d => [d.id, convertDevice(d)])));
|
|
99
106
|
_NativeBlueBreeze.default.devicesEmitter(value => {
|
|
100
107
|
devices.add(new Map(value.map(d => [d.id, devices.value?.get(d.id) ?? convertDevice(d)])));
|
|
101
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeValueEmitter","require","_bluebreeze_characteristic","_bluebreeze_device","_bluebreeze_scan_result","_bluebreeze_service","_NativeBlueBreeze","_interopRequireDefault","e","__esModule","default","state","
|
|
1
|
+
{"version":3,"names":["_reactNativeValueEmitter","require","_bluebreeze_characteristic","_bluebreeze_device","_bluebreeze_observable","_bluebreeze_scan_result","_bluebreeze_service","_NativeBlueBreeze","_interopRequireDefault","e","__esModule","default","state","BBObservable","NativeBlueBreeze","stateEmitter","value","add","authorizationStatus","authorizationStatusEmitter","authorizationRequest","authorizationOpenSettings","scanEnabled","scanEnabledEmitter","scanResults","ValueEmitter","scanResultEmitter","device","devices","get","id","undefined","convertDevice","Map","set","convertScanResult","scanStart","ids","scanStop","map","d","devicesEmitter","BBDevice","name","scanResult","BBScanResult","rssi","connectable","advertisedServices","manufacturerId","manufacturerName","manufacturerData","_default","exports"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAEA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;A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BH,UAAU,CAACI,kBAAkB,EAC7BJ,UAAU,CAACK,cAAc,EACzBL,UAAU,CAACM,gBAAgB,EAC3BN,UAAU,CAACO,gBACf,CAAC;AACL,CAAC;;AAED;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEe;EACXC,KAAK;EACLM,mBAAmB;EACnBE,oBAAoB;EACpBC,yBAAyB;EACzBC,WAAW;EACXE,WAAW;EACXY,SAAS;EACTE,QAAQ;EACRV;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBlueBreeze.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAGlD;;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBlueBreeze.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAGlD;;AA2DA;;AAyDA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,YAAY,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { deviceCharacteristicData,
|
|
3
|
+
import { deviceCharacteristicData, deviceCharacteristicNotifyEnabled, deviceCharacteristicRead, deviceCharacteristicSubscribe, deviceCharacteristicUnsubscribe, deviceCharacteristicWrite } from "./native_bridge.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A GATT characteristic belonging to a {@link BBService}.
|
|
@@ -14,8 +14,7 @@ export class BBCharacteristic {
|
|
|
14
14
|
this.name = name;
|
|
15
15
|
this.properties = properties;
|
|
16
16
|
this.data = deviceCharacteristicData(deviceId, serviceId, id);
|
|
17
|
-
this.
|
|
18
|
-
this.notifications = deviceCharacteristicNotifications(deviceId, serviceId, id);
|
|
17
|
+
this.isNotifying = deviceCharacteristicNotifyEnabled(deviceId, serviceId, id);
|
|
19
18
|
this.read = () => deviceCharacteristicRead(deviceId, serviceId, id);
|
|
20
19
|
this.write = (data, withResponse) => deviceCharacteristicWrite(deviceId, serviceId, id, data, withResponse);
|
|
21
20
|
this.subscribe = () => deviceCharacteristicSubscribe(deviceId, serviceId, id);
|
|
@@ -28,13 +27,13 @@ export class BBCharacteristic {
|
|
|
28
27
|
|
|
29
28
|
/** The GATT properties this characteristic declares. */
|
|
30
29
|
|
|
31
|
-
/**
|
|
32
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The last value read or notified for this characteristic. Empty until first populated.
|
|
32
|
+
* Use `data.updates` to receive only the values that arrive from now on.
|
|
33
|
+
*/
|
|
33
34
|
|
|
34
35
|
/** Whether this app is currently subscribed to notifications for this characteristic. */
|
|
35
36
|
|
|
36
|
-
/** The notification stream for this characteristic. Does not replay past values. */
|
|
37
|
-
|
|
38
37
|
/**
|
|
39
38
|
* Reads this characteristic's current value, also updating {@link data}.
|
|
40
39
|
* @throws if the read fails or times out.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["deviceCharacteristicData","
|
|
1
|
+
{"version":3,"names":["deviceCharacteristicData","deviceCharacteristicNotifyEnabled","deviceCharacteristicRead","deviceCharacteristicSubscribe","deviceCharacteristicUnsubscribe","deviceCharacteristicWrite","BBCharacteristic","constructor","deviceId","serviceId","id","name","properties","data","isNotifying","read","write","withResponse","subscribe","unsubscribe"],"sourceRoot":"../../../src","sources":["implementation/bluebreeze_characteristic.ts"],"mappings":";;AACA,SACIA,wBAAwB,EACxBC,iCAAiC,EACjCC,wBAAwB,EACxBC,6BAA6B,EAC7BC,+BAA+B,EAC/BC,yBAAyB,QACtB,oBAAiB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CACPC,QAAgB,EAChBC,SAAiB,EACjBC,EAAU,EACVC,IAAwB,EACxBC,UAAoB,EACtB;IACE,IAAI,CAACF,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAE5B,IAAI,CAACC,IAAI,GAAGb,wBAAwB,CAACQ,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IAE7D,IAAI,CAACI,WAAW,GAAGb,iCAAiC,CAACO,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IAE7E,IAAI,CAACK,IAAI,GAAG,MAAMb,wBAAwB,CAACM,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IACnE,IAAI,CAACM,KAAK,GAAG,CAACH,IAAc,EAAEI,YAAqB,KAAKZ,yBAAyB,CAACG,QAAQ,EAAEC,SAAS,EAAEC,EAAE,EAAEG,IAAI,EAAEI,YAAY,CAAC;IAC9H,IAAI,CAACC,SAAS,GAAG,MAAMf,6BAA6B,CAACK,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;IAC7E,IAAI,CAACS,WAAW,GAAG,MAAMf,+BAA+B,CAACI,QAAQ,EAAEC,SAAS,EAAEC,EAAE,CAAC;EACrF;;EAEA;;EAGA;;EAGA;;EAGA;AACJ;AACA;AACA;;EAGI;;EAGA;AACJ;AACA;AACA;;EAGI;AACJ;AACA;AACA;AACA;AACA;;EAGI;AACJ;AACA;AACA;;EAGI;AACJ;AACA;AACA;AAEA","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StateValueEmitter, ValueEmitter } from 'react-native-value-emitter';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An observable value, used for every piece of state BlueBreeze exposes (`BlueBreeze.state`,
|
|
7
|
+
* {@link BBDevice.connectionStatus}, {@link BBCharacteristic.data}, and so on).
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* characteristic.data.value // the current value
|
|
11
|
+
* characteristic.data.values.onValue((data) => {}) // the current value, then new values
|
|
12
|
+
* characteristic.data.updates.onValue((data) => {}) // only new values
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Streams work with `useValueEmitter` from `react-native-value-emitter`, which unsubscribes
|
|
16
|
+
* automatically when the component unmounts.
|
|
17
|
+
*/
|
|
18
|
+
export class BBObservable {
|
|
19
|
+
constructor(initialValue) {
|
|
20
|
+
this._values = new StateValueEmitter(initialValue);
|
|
21
|
+
}
|
|
22
|
+
_updates = new ValueEmitter();
|
|
23
|
+
|
|
24
|
+
/** The current value. */
|
|
25
|
+
get value() {
|
|
26
|
+
return this._values.value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A stream that calls each handler with the current {@link value} first, then with every new one. */
|
|
30
|
+
get values() {
|
|
31
|
+
return this._values;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A stream of only the values published from now on, without the current {@link value}. */
|
|
35
|
+
get updates() {
|
|
36
|
+
return this._updates;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Publishes a new value. Internal to BlueBreeze: called when the native module reports an
|
|
41
|
+
* update, not meant to be called by apps.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
add(value) {
|
|
45
|
+
this._values.add(value);
|
|
46
|
+
this._updates.add(value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=bluebreeze_observable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StateValueEmitter","ValueEmitter","BBObservable","constructor","initialValue","_values","_updates","value","values","updates","add"],"sourceRoot":"../../../src","sources":["implementation/bluebreeze_observable.ts"],"mappings":";;AAAA,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,4BAA4B;;AAE5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,CAAI;EACzBC,WAAWA,CAACC,YAAe,EAAE;IACzB,IAAI,CAACC,OAAO,GAAG,IAAIL,iBAAiB,CAAII,YAAY,CAAC;EACzD;EAGiBE,QAAQ,GAAG,IAAIL,YAAY,CAAI,CAAC;;EAEjD;EACA,IAAIM,KAAKA,CAAA,EAAM;IACX,OAAO,IAAI,CAACF,OAAO,CAACE,KAAK;EAC7B;;EAEA;EACA,IAAIC,MAAMA,CAAA,EAAoB;IAC1B,OAAO,IAAI,CAACH,OAAO;EACvB;;EAEA;EACA,IAAII,OAAOA,CAAA,EAAoB;IAC3B,OAAO,IAAI,CAACH,QAAQ;EACxB;;EAEA;AACJ;AACA;AACA;AACA;EACII,GAAGA,CAACH,KAAQ,EAAE;IACV,IAAI,CAACF,OAAO,CAACK,GAAG,CAACH,KAAK,CAAC;IACvB,IAAI,CAACD,QAAQ,CAACI,GAAG,CAACH,KAAK,CAAC;EAC5B;AACJ","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { StateValueEmitter, ValueEmitter } from 'react-native-value-emitter';
|
|
4
3
|
import NativeBlueBreeze from "../NativeBlueBreeze.js";
|
|
5
4
|
import { BBCharacteristic } from "./bluebreeze_characteristic.js";
|
|
5
|
+
import { BBObservable } from "./bluebreeze_observable.js";
|
|
6
6
|
import { BBService } from "./bluebreeze_service.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -24,7 +24,7 @@ function mapGetOrSet(map, key, defaultValue) {
|
|
|
24
24
|
|
|
25
25
|
const _deviceServices = new Map();
|
|
26
26
|
export const deviceServices = id => {
|
|
27
|
-
return mapGetOrSet(_deviceServices, id, () => new
|
|
27
|
+
return mapGetOrSet(_deviceServices, id, () => new BBObservable(NativeBlueBreeze.deviceServices(id).map(s => convertDeviceService(id, s))));
|
|
28
28
|
};
|
|
29
29
|
NativeBlueBreeze.deviceServicesEmitter(value => {
|
|
30
30
|
deviceServices(value.id).add(value.value.map(s => convertDeviceService(value.id, s)));
|
|
@@ -34,7 +34,7 @@ NativeBlueBreeze.deviceServicesEmitter(value => {
|
|
|
34
34
|
|
|
35
35
|
const _deviceConnectionStatus = new Map();
|
|
36
36
|
export const deviceConnectionStatus = id => {
|
|
37
|
-
return mapGetOrSet(_deviceConnectionStatus, id, () => new
|
|
37
|
+
return mapGetOrSet(_deviceConnectionStatus, id, () => new BBObservable(NativeBlueBreeze.deviceConnectionStatus(id)));
|
|
38
38
|
};
|
|
39
39
|
NativeBlueBreeze.deviceConnectionStatusEmitter(value => {
|
|
40
40
|
deviceConnectionStatus(value.id).add(value.value);
|
|
@@ -44,7 +44,7 @@ NativeBlueBreeze.deviceConnectionStatusEmitter(value => {
|
|
|
44
44
|
|
|
45
45
|
const _deviceMTU = new Map();
|
|
46
46
|
export const deviceMTU = id => {
|
|
47
|
-
return mapGetOrSet(_deviceMTU, id, () => new
|
|
47
|
+
return mapGetOrSet(_deviceMTU, id, () => new BBObservable(NativeBlueBreeze.deviceMTU(id)));
|
|
48
48
|
};
|
|
49
49
|
NativeBlueBreeze.deviceMTUEmitter(value => {
|
|
50
50
|
deviceMTU(value.id).add(value.value);
|
|
@@ -63,7 +63,7 @@ const _deviceCharacteristicData = new Map();
|
|
|
63
63
|
export const deviceCharacteristicData = (id, serviceId, characteristicId) => {
|
|
64
64
|
const deviceMap = mapGetOrSet(_deviceCharacteristicData, id, () => new Map());
|
|
65
65
|
const serviceMap = mapGetOrSet(deviceMap, serviceId, () => new Map());
|
|
66
|
-
return mapGetOrSet(serviceMap, characteristicId, () => new
|
|
66
|
+
return mapGetOrSet(serviceMap, characteristicId, () => new BBObservable(NativeBlueBreeze.deviceCharacteristicData(id, serviceId, characteristicId)));
|
|
67
67
|
};
|
|
68
68
|
NativeBlueBreeze.deviceCharacteristicDataEmitter(value => {
|
|
69
69
|
deviceCharacteristicData(value.id, value.serviceId, value.characteristicId).add(value.value);
|
|
@@ -75,24 +75,12 @@ const _deviceCharacteristicNotifyEnabled = new Map();
|
|
|
75
75
|
export const deviceCharacteristicNotifyEnabled = (id, serviceId, characteristicId) => {
|
|
76
76
|
const deviceMap = mapGetOrSet(_deviceCharacteristicNotifyEnabled, id, () => new Map());
|
|
77
77
|
const serviceMap = mapGetOrSet(deviceMap, serviceId, () => new Map());
|
|
78
|
-
return mapGetOrSet(serviceMap, characteristicId, () => new
|
|
78
|
+
return mapGetOrSet(serviceMap, characteristicId, () => new BBObservable(NativeBlueBreeze.deviceCharacteristicNotifyEnabled(id, serviceId, characteristicId)));
|
|
79
79
|
};
|
|
80
80
|
NativeBlueBreeze.deviceCharacteristicNotifyEnabledEmitter(value => {
|
|
81
81
|
deviceCharacteristicNotifyEnabled(value.id, value.serviceId, value.characteristicId).add(value.value);
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
// Device characteristic notifications
|
|
85
|
-
|
|
86
|
-
const _deviceCharacteristicNotifications = new Map();
|
|
87
|
-
export const deviceCharacteristicNotifications = (id, serviceId, characteristicId) => {
|
|
88
|
-
const deviceMap = mapGetOrSet(_deviceCharacteristicNotifications, id, () => new Map());
|
|
89
|
-
const serviceMap = mapGetOrSet(deviceMap, serviceId, () => new Map());
|
|
90
|
-
return mapGetOrSet(serviceMap, characteristicId, () => new ValueEmitter());
|
|
91
|
-
};
|
|
92
|
-
NativeBlueBreeze.deviceCharacteristicNotificationsEmitter(value => {
|
|
93
|
-
deviceCharacteristicNotifications(value.id, value.serviceId, value.characteristicId).add(value.value);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
84
|
// Device characteristic operations
|
|
97
85
|
|
|
98
86
|
export const deviceCharacteristicRead = NativeBlueBreeze.deviceCharacteristicRead;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["NativeBlueBreeze","BBCharacteristic","BBObservable","BBService","mapGetOrSet","map","key","defaultValue","get","undefined","set","_deviceServices","Map","deviceServices","id","s","convertDeviceService","deviceServicesEmitter","value","add","_deviceConnectionStatus","deviceConnectionStatus","deviceConnectionStatusEmitter","_deviceMTU","deviceMTU","deviceMTUEmitter","deviceConnect","deviceDisconnect","deviceDiscoverServices","deviceRequestMTU","_deviceCharacteristicData","deviceCharacteristicData","serviceId","characteristicId","deviceMap","serviceMap","deviceCharacteristicDataEmitter","_deviceCharacteristicNotifyEnabled","deviceCharacteristicNotifyEnabled","deviceCharacteristicNotifyEnabledEmitter","deviceCharacteristicRead","deviceCharacteristicWrite","deviceCharacteristicSubscribe","deviceCharacteristicUnsubscribe","deviceId","service","name","characteristics","c","convertDeviceCharacteristic","characteristic","properties"],"sourceRoot":"../../../src","sources":["implementation/native_bridge.ts"],"mappings":";;AAAA,OAAOA,gBAAgB,MAAiE,wBAAqB;AAC7G,SAASC,gBAAgB,QAAQ,gCAA6B;AAC9D,SAASC,YAAY,QAAQ,4BAAyB;AAEtD,SAASC,SAAS,QAAQ,yBAAsB;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASC,WAAWA,CAAIC,GAAmB,EAAEC,GAAW,EAAEC,YAAqB,EAAK;EAChF,IAAIF,GAAG,CAACG,GAAG,CAACF,GAAG,CAAC,IAAIG,SAAS,EAAE;IAC3BJ,GAAG,CAACK,GAAG,CAACJ,GAAG,EAAEC,YAAY,CAAC,CAAC,CAAC;EAChC;EAEA,OAAOF,GAAG,CAACG,GAAG,CAACF,GAAG,CAAC;AACvB;;AAEA;;AAEA,MAAMK,eAAe,GAAG,IAAIC,GAAG,CAAoC,CAAC;AAEpE,OAAO,MAAMC,cAAc,GAAIC,EAAU,IAAgC;EACrE,OAAOV,WAAW,CACdO,eAAe,EACfG,EAAE,EACF,MAAM,IAAIZ,YAAY,CAClBF,gBAAgB,CAACa,cAAc,CAACC,EAAE,CAAC,CAACT,GAAG,CAClCU,CAAC,IAAKC,oBAAoB,CAACF,EAAE,EAAEC,CAAC,CACrC,CACJ,CACJ,CAAC;AACL,CAAC;AAEDf,gBAAgB,CAACiB,qBAAqB,CAAEC,KAAK,IAAK;EAC9CL,cAAc,CAACK,KAAK,CAACJ,EAAE,CAAC,C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