react-native-ble-nitro 1.9.3 → 1.10.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 +23 -0
- package/android/src/main/java/com/margelo/nitro/co/zyke/ble/BleNitroBleManager.kt +4 -0
- package/ios/BleNitroBleManager.swift +38 -3
- package/lib/commonjs/manager.d.ts +8 -0
- package/lib/commonjs/manager.d.ts.map +1 -1
- package/lib/commonjs/manager.js +11 -0
- package/lib/commonjs/manager.js.map +1 -1
- package/lib/commonjs/specs/NativeBleNitro.nitro.d.ts +1 -0
- package/lib/commonjs/specs/NativeBleNitro.nitro.d.ts.map +1 -1
- package/lib/manager.d.ts +8 -0
- package/lib/manager.js +10 -0
- package/lib/specs/NativeBleNitro.nitro.d.ts +1 -0
- package/nitrogen/generated/android/BleNitro+autolinking.cmake +3 -1
- package/nitrogen/generated/android/BleNitro+autolinking.gradle +1 -1
- package/nitrogen/generated/android/BleNitroOnLoad.cpp +3 -3
- package/nitrogen/generated/android/BleNitroOnLoad.hpp +1 -1
- package/nitrogen/generated/android/c++/JAndroidScanMode.hpp +5 -6
- package/nitrogen/generated/android/c++/JBLEDevice.hpp +8 -4
- package/nitrogen/generated/android/c++/JBLEState.hpp +7 -8
- package/nitrogen/generated/android/c++/JFunc_void_BLEState.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool_double_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__shared_ptr_ArrayBuffer__std__string.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__string_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__.hpp +91 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_bool_std__string.hpp +3 -2
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__shared_ptr_ArrayBuffer_.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_BLEDevice_.hpp +5 -4
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroFactorySpec.cpp +15 -4
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroFactorySpec.hpp +3 -1
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.cpp +31 -9
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.hpp +5 -2
- package/nitrogen/generated/android/c++/JManufacturerData.hpp +8 -4
- package/nitrogen/generated/android/c++/JManufacturerDataEntry.hpp +6 -3
- package/nitrogen/generated/android/c++/JOperationResult.hpp +6 -2
- package/nitrogen/generated/android/c++/JScanFilter.hpp +8 -3
- package/nitrogen/generated/android/c++/JVariant_NullType_BLEDevice.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_BLEDevice.hpp +79 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_String.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_String.hpp +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/AndroidScanMode.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BLEDevice.kt +34 -25
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BLEState.kt +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleNitroOnLoad.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_BLEState.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_double_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.kt +2 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__string_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_std__optional_BLEDevice__std__optional_std__string_.kt → Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__.kt} +11 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__string_bool_std__string.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__string_std__shared_ptr_ArrayBuffer_.kt +2 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__vector_BLEDevice_.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridNativeBleNitroFactorySpec.kt +8 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridNativeBleNitroSpec.kt +17 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ManufacturerData.kt +16 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ManufacturerDataEntry.kt +20 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/OperationResult.kt +19 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanFilter.kt +25 -16
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Variant_NullType_BLEDevice.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Variant_NullType_String.kt +59 -0
- package/nitrogen/generated/ios/BleNitro+autolinking.rb +2 -2
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.cpp +6 -5
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp +99 -27
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Umbrella.hpp +3 -3
- package/nitrogen/generated/ios/BleNitroAutolinking.mm +1 -1
- package/nitrogen/generated/ios/BleNitroAutolinking.swift +13 -15
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroFactorySpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroFactorySpecSwift.hpp +10 -3
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroSpecSwift.hpp +19 -4
- package/nitrogen/generated/ios/swift/AndroidScanMode.swift +1 -1
- package/nitrogen/generated/ios/swift/BLEDevice.swift +15 -63
- package/nitrogen/generated/ios/swift/BLEState.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_BLEState.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_double_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_bool_std__string_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__.swift +84 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_bool_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__shared_ptr_ArrayBuffer_.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__vector_BLEDevice_.swift +1 -2
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroFactorySpec.swift +10 -4
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroFactorySpec_cxx.swift +18 -3
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec.swift +12 -5
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec_cxx.swift +59 -12
- package/nitrogen/generated/ios/swift/ManufacturerData.swift +3 -15
- package/nitrogen/generated/ios/swift/ManufacturerDataEntry.swift +5 -17
- package/nitrogen/generated/ios/swift/OperationResult.swift +12 -30
- package/nitrogen/generated/ios/swift/ScanFilter.swift +9 -39
- package/nitrogen/generated/ios/swift/Variant_NullType_BLEDevice.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_String.swift +18 -0
- package/nitrogen/generated/shared/c++/AndroidScanMode.hpp +1 -1
- package/nitrogen/generated/shared/c++/BLEDevice.hpp +31 -23
- package/nitrogen/generated/shared/c++/BLEState.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroFactorySpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroFactorySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.hpp +5 -4
- package/nitrogen/generated/shared/c++/ManufacturerData.hpp +13 -5
- package/nitrogen/generated/shared/c++/ManufacturerDataEntry.hpp +17 -10
- package/nitrogen/generated/shared/c++/OperationResult.hpp +16 -8
- package/nitrogen/generated/shared/c++/ScanFilter.hpp +22 -14
- package/package.json +10 -10
- package/plugin/build/withBleNitro.d.ts +8 -0
- package/plugin/build/withBleNitro.js +4 -1
- package/src/manager.ts +13 -2
- package/src/specs/NativeBleNitro.nitro.ts +1 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_BLEDevice__std__optional_std__string_.hpp +0 -86
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BLEDevice__std__optional_std__string_.swift +0 -54
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// HybridNativeBleNitroSpec_cxx.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
import Foundation
|
|
9
8
|
import NitroModules
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -76,7 +75,7 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
76
75
|
*/
|
|
77
76
|
public func getCxxPart() -> bridge.std__shared_ptr_HybridNativeBleNitroSpec_ {
|
|
78
77
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
|
-
if cachedCxxPart
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
80
79
|
return cachedCxxPart
|
|
81
80
|
} else {
|
|
82
81
|
let newCxxPart = bridge.create_std__shared_ptr_HybridNativeBleNitroSpec_(self.toUnsafe())
|
|
@@ -96,6 +95,14 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
96
95
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
96
|
}
|
|
98
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridNativeBleNitroSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
/**
|
|
100
107
|
* Call dispose() on the Swift class.
|
|
101
108
|
* This _may_ be called manually from JS.
|
|
@@ -105,6 +112,14 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
105
112
|
self.__implementation.dispose()
|
|
106
113
|
}
|
|
107
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
108
123
|
// Properties
|
|
109
124
|
public final var restoreStateIdentifier: bridge.std__optional_std__string_ {
|
|
110
125
|
@inline(__always)
|
|
@@ -154,20 +169,45 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
154
169
|
}
|
|
155
170
|
|
|
156
171
|
@inline(__always)
|
|
157
|
-
public final func
|
|
172
|
+
public final func iosLazyInit() -> bridge.Result_void_ {
|
|
158
173
|
do {
|
|
159
|
-
try self.__implementation.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
try self.__implementation.iosLazyInit()
|
|
175
|
+
return bridge.create_Result_void_()
|
|
176
|
+
} catch (let __error) {
|
|
177
|
+
let __exceptionPtr = __error.toCpp()
|
|
178
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@inline(__always)
|
|
183
|
+
public final func startScan(filter: ScanFilter, callback: bridge.Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__) -> bridge.Result_void_ {
|
|
184
|
+
do {
|
|
185
|
+
try self.__implementation.startScan(filter: filter, callback: { () -> (Variant_NullType_BLEDevice?, Variant_NullType_String?) -> Void in
|
|
186
|
+
let __wrappedFunction = bridge.wrap_Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__(callback)
|
|
187
|
+
return { (__device: Variant_NullType_BLEDevice?, __error: Variant_NullType_String?) -> Void in
|
|
188
|
+
__wrappedFunction.call({ () -> bridge.std__optional_std__variant_nitro__NullType__BLEDevice__ in
|
|
163
189
|
if let __unwrappedValue = __device {
|
|
164
|
-
return bridge.
|
|
190
|
+
return bridge.create_std__optional_std__variant_nitro__NullType__BLEDevice__({ () -> bridge.std__variant_nitro__NullType__BLEDevice_ in
|
|
191
|
+
switch __unwrappedValue {
|
|
192
|
+
case .first(let __value):
|
|
193
|
+
return bridge.create_std__variant_nitro__NullType__BLEDevice_(margelo.nitro.NullType.null)
|
|
194
|
+
case .second(let __value):
|
|
195
|
+
return bridge.create_std__variant_nitro__NullType__BLEDevice_(__value)
|
|
196
|
+
}
|
|
197
|
+
}().variant)
|
|
165
198
|
} else {
|
|
166
199
|
return .init()
|
|
167
200
|
}
|
|
168
|
-
}(), { () -> bridge.
|
|
201
|
+
}(), { () -> bridge.std__optional_std__variant_nitro__NullType__std__string__ in
|
|
169
202
|
if let __unwrappedValue = __error {
|
|
170
|
-
return bridge.
|
|
203
|
+
return bridge.create_std__optional_std__variant_nitro__NullType__std__string__({ () -> bridge.std__variant_nitro__NullType__std__string_ in
|
|
204
|
+
switch __unwrappedValue {
|
|
205
|
+
case .first(let __value):
|
|
206
|
+
return bridge.create_std__variant_nitro__NullType__std__string_(margelo.nitro.NullType.null)
|
|
207
|
+
case .second(let __value):
|
|
208
|
+
return bridge.create_std__variant_nitro__NullType__std__string_(std.string(__value))
|
|
209
|
+
}
|
|
210
|
+
}().variant)
|
|
171
211
|
} else {
|
|
172
212
|
return .init()
|
|
173
213
|
}
|
|
@@ -243,7 +283,14 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
243
283
|
} else {
|
|
244
284
|
return nil
|
|
245
285
|
}
|
|
246
|
-
}(), autoConnectAndroid:
|
|
286
|
+
}(), autoConnectAndroid: { () -> Bool? in
|
|
287
|
+
if bridge.has_value_std__optional_bool_(autoConnectAndroid) {
|
|
288
|
+
let __unwrapped = bridge.get_std__optional_bool_(autoConnectAndroid)
|
|
289
|
+
return __unwrapped
|
|
290
|
+
} else {
|
|
291
|
+
return nil
|
|
292
|
+
}
|
|
293
|
+
}())
|
|
247
294
|
return bridge.create_Result_void_()
|
|
248
295
|
} catch (let __error) {
|
|
249
296
|
let __exceptionPtr = __error.toCpp()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ManufacturerData.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
@@ -28,20 +28,8 @@ public extension ManufacturerData {
|
|
|
28
28
|
}())
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
@inline(__always)
|
|
31
32
|
var companyIdentifiers: [ManufacturerDataEntry] {
|
|
32
|
-
|
|
33
|
-
get {
|
|
34
|
-
return self.__companyIdentifiers.map({ __item in __item })
|
|
35
|
-
}
|
|
36
|
-
@inline(__always)
|
|
37
|
-
set {
|
|
38
|
-
self.__companyIdentifiers = { () -> bridge.std__vector_ManufacturerDataEntry_ in
|
|
39
|
-
var __vector = bridge.create_std__vector_ManufacturerDataEntry_(newValue.count)
|
|
40
|
-
for __item in newValue {
|
|
41
|
-
__vector.push_back(__item)
|
|
42
|
-
}
|
|
43
|
-
return __vector
|
|
44
|
-
}()
|
|
45
|
-
}
|
|
33
|
+
return self.__companyIdentifiers.map({ __item in __item })
|
|
46
34
|
}
|
|
47
35
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ManufacturerDataEntry.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
@@ -22,25 +22,13 @@ public extension ManufacturerDataEntry {
|
|
|
22
22
|
self.init(std.string(id), data.getArrayBuffer())
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
@inline(__always)
|
|
25
26
|
var id: String {
|
|
26
|
-
|
|
27
|
-
get {
|
|
28
|
-
return String(self.__id)
|
|
29
|
-
}
|
|
30
|
-
@inline(__always)
|
|
31
|
-
set {
|
|
32
|
-
self.__id = std.string(newValue)
|
|
33
|
-
}
|
|
27
|
+
return String(self.__id)
|
|
34
28
|
}
|
|
35
29
|
|
|
30
|
+
@inline(__always)
|
|
36
31
|
var data: ArrayBuffer {
|
|
37
|
-
|
|
38
|
-
get {
|
|
39
|
-
return ArrayBuffer(self.__data)
|
|
40
|
-
}
|
|
41
|
-
@inline(__always)
|
|
42
|
-
set {
|
|
43
|
-
self.__data = newValue.getArrayBuffer()
|
|
44
|
-
}
|
|
32
|
+
return ArrayBuffer(self.__data)
|
|
45
33
|
}
|
|
46
34
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// OperationResult.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
@@ -28,38 +28,20 @@ public extension OperationResult {
|
|
|
28
28
|
}())
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
@inline(__always)
|
|
31
32
|
var success: Bool {
|
|
32
|
-
|
|
33
|
-
get {
|
|
34
|
-
return self.__success
|
|
35
|
-
}
|
|
36
|
-
@inline(__always)
|
|
37
|
-
set {
|
|
38
|
-
self.__success = newValue
|
|
39
|
-
}
|
|
33
|
+
return self.__success
|
|
40
34
|
}
|
|
41
35
|
|
|
36
|
+
@inline(__always)
|
|
42
37
|
var error: String? {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}()
|
|
53
|
-
}
|
|
54
|
-
@inline(__always)
|
|
55
|
-
set {
|
|
56
|
-
self.__error = { () -> bridge.std__optional_std__string_ in
|
|
57
|
-
if let __unwrappedValue = newValue {
|
|
58
|
-
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
59
|
-
} else {
|
|
60
|
-
return .init()
|
|
61
|
-
}
|
|
62
|
-
}()
|
|
63
|
-
}
|
|
38
|
+
return { () -> String? in
|
|
39
|
+
if bridge.has_value_std__optional_std__string_(self.__error) {
|
|
40
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__error)
|
|
41
|
+
return String(__unwrapped)
|
|
42
|
+
} else {
|
|
43
|
+
return nil
|
|
44
|
+
}
|
|
45
|
+
}()
|
|
64
46
|
}
|
|
65
47
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ScanFilter.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
@@ -28,53 +28,23 @@ public extension ScanFilter {
|
|
|
28
28
|
}(), rssiThreshold, allowDuplicates, androidScanMode)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
@inline(__always)
|
|
31
32
|
var serviceUUIDs: [String] {
|
|
32
|
-
|
|
33
|
-
get {
|
|
34
|
-
return self.__serviceUUIDs.map({ __item in String(__item) })
|
|
35
|
-
}
|
|
36
|
-
@inline(__always)
|
|
37
|
-
set {
|
|
38
|
-
self.__serviceUUIDs = { () -> bridge.std__vector_std__string_ in
|
|
39
|
-
var __vector = bridge.create_std__vector_std__string_(newValue.count)
|
|
40
|
-
for __item in newValue {
|
|
41
|
-
__vector.push_back(std.string(__item))
|
|
42
|
-
}
|
|
43
|
-
return __vector
|
|
44
|
-
}()
|
|
45
|
-
}
|
|
33
|
+
return self.__serviceUUIDs.map({ __item in String(__item) })
|
|
46
34
|
}
|
|
47
35
|
|
|
36
|
+
@inline(__always)
|
|
48
37
|
var rssiThreshold: Double {
|
|
49
|
-
|
|
50
|
-
get {
|
|
51
|
-
return self.__rssiThreshold
|
|
52
|
-
}
|
|
53
|
-
@inline(__always)
|
|
54
|
-
set {
|
|
55
|
-
self.__rssiThreshold = newValue
|
|
56
|
-
}
|
|
38
|
+
return self.__rssiThreshold
|
|
57
39
|
}
|
|
58
40
|
|
|
41
|
+
@inline(__always)
|
|
59
42
|
var allowDuplicates: Bool {
|
|
60
|
-
|
|
61
|
-
get {
|
|
62
|
-
return self.__allowDuplicates
|
|
63
|
-
}
|
|
64
|
-
@inline(__always)
|
|
65
|
-
set {
|
|
66
|
-
self.__allowDuplicates = newValue
|
|
67
|
-
}
|
|
43
|
+
return self.__allowDuplicates
|
|
68
44
|
}
|
|
69
45
|
|
|
46
|
+
@inline(__always)
|
|
70
47
|
var androidScanMode: AndroidScanMode {
|
|
71
|
-
|
|
72
|
-
get {
|
|
73
|
-
return self.__androidScanMode
|
|
74
|
-
}
|
|
75
|
-
@inline(__always)
|
|
76
|
-
set {
|
|
77
|
-
self.__androidScanMode = newValue
|
|
78
|
-
}
|
|
48
|
+
return self.__androidScanMode
|
|
79
49
|
}
|
|
80
50
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_BLEDevice.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `null | struct`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum Variant_NullType_BLEDevice {
|
|
16
|
+
case first(NullType)
|
|
17
|
+
case second(BLEDevice)
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_String.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `null | string`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public enum Variant_NullType_String {
|
|
16
|
+
case first(NullType)
|
|
17
|
+
case second(String)
|
|
18
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// BLEDevice.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
// Forward declaration of `ManufacturerData` to properly resolve imports.
|
|
27
32
|
namespace margelo::nitro::co::zyke::ble { struct ManufacturerData; }
|
|
@@ -35,7 +40,7 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
35
40
|
/**
|
|
36
41
|
* A struct which can be represented as a JavaScript object (BLEDevice).
|
|
37
42
|
*/
|
|
38
|
-
struct BLEDevice {
|
|
43
|
+
struct BLEDevice final {
|
|
39
44
|
public:
|
|
40
45
|
std::string id SWIFT_PRIVATE;
|
|
41
46
|
std::string name SWIFT_PRIVATE;
|
|
@@ -48,6 +53,9 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
48
53
|
public:
|
|
49
54
|
BLEDevice() = default;
|
|
50
55
|
explicit BLEDevice(std::string id, std::string name, double rssi, ManufacturerData manufacturerData, std::vector<std::string> serviceUUIDs, bool isConnectable, bool isConnected): id(id), name(name), rssi(rssi), manufacturerData(manufacturerData), serviceUUIDs(serviceUUIDs), isConnectable(isConnectable), isConnected(isConnected) {}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
friend bool operator==(const BLEDevice& lhs, const BLEDevice& rhs) = default;
|
|
51
59
|
};
|
|
52
60
|
|
|
53
61
|
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -60,24 +68,24 @@ namespace margelo::nitro {
|
|
|
60
68
|
static inline margelo::nitro::co::zyke::ble::BLEDevice fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
69
|
jsi::Object obj = arg.asObject(runtime);
|
|
62
70
|
return margelo::nitro::co::zyke::ble::BLEDevice(
|
|
63
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
64
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "name")),
|
|
65
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "rssi")),
|
|
66
|
-
JSIConverter<margelo::nitro::co::zyke::ble::ManufacturerData>::fromJSI(runtime, obj.getProperty(runtime, "manufacturerData")),
|
|
67
|
-
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "serviceUUIDs")),
|
|
68
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isConnectable")),
|
|
69
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isConnected"))
|
|
71
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id"))),
|
|
72
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name"))),
|
|
73
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rssi"))),
|
|
74
|
+
JSIConverter<margelo::nitro::co::zyke::ble::ManufacturerData>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "manufacturerData"))),
|
|
75
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceUUIDs"))),
|
|
76
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isConnectable"))),
|
|
77
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isConnected")))
|
|
70
78
|
);
|
|
71
79
|
}
|
|
72
80
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::co::zyke::ble::BLEDevice& arg) {
|
|
73
81
|
jsi::Object obj(runtime);
|
|
74
|
-
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
75
|
-
obj.setProperty(runtime, "name", JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
76
|
-
obj.setProperty(runtime, "rssi", JSIConverter<double>::toJSI(runtime, arg.rssi));
|
|
77
|
-
obj.setProperty(runtime, "manufacturerData", JSIConverter<margelo::nitro::co::zyke::ble::ManufacturerData>::toJSI(runtime, arg.manufacturerData));
|
|
78
|
-
obj.setProperty(runtime, "serviceUUIDs", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.serviceUUIDs));
|
|
79
|
-
obj.setProperty(runtime, "isConnectable", JSIConverter<bool>::toJSI(runtime, arg.isConnectable));
|
|
80
|
-
obj.setProperty(runtime, "isConnected", JSIConverter<bool>::toJSI(runtime, arg.isConnected));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "id"), JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "name"), JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
84
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "rssi"), JSIConverter<double>::toJSI(runtime, arg.rssi));
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "manufacturerData"), JSIConverter<margelo::nitro::co::zyke::ble::ManufacturerData>::toJSI(runtime, arg.manufacturerData));
|
|
86
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "serviceUUIDs"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.serviceUUIDs));
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "isConnectable"), JSIConverter<bool>::toJSI(runtime, arg.isConnectable));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "isConnected"), JSIConverter<bool>::toJSI(runtime, arg.isConnected));
|
|
81
89
|
return obj;
|
|
82
90
|
}
|
|
83
91
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -88,13 +96,13 @@ namespace margelo::nitro {
|
|
|
88
96
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
89
97
|
return false;
|
|
90
98
|
}
|
|
91
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
92
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
|
|
93
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "rssi"))) return false;
|
|
94
|
-
if (!JSIConverter<margelo::nitro::co::zyke::ble::ManufacturerData>::canConvert(runtime, obj.getProperty(runtime, "manufacturerData"))) return false;
|
|
95
|
-
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "serviceUUIDs"))) return false;
|
|
96
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isConnectable"))) return false;
|
|
97
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isConnected"))) return false;
|
|
99
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id")))) return false;
|
|
100
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name")))) return false;
|
|
101
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rssi")))) return false;
|
|
102
|
+
if (!JSIConverter<margelo::nitro::co::zyke::ble::ManufacturerData>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "manufacturerData")))) return false;
|
|
103
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceUUIDs")))) return false;
|
|
104
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isConnectable")))) return false;
|
|
105
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isConnected")))) return false;
|
|
98
106
|
return true;
|
|
99
107
|
}
|
|
100
108
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroFactorySpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridNativeBleNitroFactorySpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridNativeBleNitroSpec.hpp"
|
|
@@ -17,6 +17,7 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
17
17
|
prototype.registerHybridGetter("restoreStateIdentifier", &HybridNativeBleNitroSpec::getRestoreStateIdentifier);
|
|
18
18
|
prototype.registerHybridSetter("restoreStateIdentifier", &HybridNativeBleNitroSpec::setRestoreStateIdentifier);
|
|
19
19
|
prototype.registerHybridMethod("setRestoreStateCallback", &HybridNativeBleNitroSpec::setRestoreStateCallback);
|
|
20
|
+
prototype.registerHybridMethod("iosLazyInit", &HybridNativeBleNitroSpec::iosLazyInit);
|
|
20
21
|
prototype.registerHybridMethod("startScan", &HybridNativeBleNitroSpec::startScan);
|
|
21
22
|
prototype.registerHybridMethod("stopScan", &HybridNativeBleNitroSpec::stopScan);
|
|
22
23
|
prototype.registerHybridMethod("isScanning", &HybridNativeBleNitroSpec::isScanning);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridNativeBleNitroSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
namespace margelo::nitro::co::zyke::ble { struct BLEDevice; }
|
|
18
18
|
// Forward declaration of `ScanFilter` to properly resolve imports.
|
|
19
19
|
namespace margelo::nitro::co::zyke::ble { struct ScanFilter; }
|
|
20
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
21
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
22
20
|
// Forward declaration of `BLEState` to properly resolve imports.
|
|
23
21
|
namespace margelo::nitro::co::zyke::ble { enum class BLEState; }
|
|
24
22
|
// Forward declaration of `OperationResult` to properly resolve imports.
|
|
@@ -30,6 +28,8 @@ namespace margelo::nitro::co::zyke::ble { struct OperationResult; }
|
|
|
30
28
|
#include <vector>
|
|
31
29
|
#include <functional>
|
|
32
30
|
#include "ScanFilter.hpp"
|
|
31
|
+
#include <NitroModules/Null.hpp>
|
|
32
|
+
#include <variant>
|
|
33
33
|
#include <NitroModules/ArrayBuffer.hpp>
|
|
34
34
|
#include "BLEState.hpp"
|
|
35
35
|
#include "OperationResult.hpp"
|
|
@@ -68,7 +68,8 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
68
68
|
public:
|
|
69
69
|
// Methods
|
|
70
70
|
virtual void setRestoreStateCallback(const std::function<void(const std::vector<BLEDevice>& /* restoredPeripherals */)>& callback) = 0;
|
|
71
|
-
virtual void
|
|
71
|
+
virtual void iosLazyInit() = 0;
|
|
72
|
+
virtual void startScan(const ScanFilter& filter, const std::function<void(const std::optional<std::variant<nitro::NullType, BLEDevice>>& /* device */, const std::optional<std::variant<nitro::NullType, std::string>>& /* error */)>& callback) = 0;
|
|
72
73
|
virtual bool stopScan() = 0;
|
|
73
74
|
virtual bool isScanning() = 0;
|
|
74
75
|
virtual std::vector<BLEDevice> getConnectedDevices(const std::vector<std::string>& services) = 0;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// ManufacturerData.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
25
30
|
|
|
26
31
|
// Forward declaration of `ManufacturerDataEntry` to properly resolve imports.
|
|
27
32
|
namespace margelo::nitro::co::zyke::ble { struct ManufacturerDataEntry; }
|
|
@@ -34,13 +39,16 @@ namespace margelo::nitro::co::zyke::ble {
|
|
|
34
39
|
/**
|
|
35
40
|
* A struct which can be represented as a JavaScript object (ManufacturerData).
|
|
36
41
|
*/
|
|
37
|
-
struct ManufacturerData {
|
|
42
|
+
struct ManufacturerData final {
|
|
38
43
|
public:
|
|
39
44
|
std::vector<ManufacturerDataEntry> companyIdentifiers SWIFT_PRIVATE;
|
|
40
45
|
|
|
41
46
|
public:
|
|
42
47
|
ManufacturerData() = default;
|
|
43
48
|
explicit ManufacturerData(std::vector<ManufacturerDataEntry> companyIdentifiers): companyIdentifiers(companyIdentifiers) {}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
friend bool operator==(const ManufacturerData& lhs, const ManufacturerData& rhs) = default;
|
|
44
52
|
};
|
|
45
53
|
|
|
46
54
|
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -53,12 +61,12 @@ namespace margelo::nitro {
|
|
|
53
61
|
static inline margelo::nitro::co::zyke::ble::ManufacturerData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
62
|
jsi::Object obj = arg.asObject(runtime);
|
|
55
63
|
return margelo::nitro::co::zyke::ble::ManufacturerData(
|
|
56
|
-
JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::fromJSI(runtime, obj.getProperty(runtime, "companyIdentifiers"))
|
|
64
|
+
JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "companyIdentifiers")))
|
|
57
65
|
);
|
|
58
66
|
}
|
|
59
67
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::co::zyke::ble::ManufacturerData& arg) {
|
|
60
68
|
jsi::Object obj(runtime);
|
|
61
|
-
obj.setProperty(runtime, "companyIdentifiers", JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::toJSI(runtime, arg.companyIdentifiers));
|
|
69
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "companyIdentifiers"), JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::toJSI(runtime, arg.companyIdentifiers));
|
|
62
70
|
return obj;
|
|
63
71
|
}
|
|
64
72
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -69,7 +77,7 @@ namespace margelo::nitro {
|
|
|
69
77
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
70
78
|
return false;
|
|
71
79
|
}
|
|
72
|
-
if (!JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::canConvert(runtime, obj.getProperty(runtime, "companyIdentifiers"))) return false;
|
|
80
|
+
if (!JSIConverter<std::vector<margelo::nitro::co::zyke::ble::ManufacturerDataEntry>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "companyIdentifiers")))) return false;
|
|
73
81
|
return true;
|
|
74
82
|
}
|
|
75
83
|
};
|