react-native-ble-nitro 1.9.2 → 1.9.4
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 +2 -2
- package/ios/BleNitroBleManager.swift +2 -2
- package/lib/commonjs/manager.d.ts +1 -0
- package/lib/commonjs/manager.d.ts.map +1 -1
- package/lib/commonjs/manager.js +2 -0
- package/lib/commonjs/manager.js.map +1 -1
- package/lib/manager.d.ts +1 -0
- package/lib/manager.js +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 +27 -9
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.hpp +4 -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 +13 -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 +13 -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 +11 -5
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec_cxx.swift +48 -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 +1 -1
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.hpp +4 -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/src/manager.ts +2 -1
- 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,7 +2,7 @@
|
|
|
2
2
|
/// BLEDevice.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,86 +28,38 @@ public extension BLEDevice {
|
|
|
28
28
|
}(), isConnectable, isConnected)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
@inline(__always)
|
|
31
32
|
var id: String {
|
|
32
|
-
|
|
33
|
-
get {
|
|
34
|
-
return String(self.__id)
|
|
35
|
-
}
|
|
36
|
-
@inline(__always)
|
|
37
|
-
set {
|
|
38
|
-
self.__id = std.string(newValue)
|
|
39
|
-
}
|
|
33
|
+
return String(self.__id)
|
|
40
34
|
}
|
|
41
35
|
|
|
36
|
+
@inline(__always)
|
|
42
37
|
var name: String {
|
|
43
|
-
|
|
44
|
-
get {
|
|
45
|
-
return String(self.__name)
|
|
46
|
-
}
|
|
47
|
-
@inline(__always)
|
|
48
|
-
set {
|
|
49
|
-
self.__name = std.string(newValue)
|
|
50
|
-
}
|
|
38
|
+
return String(self.__name)
|
|
51
39
|
}
|
|
52
40
|
|
|
41
|
+
@inline(__always)
|
|
53
42
|
var rssi: Double {
|
|
54
|
-
|
|
55
|
-
get {
|
|
56
|
-
return self.__rssi
|
|
57
|
-
}
|
|
58
|
-
@inline(__always)
|
|
59
|
-
set {
|
|
60
|
-
self.__rssi = newValue
|
|
61
|
-
}
|
|
43
|
+
return self.__rssi
|
|
62
44
|
}
|
|
63
45
|
|
|
46
|
+
@inline(__always)
|
|
64
47
|
var manufacturerData: ManufacturerData {
|
|
65
|
-
|
|
66
|
-
get {
|
|
67
|
-
return self.__manufacturerData
|
|
68
|
-
}
|
|
69
|
-
@inline(__always)
|
|
70
|
-
set {
|
|
71
|
-
self.__manufacturerData = newValue
|
|
72
|
-
}
|
|
48
|
+
return self.__manufacturerData
|
|
73
49
|
}
|
|
74
50
|
|
|
51
|
+
@inline(__always)
|
|
75
52
|
var serviceUUIDs: [String] {
|
|
76
|
-
|
|
77
|
-
get {
|
|
78
|
-
return self.__serviceUUIDs.map({ __item in String(__item) })
|
|
79
|
-
}
|
|
80
|
-
@inline(__always)
|
|
81
|
-
set {
|
|
82
|
-
self.__serviceUUIDs = { () -> bridge.std__vector_std__string_ in
|
|
83
|
-
var __vector = bridge.create_std__vector_std__string_(newValue.count)
|
|
84
|
-
for __item in newValue {
|
|
85
|
-
__vector.push_back(std.string(__item))
|
|
86
|
-
}
|
|
87
|
-
return __vector
|
|
88
|
-
}()
|
|
89
|
-
}
|
|
53
|
+
return self.__serviceUUIDs.map({ __item in String(__item) })
|
|
90
54
|
}
|
|
91
55
|
|
|
56
|
+
@inline(__always)
|
|
92
57
|
var isConnectable: Bool {
|
|
93
|
-
|
|
94
|
-
get {
|
|
95
|
-
return self.__isConnectable
|
|
96
|
-
}
|
|
97
|
-
@inline(__always)
|
|
98
|
-
set {
|
|
99
|
-
self.__isConnectable = newValue
|
|
100
|
-
}
|
|
58
|
+
return self.__isConnectable
|
|
101
59
|
}
|
|
102
60
|
|
|
61
|
+
@inline(__always)
|
|
103
62
|
var isConnected: Bool {
|
|
104
|
-
|
|
105
|
-
get {
|
|
106
|
-
return self.__isConnected
|
|
107
|
-
}
|
|
108
|
-
@inline(__always)
|
|
109
|
-
set {
|
|
110
|
-
self.__isConnected = newValue
|
|
111
|
-
}
|
|
63
|
+
return self.__isConnected
|
|
112
64
|
}
|
|
113
65
|
}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `() -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_BLEState.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ state: BLEState) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_bool_double_std__string.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ success: Bool, _ rssi: Double, _ error: String) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
package/nitrogen/generated/ios/swift/Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.swift
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ success: Bool, _ data: ArrayBuffer, _ error: String) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_bool_std__string.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ success: Bool, _ error: String) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_bool_std__string_std__string.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ success: Bool, _ deviceId: String, _ error: String) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_std__exception_ptr.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ error: Error) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__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
|
+
* Wraps a Swift `(_ device: Variant_NullType_BLEDevice?, _ error: Variant_NullType_String?) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__ {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ device: Variant_NullType_BLEDevice?, _ error: Variant_NullType_String?) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ device: Variant_NullType_BLEDevice?, _ error: Variant_NullType_String?) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(device: bridge.std__optional_std__variant_nitro__NullType__BLEDevice__, error: bridge.std__optional_std__variant_nitro__NullType__std__string__) -> Void {
|
|
25
|
+
self.closure({ () -> Variant_NullType_BLEDevice? in
|
|
26
|
+
if bridge.has_value_std__optional_std__variant_nitro__NullType__BLEDevice__(device) {
|
|
27
|
+
let __unwrapped = bridge.get_std__optional_std__variant_nitro__NullType__BLEDevice__(device)
|
|
28
|
+
return { () -> Variant_NullType_BLEDevice in
|
|
29
|
+
let __variant = bridge.std__variant_nitro__NullType__BLEDevice_(__unwrapped)
|
|
30
|
+
switch __variant.index() {
|
|
31
|
+
case 0:
|
|
32
|
+
let __actual = __variant.get_0()
|
|
33
|
+
return .first(NullType.null)
|
|
34
|
+
case 1:
|
|
35
|
+
let __actual = __variant.get_1()
|
|
36
|
+
return .second(__actual)
|
|
37
|
+
default:
|
|
38
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
39
|
+
}
|
|
40
|
+
}()
|
|
41
|
+
} else {
|
|
42
|
+
return nil
|
|
43
|
+
}
|
|
44
|
+
}(), { () -> Variant_NullType_String? in
|
|
45
|
+
if bridge.has_value_std__optional_std__variant_nitro__NullType__std__string__(error) {
|
|
46
|
+
let __unwrapped = bridge.get_std__optional_std__variant_nitro__NullType__std__string__(error)
|
|
47
|
+
return { () -> Variant_NullType_String in
|
|
48
|
+
let __variant = bridge.std__variant_nitro__NullType__std__string_(__unwrapped)
|
|
49
|
+
switch __variant.index() {
|
|
50
|
+
case 0:
|
|
51
|
+
let __actual = __variant.get_0()
|
|
52
|
+
return .first(NullType.null)
|
|
53
|
+
case 1:
|
|
54
|
+
let __actual = __variant.get_1()
|
|
55
|
+
return .second(String(__actual))
|
|
56
|
+
default:
|
|
57
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
58
|
+
}
|
|
59
|
+
}()
|
|
60
|
+
} else {
|
|
61
|
+
return nil
|
|
62
|
+
}
|
|
63
|
+
}())
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
68
|
+
* This acquires one additional strong reference on the object!
|
|
69
|
+
*/
|
|
70
|
+
@inline(__always)
|
|
71
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
72
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Casts an unsafe pointer to a `Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__`.
|
|
77
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__>`.
|
|
78
|
+
* This removes one strong reference from the object!
|
|
79
|
+
*/
|
|
80
|
+
@inline(__always)
|
|
81
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__ {
|
|
82
|
+
return Unmanaged<Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__>.fromOpaque(pointer).takeRetainedValue()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_std__string_bool_std__string.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ deviceId: String, _ interrupted: Bool, _ error: String) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
package/nitrogen/generated/ios/swift/Func_void_std__string_std__shared_ptr_ArrayBuffer_.swift
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_std__string_std__shared_ptr_ArrayBuffer_.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ characteristicId: String, _ data: ArrayBuffer) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/// Func_void_std__vector_BLEDevice_.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
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Wraps a Swift `(_ peripherals: [BLEDevice]) -> Void` as a class.
|
|
13
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// HybridNativeBleNitroFactorySpec.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
|
/// See ``HybridNativeBleNitroFactorySpec``
|
|
@@ -17,20 +16,27 @@ public protocol HybridNativeBleNitroFactorySpec_protocol: HybridObject {
|
|
|
17
16
|
func create(nativeRestoreStateIdentifier: String?, restoreStateCallback: ((_ peripherals: [BLEDevice]) -> Void)?) throws -> (any HybridNativeBleNitroSpec)
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
public extension HybridNativeBleNitroFactorySpec_protocol {
|
|
20
|
+
/// Default implementation of ``HybridObject.toString``
|
|
21
|
+
func toString() -> String {
|
|
22
|
+
return "[HybridObject NativeBleNitroFactory]"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
/// See ``HybridNativeBleNitroFactorySpec``
|
|
21
27
|
open class HybridNativeBleNitroFactorySpec_base {
|
|
22
28
|
private weak var cxxWrapper: HybridNativeBleNitroFactorySpec_cxx? = nil
|
|
23
29
|
public init() { }
|
|
24
30
|
public func getCxxWrapper() -> HybridNativeBleNitroFactorySpec_cxx {
|
|
25
31
|
#if DEBUG
|
|
26
|
-
guard self is HybridNativeBleNitroFactorySpec else {
|
|
32
|
+
guard self is any HybridNativeBleNitroFactorySpec else {
|
|
27
33
|
fatalError("`self` is not a `HybridNativeBleNitroFactorySpec`! Did you accidentally inherit from `HybridNativeBleNitroFactorySpec_base` instead of `HybridNativeBleNitroFactorySpec`?")
|
|
28
34
|
}
|
|
29
35
|
#endif
|
|
30
36
|
if let cxxWrapper = self.cxxWrapper {
|
|
31
37
|
return cxxWrapper
|
|
32
38
|
} else {
|
|
33
|
-
let cxxWrapper = HybridNativeBleNitroFactorySpec_cxx(self as! HybridNativeBleNitroFactorySpec)
|
|
39
|
+
let cxxWrapper = HybridNativeBleNitroFactorySpec_cxx(self as! any HybridNativeBleNitroFactorySpec)
|
|
34
40
|
self.cxxWrapper = cxxWrapper
|
|
35
41
|
return cxxWrapper
|
|
36
42
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// HybridNativeBleNitroFactorySpec_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 HybridNativeBleNitroFactorySpec_cxx {
|
|
|
76
75
|
*/
|
|
77
76
|
public func getCxxPart() -> bridge.std__shared_ptr_HybridNativeBleNitroFactorySpec_ {
|
|
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_HybridNativeBleNitroFactorySpec_(self.toUnsafe())
|
|
@@ -96,6 +95,14 @@ open class HybridNativeBleNitroFactorySpec_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: HybridNativeBleNitroFactorySpec_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 HybridNativeBleNitroFactorySpec_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
|
|
|
110
125
|
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// HybridNativeBleNitroSpec.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
|
/// See ``HybridNativeBleNitroSpec``
|
|
@@ -15,7 +14,7 @@ public protocol HybridNativeBleNitroSpec_protocol: HybridObject {
|
|
|
15
14
|
|
|
16
15
|
// Methods
|
|
17
16
|
func setRestoreStateCallback(callback: @escaping (_ restoredPeripherals: [BLEDevice]) -> Void) throws -> Void
|
|
18
|
-
func startScan(filter: ScanFilter, callback: @escaping (_ device:
|
|
17
|
+
func startScan(filter: ScanFilter, callback: @escaping (_ device: Variant_NullType_BLEDevice?, _ error: Variant_NullType_String?) -> Void) throws -> Void
|
|
19
18
|
func stopScan() throws -> Bool
|
|
20
19
|
func isScanning() throws -> Bool
|
|
21
20
|
func getConnectedDevices(services: [String]) throws -> [BLEDevice]
|
|
@@ -38,20 +37,27 @@ public protocol HybridNativeBleNitroSpec_protocol: HybridObject {
|
|
|
38
37
|
func openSettings() throws -> Promise<Void>
|
|
39
38
|
}
|
|
40
39
|
|
|
40
|
+
public extension HybridNativeBleNitroSpec_protocol {
|
|
41
|
+
/// Default implementation of ``HybridObject.toString``
|
|
42
|
+
func toString() -> String {
|
|
43
|
+
return "[HybridObject NativeBleNitro]"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
/// See ``HybridNativeBleNitroSpec``
|
|
42
48
|
open class HybridNativeBleNitroSpec_base {
|
|
43
49
|
private weak var cxxWrapper: HybridNativeBleNitroSpec_cxx? = nil
|
|
44
50
|
public init() { }
|
|
45
51
|
public func getCxxWrapper() -> HybridNativeBleNitroSpec_cxx {
|
|
46
52
|
#if DEBUG
|
|
47
|
-
guard self is HybridNativeBleNitroSpec else {
|
|
53
|
+
guard self is any HybridNativeBleNitroSpec else {
|
|
48
54
|
fatalError("`self` is not a `HybridNativeBleNitroSpec`! Did you accidentally inherit from `HybridNativeBleNitroSpec_base` instead of `HybridNativeBleNitroSpec`?")
|
|
49
55
|
}
|
|
50
56
|
#endif
|
|
51
57
|
if let cxxWrapper = self.cxxWrapper {
|
|
52
58
|
return cxxWrapper
|
|
53
59
|
} else {
|
|
54
|
-
let cxxWrapper = HybridNativeBleNitroSpec_cxx(self as! HybridNativeBleNitroSpec)
|
|
60
|
+
let cxxWrapper = HybridNativeBleNitroSpec_cxx(self as! any HybridNativeBleNitroSpec)
|
|
55
61
|
self.cxxWrapper = cxxWrapper
|
|
56
62
|
return cxxWrapper
|
|
57
63
|
}
|
|
@@ -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,34 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
154
169
|
}
|
|
155
170
|
|
|
156
171
|
@inline(__always)
|
|
157
|
-
public final func startScan(filter: ScanFilter, callback: bridge.
|
|
172
|
+
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_ {
|
|
158
173
|
do {
|
|
159
|
-
try self.__implementation.startScan(filter: filter, callback: { () -> (
|
|
160
|
-
let __wrappedFunction = bridge.
|
|
161
|
-
return { (__device:
|
|
162
|
-
__wrappedFunction.call({ () -> bridge.
|
|
174
|
+
try self.__implementation.startScan(filter: filter, callback: { () -> (Variant_NullType_BLEDevice?, Variant_NullType_String?) -> Void in
|
|
175
|
+
let __wrappedFunction = bridge.wrap_Func_void_std__optional_std__variant_nitro__NullType__BLEDevice___std__optional_std__variant_nitro__NullType__std__string__(callback)
|
|
176
|
+
return { (__device: Variant_NullType_BLEDevice?, __error: Variant_NullType_String?) -> Void in
|
|
177
|
+
__wrappedFunction.call({ () -> bridge.std__optional_std__variant_nitro__NullType__BLEDevice__ in
|
|
163
178
|
if let __unwrappedValue = __device {
|
|
164
|
-
return bridge.
|
|
179
|
+
return bridge.create_std__optional_std__variant_nitro__NullType__BLEDevice__({ () -> bridge.std__variant_nitro__NullType__BLEDevice_ in
|
|
180
|
+
switch __unwrappedValue {
|
|
181
|
+
case .first(let __value):
|
|
182
|
+
return bridge.create_std__variant_nitro__NullType__BLEDevice_(margelo.nitro.NullType.null)
|
|
183
|
+
case .second(let __value):
|
|
184
|
+
return bridge.create_std__variant_nitro__NullType__BLEDevice_(__value)
|
|
185
|
+
}
|
|
186
|
+
}().variant)
|
|
165
187
|
} else {
|
|
166
188
|
return .init()
|
|
167
189
|
}
|
|
168
|
-
}(), { () -> bridge.
|
|
190
|
+
}(), { () -> bridge.std__optional_std__variant_nitro__NullType__std__string__ in
|
|
169
191
|
if let __unwrappedValue = __error {
|
|
170
|
-
return bridge.
|
|
192
|
+
return bridge.create_std__optional_std__variant_nitro__NullType__std__string__({ () -> bridge.std__variant_nitro__NullType__std__string_ in
|
|
193
|
+
switch __unwrappedValue {
|
|
194
|
+
case .first(let __value):
|
|
195
|
+
return bridge.create_std__variant_nitro__NullType__std__string_(margelo.nitro.NullType.null)
|
|
196
|
+
case .second(let __value):
|
|
197
|
+
return bridge.create_std__variant_nitro__NullType__std__string_(std.string(__value))
|
|
198
|
+
}
|
|
199
|
+
}().variant)
|
|
171
200
|
} else {
|
|
172
201
|
return .init()
|
|
173
202
|
}
|
|
@@ -243,7 +272,14 @@ open class HybridNativeBleNitroSpec_cxx {
|
|
|
243
272
|
} else {
|
|
244
273
|
return nil
|
|
245
274
|
}
|
|
246
|
-
}(), autoConnectAndroid:
|
|
275
|
+
}(), autoConnectAndroid: { () -> Bool? in
|
|
276
|
+
if bridge.has_value_std__optional_bool_(autoConnectAndroid) {
|
|
277
|
+
let __unwrapped = bridge.get_std__optional_bool_(autoConnectAndroid)
|
|
278
|
+
return __unwrapped
|
|
279
|
+
} else {
|
|
280
|
+
return nil
|
|
281
|
+
}
|
|
282
|
+
}())
|
|
247
283
|
return bridge.create_Result_void_()
|
|
248
284
|
} catch (let __error) {
|
|
249
285
|
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
|
}
|