react-native-bluebreeze 0.0.1
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/LICENSE +20 -0
- package/README.md +33 -0
- package/android/build.gradle +122 -0
- package/android/generated/java/com/bluebreeze/NativeBlueBreezeSpec.java +153 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNBlueBreezeSpec-generated.cpp +156 -0
- package/android/generated/jni/RNBlueBreezeSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNBlueBreezeSpec/RNBlueBreezeSpecJSI-generated.cpp +171 -0
- package/android/generated/jni/react/renderer/components/RNBlueBreezeSpec/RNBlueBreezeSpecJSI.h +632 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/bluebreeze/BlueBreezeModule.kt +23 -0
- package/android/src/main/java/com/bluebreeze/BlueBreezePackage.kt +34 -0
- package/ios/BlueBreezeImpl.swift +477 -0
- package/ios/Bluebreeze.h +6 -0
- package/ios/Bluebreeze.mm +280 -0
- package/ios/generated/RNBlueBreezeSpec/RNBlueBreezeSpec-generated.mm +219 -0
- package/ios/generated/RNBlueBreezeSpec/RNBlueBreezeSpec.h +117 -0
- package/ios/generated/RNBlueBreezeSpecJSI-generated.cpp +171 -0
- package/ios/generated/RNBlueBreezeSpecJSI.h +632 -0
- package/package.json +203 -0
- package/react-native-bluebreeze.podspec +44 -0
- package/react-native.config.js +12 -0
- package/src/NativeBlueBreeze.ts +142 -0
- package/src/index.tsx +99 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNBlueBreezeSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_authorizationStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->authorizationStatus(
|
|
16
|
+
rt
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_authorizationRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
20
|
+
static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->authorizationRequest(
|
|
21
|
+
rt
|
|
22
|
+
);
|
|
23
|
+
return jsi::Value::undefined();
|
|
24
|
+
}
|
|
25
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_state(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
26
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->state(
|
|
27
|
+
rt
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_scanningEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->scanningEnabled(
|
|
32
|
+
rt
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_scanningStart(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
36
|
+
static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->scanningStart(
|
|
37
|
+
rt
|
|
38
|
+
);
|
|
39
|
+
return jsi::Value::undefined();
|
|
40
|
+
}
|
|
41
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_scanningStop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
42
|
+
static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->scanningStop(
|
|
43
|
+
rt
|
|
44
|
+
);
|
|
45
|
+
return jsi::Value::undefined();
|
|
46
|
+
}
|
|
47
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_devices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
48
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->devices(
|
|
49
|
+
rt
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceServices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
53
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceServices(
|
|
54
|
+
rt,
|
|
55
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceConnectionStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
59
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceConnectionStatus(
|
|
60
|
+
rt,
|
|
61
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceMTU(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
65
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceMTU(
|
|
66
|
+
rt,
|
|
67
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceConnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
71
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceConnect(
|
|
72
|
+
rt,
|
|
73
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceDisconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
77
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceDisconnect(
|
|
78
|
+
rt,
|
|
79
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceDiscoverServices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
83
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceDiscoverServices(
|
|
84
|
+
rt,
|
|
85
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceRequestMTU(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
89
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceRequestMTU(
|
|
90
|
+
rt,
|
|
91
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
92
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber()
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
96
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceCharacteristicData(
|
|
97
|
+
rt,
|
|
98
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
99
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
100
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicNotifyEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
104
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceCharacteristicNotifyEnabled(
|
|
105
|
+
rt,
|
|
106
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
107
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
108
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicRead(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
112
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceCharacteristicRead(
|
|
113
|
+
rt,
|
|
114
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
115
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
116
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicWrite(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
120
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceCharacteristicWrite(
|
|
121
|
+
rt,
|
|
122
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
123
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
124
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
125
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt),
|
|
126
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asBool()
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicSubscribe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
130
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceCharacteristicSubscribe(
|
|
131
|
+
rt,
|
|
132
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
133
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
134
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
static jsi::Value __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicUnsubscribe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
138
|
+
return static_cast<NativeBlueBreezeCxxSpecJSI *>(&turboModule)->deviceCharacteristicUnsubscribe(
|
|
139
|
+
rt,
|
|
140
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
141
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
142
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
NativeBlueBreezeCxxSpecJSI::NativeBlueBreezeCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
147
|
+
: TurboModule("BlueBreeze", jsInvoker) {
|
|
148
|
+
methodMap_["authorizationStatus"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_authorizationStatus};
|
|
149
|
+
methodMap_["authorizationRequest"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_authorizationRequest};
|
|
150
|
+
methodMap_["state"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_state};
|
|
151
|
+
methodMap_["scanningEnabled"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_scanningEnabled};
|
|
152
|
+
methodMap_["scanningStart"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_scanningStart};
|
|
153
|
+
methodMap_["scanningStop"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_scanningStop};
|
|
154
|
+
methodMap_["devices"] = MethodMetadata {0, __hostFunction_NativeBlueBreezeCxxSpecJSI_devices};
|
|
155
|
+
methodMap_["deviceServices"] = MethodMetadata {1, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceServices};
|
|
156
|
+
methodMap_["deviceConnectionStatus"] = MethodMetadata {1, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceConnectionStatus};
|
|
157
|
+
methodMap_["deviceMTU"] = MethodMetadata {1, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceMTU};
|
|
158
|
+
methodMap_["deviceConnect"] = MethodMetadata {1, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceConnect};
|
|
159
|
+
methodMap_["deviceDisconnect"] = MethodMetadata {1, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceDisconnect};
|
|
160
|
+
methodMap_["deviceDiscoverServices"] = MethodMetadata {1, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceDiscoverServices};
|
|
161
|
+
methodMap_["deviceRequestMTU"] = MethodMetadata {2, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceRequestMTU};
|
|
162
|
+
methodMap_["deviceCharacteristicData"] = MethodMetadata {3, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicData};
|
|
163
|
+
methodMap_["deviceCharacteristicNotifyEnabled"] = MethodMetadata {3, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicNotifyEnabled};
|
|
164
|
+
methodMap_["deviceCharacteristicRead"] = MethodMetadata {3, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicRead};
|
|
165
|
+
methodMap_["deviceCharacteristicWrite"] = MethodMetadata {5, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicWrite};
|
|
166
|
+
methodMap_["deviceCharacteristicSubscribe"] = MethodMetadata {3, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicSubscribe};
|
|
167
|
+
methodMap_["deviceCharacteristicUnsubscribe"] = MethodMetadata {3, __hostFunction_NativeBlueBreezeCxxSpecJSI_deviceCharacteristicUnsubscribe};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
} // namespace facebook::react
|