munim-bluetooth 0.2.8 → 0.3.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/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts +24 -25
- package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts.map +1 -1
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/MunimBluetooth+autolinking.cmake +81 -0
- package/nitrogen/generated/android/MunimBluetooth+autolinking.gradle +27 -0
- package/nitrogen/generated/android/MunimBluetoothOnLoad.cpp +44 -0
- package/nitrogen/generated/android/MunimBluetoothOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JAdvertisingDataTypes.hpp +345 -0
- package/nitrogen/generated/android/c++/JAdvertisingOptions.hpp +93 -0
- package/nitrogen/generated/android/c++/JCharacteristicValue.hpp +65 -0
- package/nitrogen/generated/android/c++/JGATTCharacteristic.hpp +85 -0
- package/nitrogen/generated/android/c++/JGATTService.hpp +83 -0
- package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.cpp +307 -0
- package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.hpp +85 -0
- package/nitrogen/generated/android/c++/JScanMode.hpp +61 -0
- package/nitrogen/generated/android/c++/JScanOptions.hpp +87 -0
- package/nitrogen/generated/android/c++/JServiceDataEntry.hpp +61 -0
- package/nitrogen/generated/android/c++/JWriteType.hpp +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingDataTypes.kt +89 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingOptions.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/CharacteristicValue.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTCharacteristic.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTService.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/HybridMunimBluetoothSpec.kt +134 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MunimBluetoothOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ScanMode.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ScanOptions.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ServiceDataEntry.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/WriteType.kt +23 -0
- package/nitrogen/generated/ios/MunimBluetooth+autolinking.rb +60 -0
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.cpp +97 -0
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.hpp +583 -0
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Umbrella.hpp +74 -0
- package/nitrogen/generated/ios/MunimBluetoothAutolinking.mm +33 -0
- package/nitrogen/generated/ios/MunimBluetoothAutolinking.swift +44 -0
- package/nitrogen/generated/ios/c++/HybridMunimBluetoothSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMunimBluetoothSpecSwift.hpp +241 -0
- package/nitrogen/generated/ios/swift/AdvertisingDataTypes.swift +400 -0
- package/nitrogen/generated/ios/swift/AdvertisingOptions.swift +83 -0
- package/nitrogen/generated/ios/swift/CharacteristicValue.swift +40 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_AdvertisingDataTypes.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_CharacteristicValue.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_GATTService_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +47 -0
- package/nitrogen/generated/ios/swift/GATTCharacteristic.swift +59 -0
- package/nitrogen/generated/ios/swift/GATTService.swift +41 -0
- package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec_cxx.swift +431 -0
- package/nitrogen/generated/ios/swift/ScanMode.swift +44 -0
- package/nitrogen/generated/ios/swift/ScanOptions.swift +78 -0
- package/nitrogen/generated/ios/swift/ServiceDataEntry.swift +35 -0
- package/nitrogen/generated/ios/swift/WriteType.swift +40 -0
- package/nitrogen/generated/shared/c++/AdvertisingDataTypes.hpp +155 -0
- package/nitrogen/generated/shared/c++/AdvertisingOptions.hpp +99 -0
- package/nitrogen/generated/shared/c++/CharacteristicValue.hpp +91 -0
- package/nitrogen/generated/shared/c++/GATTCharacteristic.hpp +93 -0
- package/nitrogen/generated/shared/c++/GATTService.hpp +90 -0
- package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.hpp +101 -0
- package/nitrogen/generated/shared/c++/ScanMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/ScanOptions.hpp +95 -0
- package/nitrogen/generated/shared/c++/ServiceDataEntry.hpp +87 -0
- package/nitrogen/generated/shared/c++/WriteType.hpp +76 -0
- package/package.json +9 -9
- package/src/specs/munim-bluetooth.nitro.ts +34 -25
- package/lib/module/package.json +0 -1
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AdvertisingDataTypes.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `AdvertisingDataTypes`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias AdvertisingDataTypes = margelo.nitro.munimbluetooth.AdvertisingDataTypes
|
|
15
|
+
|
|
16
|
+
public extension AdvertisingDataTypes {
|
|
17
|
+
private typealias bridge = margelo.nitro.munimbluetooth.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `AdvertisingDataTypes`.
|
|
21
|
+
*/
|
|
22
|
+
init(flags: Double?, incompleteServiceUUIDs16: [String]?, completeServiceUUIDs16: [String]?, incompleteServiceUUIDs32: [String]?, completeServiceUUIDs32: [String]?, incompleteServiceUUIDs128: [String]?, completeServiceUUIDs128: [String]?, shortenedLocalName: String?, completeLocalName: String?, txPowerLevel: Double?, serviceSolicitationUUIDs16: [String]?, serviceSolicitationUUIDs128: [String]?, serviceData16: [ServiceDataEntry]?, serviceData32: [ServiceDataEntry]?, serviceData128: [ServiceDataEntry]?, appearance: Double?, serviceSolicitationUUIDs32: [String]?, manufacturerData: String?) {
|
|
23
|
+
self.init({ () -> bridge.std__optional_double_ in
|
|
24
|
+
if let __unwrappedValue = flags {
|
|
25
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
26
|
+
} else {
|
|
27
|
+
return .init()
|
|
28
|
+
}
|
|
29
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
30
|
+
if let __unwrappedValue = incompleteServiceUUIDs16 {
|
|
31
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
32
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
33
|
+
for __item in __unwrappedValue {
|
|
34
|
+
__vector.push_back(std.string(__item))
|
|
35
|
+
}
|
|
36
|
+
return __vector
|
|
37
|
+
}())
|
|
38
|
+
} else {
|
|
39
|
+
return .init()
|
|
40
|
+
}
|
|
41
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
42
|
+
if let __unwrappedValue = completeServiceUUIDs16 {
|
|
43
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
44
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
45
|
+
for __item in __unwrappedValue {
|
|
46
|
+
__vector.push_back(std.string(__item))
|
|
47
|
+
}
|
|
48
|
+
return __vector
|
|
49
|
+
}())
|
|
50
|
+
} else {
|
|
51
|
+
return .init()
|
|
52
|
+
}
|
|
53
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
54
|
+
if let __unwrappedValue = incompleteServiceUUIDs32 {
|
|
55
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
56
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
57
|
+
for __item in __unwrappedValue {
|
|
58
|
+
__vector.push_back(std.string(__item))
|
|
59
|
+
}
|
|
60
|
+
return __vector
|
|
61
|
+
}())
|
|
62
|
+
} else {
|
|
63
|
+
return .init()
|
|
64
|
+
}
|
|
65
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
66
|
+
if let __unwrappedValue = completeServiceUUIDs32 {
|
|
67
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
68
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
69
|
+
for __item in __unwrappedValue {
|
|
70
|
+
__vector.push_back(std.string(__item))
|
|
71
|
+
}
|
|
72
|
+
return __vector
|
|
73
|
+
}())
|
|
74
|
+
} else {
|
|
75
|
+
return .init()
|
|
76
|
+
}
|
|
77
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
78
|
+
if let __unwrappedValue = incompleteServiceUUIDs128 {
|
|
79
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
80
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
81
|
+
for __item in __unwrappedValue {
|
|
82
|
+
__vector.push_back(std.string(__item))
|
|
83
|
+
}
|
|
84
|
+
return __vector
|
|
85
|
+
}())
|
|
86
|
+
} else {
|
|
87
|
+
return .init()
|
|
88
|
+
}
|
|
89
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
90
|
+
if let __unwrappedValue = completeServiceUUIDs128 {
|
|
91
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
92
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
93
|
+
for __item in __unwrappedValue {
|
|
94
|
+
__vector.push_back(std.string(__item))
|
|
95
|
+
}
|
|
96
|
+
return __vector
|
|
97
|
+
}())
|
|
98
|
+
} else {
|
|
99
|
+
return .init()
|
|
100
|
+
}
|
|
101
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
102
|
+
if let __unwrappedValue = shortenedLocalName {
|
|
103
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
104
|
+
} else {
|
|
105
|
+
return .init()
|
|
106
|
+
}
|
|
107
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
108
|
+
if let __unwrappedValue = completeLocalName {
|
|
109
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
110
|
+
} else {
|
|
111
|
+
return .init()
|
|
112
|
+
}
|
|
113
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
114
|
+
if let __unwrappedValue = txPowerLevel {
|
|
115
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
116
|
+
} else {
|
|
117
|
+
return .init()
|
|
118
|
+
}
|
|
119
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
120
|
+
if let __unwrappedValue = serviceSolicitationUUIDs16 {
|
|
121
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
122
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
123
|
+
for __item in __unwrappedValue {
|
|
124
|
+
__vector.push_back(std.string(__item))
|
|
125
|
+
}
|
|
126
|
+
return __vector
|
|
127
|
+
}())
|
|
128
|
+
} else {
|
|
129
|
+
return .init()
|
|
130
|
+
}
|
|
131
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
132
|
+
if let __unwrappedValue = serviceSolicitationUUIDs128 {
|
|
133
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
134
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
135
|
+
for __item in __unwrappedValue {
|
|
136
|
+
__vector.push_back(std.string(__item))
|
|
137
|
+
}
|
|
138
|
+
return __vector
|
|
139
|
+
}())
|
|
140
|
+
} else {
|
|
141
|
+
return .init()
|
|
142
|
+
}
|
|
143
|
+
}(), { () -> bridge.std__optional_std__vector_ServiceDataEntry__ in
|
|
144
|
+
if let __unwrappedValue = serviceData16 {
|
|
145
|
+
return bridge.create_std__optional_std__vector_ServiceDataEntry__({ () -> bridge.std__vector_ServiceDataEntry_ in
|
|
146
|
+
var __vector = bridge.create_std__vector_ServiceDataEntry_(__unwrappedValue.count)
|
|
147
|
+
for __item in __unwrappedValue {
|
|
148
|
+
__vector.push_back(__item)
|
|
149
|
+
}
|
|
150
|
+
return __vector
|
|
151
|
+
}())
|
|
152
|
+
} else {
|
|
153
|
+
return .init()
|
|
154
|
+
}
|
|
155
|
+
}(), { () -> bridge.std__optional_std__vector_ServiceDataEntry__ in
|
|
156
|
+
if let __unwrappedValue = serviceData32 {
|
|
157
|
+
return bridge.create_std__optional_std__vector_ServiceDataEntry__({ () -> bridge.std__vector_ServiceDataEntry_ in
|
|
158
|
+
var __vector = bridge.create_std__vector_ServiceDataEntry_(__unwrappedValue.count)
|
|
159
|
+
for __item in __unwrappedValue {
|
|
160
|
+
__vector.push_back(__item)
|
|
161
|
+
}
|
|
162
|
+
return __vector
|
|
163
|
+
}())
|
|
164
|
+
} else {
|
|
165
|
+
return .init()
|
|
166
|
+
}
|
|
167
|
+
}(), { () -> bridge.std__optional_std__vector_ServiceDataEntry__ in
|
|
168
|
+
if let __unwrappedValue = serviceData128 {
|
|
169
|
+
return bridge.create_std__optional_std__vector_ServiceDataEntry__({ () -> bridge.std__vector_ServiceDataEntry_ in
|
|
170
|
+
var __vector = bridge.create_std__vector_ServiceDataEntry_(__unwrappedValue.count)
|
|
171
|
+
for __item in __unwrappedValue {
|
|
172
|
+
__vector.push_back(__item)
|
|
173
|
+
}
|
|
174
|
+
return __vector
|
|
175
|
+
}())
|
|
176
|
+
} else {
|
|
177
|
+
return .init()
|
|
178
|
+
}
|
|
179
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
180
|
+
if let __unwrappedValue = appearance {
|
|
181
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
182
|
+
} else {
|
|
183
|
+
return .init()
|
|
184
|
+
}
|
|
185
|
+
}(), { () -> bridge.std__optional_std__vector_std__string__ in
|
|
186
|
+
if let __unwrappedValue = serviceSolicitationUUIDs32 {
|
|
187
|
+
return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
|
|
188
|
+
var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
|
|
189
|
+
for __item in __unwrappedValue {
|
|
190
|
+
__vector.push_back(std.string(__item))
|
|
191
|
+
}
|
|
192
|
+
return __vector
|
|
193
|
+
}())
|
|
194
|
+
} else {
|
|
195
|
+
return .init()
|
|
196
|
+
}
|
|
197
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
198
|
+
if let __unwrappedValue = manufacturerData {
|
|
199
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
200
|
+
} else {
|
|
201
|
+
return .init()
|
|
202
|
+
}
|
|
203
|
+
}())
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@inline(__always)
|
|
207
|
+
var flags: Double? {
|
|
208
|
+
return self.__flags.value
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@inline(__always)
|
|
212
|
+
var incompleteServiceUUIDs16: [String]? {
|
|
213
|
+
return { () -> [String]? in
|
|
214
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs16) {
|
|
215
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs16)
|
|
216
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
217
|
+
} else {
|
|
218
|
+
return nil
|
|
219
|
+
}
|
|
220
|
+
}()
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@inline(__always)
|
|
224
|
+
var completeServiceUUIDs16: [String]? {
|
|
225
|
+
return { () -> [String]? in
|
|
226
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__completeServiceUUIDs16) {
|
|
227
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__completeServiceUUIDs16)
|
|
228
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
229
|
+
} else {
|
|
230
|
+
return nil
|
|
231
|
+
}
|
|
232
|
+
}()
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@inline(__always)
|
|
236
|
+
var incompleteServiceUUIDs32: [String]? {
|
|
237
|
+
return { () -> [String]? in
|
|
238
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs32) {
|
|
239
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs32)
|
|
240
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
241
|
+
} else {
|
|
242
|
+
return nil
|
|
243
|
+
}
|
|
244
|
+
}()
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@inline(__always)
|
|
248
|
+
var completeServiceUUIDs32: [String]? {
|
|
249
|
+
return { () -> [String]? in
|
|
250
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__completeServiceUUIDs32) {
|
|
251
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__completeServiceUUIDs32)
|
|
252
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
253
|
+
} else {
|
|
254
|
+
return nil
|
|
255
|
+
}
|
|
256
|
+
}()
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@inline(__always)
|
|
260
|
+
var incompleteServiceUUIDs128: [String]? {
|
|
261
|
+
return { () -> [String]? in
|
|
262
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs128) {
|
|
263
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs128)
|
|
264
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
265
|
+
} else {
|
|
266
|
+
return nil
|
|
267
|
+
}
|
|
268
|
+
}()
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@inline(__always)
|
|
272
|
+
var completeServiceUUIDs128: [String]? {
|
|
273
|
+
return { () -> [String]? in
|
|
274
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__completeServiceUUIDs128) {
|
|
275
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__completeServiceUUIDs128)
|
|
276
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
277
|
+
} else {
|
|
278
|
+
return nil
|
|
279
|
+
}
|
|
280
|
+
}()
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@inline(__always)
|
|
284
|
+
var shortenedLocalName: String? {
|
|
285
|
+
return { () -> String? in
|
|
286
|
+
if bridge.has_value_std__optional_std__string_(self.__shortenedLocalName) {
|
|
287
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__shortenedLocalName)
|
|
288
|
+
return String(__unwrapped)
|
|
289
|
+
} else {
|
|
290
|
+
return nil
|
|
291
|
+
}
|
|
292
|
+
}()
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@inline(__always)
|
|
296
|
+
var completeLocalName: String? {
|
|
297
|
+
return { () -> String? in
|
|
298
|
+
if bridge.has_value_std__optional_std__string_(self.__completeLocalName) {
|
|
299
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__completeLocalName)
|
|
300
|
+
return String(__unwrapped)
|
|
301
|
+
} else {
|
|
302
|
+
return nil
|
|
303
|
+
}
|
|
304
|
+
}()
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
@inline(__always)
|
|
308
|
+
var txPowerLevel: Double? {
|
|
309
|
+
return self.__txPowerLevel.value
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@inline(__always)
|
|
313
|
+
var serviceSolicitationUUIDs16: [String]? {
|
|
314
|
+
return { () -> [String]? in
|
|
315
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs16) {
|
|
316
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs16)
|
|
317
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
318
|
+
} else {
|
|
319
|
+
return nil
|
|
320
|
+
}
|
|
321
|
+
}()
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
@inline(__always)
|
|
325
|
+
var serviceSolicitationUUIDs128: [String]? {
|
|
326
|
+
return { () -> [String]? in
|
|
327
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs128) {
|
|
328
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs128)
|
|
329
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
330
|
+
} else {
|
|
331
|
+
return nil
|
|
332
|
+
}
|
|
333
|
+
}()
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@inline(__always)
|
|
337
|
+
var serviceData16: [ServiceDataEntry]? {
|
|
338
|
+
return { () -> [ServiceDataEntry]? in
|
|
339
|
+
if bridge.has_value_std__optional_std__vector_ServiceDataEntry__(self.__serviceData16) {
|
|
340
|
+
let __unwrapped = bridge.get_std__optional_std__vector_ServiceDataEntry__(self.__serviceData16)
|
|
341
|
+
return __unwrapped.map({ __item in __item })
|
|
342
|
+
} else {
|
|
343
|
+
return nil
|
|
344
|
+
}
|
|
345
|
+
}()
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@inline(__always)
|
|
349
|
+
var serviceData32: [ServiceDataEntry]? {
|
|
350
|
+
return { () -> [ServiceDataEntry]? in
|
|
351
|
+
if bridge.has_value_std__optional_std__vector_ServiceDataEntry__(self.__serviceData32) {
|
|
352
|
+
let __unwrapped = bridge.get_std__optional_std__vector_ServiceDataEntry__(self.__serviceData32)
|
|
353
|
+
return __unwrapped.map({ __item in __item })
|
|
354
|
+
} else {
|
|
355
|
+
return nil
|
|
356
|
+
}
|
|
357
|
+
}()
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@inline(__always)
|
|
361
|
+
var serviceData128: [ServiceDataEntry]? {
|
|
362
|
+
return { () -> [ServiceDataEntry]? in
|
|
363
|
+
if bridge.has_value_std__optional_std__vector_ServiceDataEntry__(self.__serviceData128) {
|
|
364
|
+
let __unwrapped = bridge.get_std__optional_std__vector_ServiceDataEntry__(self.__serviceData128)
|
|
365
|
+
return __unwrapped.map({ __item in __item })
|
|
366
|
+
} else {
|
|
367
|
+
return nil
|
|
368
|
+
}
|
|
369
|
+
}()
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
@inline(__always)
|
|
373
|
+
var appearance: Double? {
|
|
374
|
+
return self.__appearance.value
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
@inline(__always)
|
|
378
|
+
var serviceSolicitationUUIDs32: [String]? {
|
|
379
|
+
return { () -> [String]? in
|
|
380
|
+
if bridge.has_value_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs32) {
|
|
381
|
+
let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs32)
|
|
382
|
+
return __unwrapped.map({ __item in String(__item) })
|
|
383
|
+
} else {
|
|
384
|
+
return nil
|
|
385
|
+
}
|
|
386
|
+
}()
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@inline(__always)
|
|
390
|
+
var manufacturerData: String? {
|
|
391
|
+
return { () -> String? in
|
|
392
|
+
if bridge.has_value_std__optional_std__string_(self.__manufacturerData) {
|
|
393
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__manufacturerData)
|
|
394
|
+
return String(__unwrapped)
|
|
395
|
+
} else {
|
|
396
|
+
return nil
|
|
397
|
+
}
|
|
398
|
+
}()
|
|
399
|
+
}
|
|
400
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AdvertisingOptions.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `AdvertisingOptions`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias AdvertisingOptions = margelo.nitro.munimbluetooth.AdvertisingOptions
|
|
15
|
+
|
|
16
|
+
public extension AdvertisingOptions {
|
|
17
|
+
private typealias bridge = margelo.nitro.munimbluetooth.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `AdvertisingOptions`.
|
|
21
|
+
*/
|
|
22
|
+
init(serviceUUIDs: [String], localName: String?, manufacturerData: String?, advertisingData: AdvertisingDataTypes?) {
|
|
23
|
+
self.init({ () -> bridge.std__vector_std__string_ in
|
|
24
|
+
var __vector = bridge.create_std__vector_std__string_(serviceUUIDs.count)
|
|
25
|
+
for __item in serviceUUIDs {
|
|
26
|
+
__vector.push_back(std.string(__item))
|
|
27
|
+
}
|
|
28
|
+
return __vector
|
|
29
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
30
|
+
if let __unwrappedValue = localName {
|
|
31
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
32
|
+
} else {
|
|
33
|
+
return .init()
|
|
34
|
+
}
|
|
35
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
36
|
+
if let __unwrappedValue = manufacturerData {
|
|
37
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
38
|
+
} else {
|
|
39
|
+
return .init()
|
|
40
|
+
}
|
|
41
|
+
}(), { () -> bridge.std__optional_AdvertisingDataTypes_ in
|
|
42
|
+
if let __unwrappedValue = advertisingData {
|
|
43
|
+
return bridge.create_std__optional_AdvertisingDataTypes_(__unwrappedValue)
|
|
44
|
+
} else {
|
|
45
|
+
return .init()
|
|
46
|
+
}
|
|
47
|
+
}())
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@inline(__always)
|
|
51
|
+
var serviceUUIDs: [String] {
|
|
52
|
+
return self.__serviceUUIDs.map({ __item in String(__item) })
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@inline(__always)
|
|
56
|
+
var localName: String? {
|
|
57
|
+
return { () -> String? in
|
|
58
|
+
if bridge.has_value_std__optional_std__string_(self.__localName) {
|
|
59
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__localName)
|
|
60
|
+
return String(__unwrapped)
|
|
61
|
+
} else {
|
|
62
|
+
return nil
|
|
63
|
+
}
|
|
64
|
+
}()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@inline(__always)
|
|
68
|
+
var manufacturerData: String? {
|
|
69
|
+
return { () -> String? in
|
|
70
|
+
if bridge.has_value_std__optional_std__string_(self.__manufacturerData) {
|
|
71
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__manufacturerData)
|
|
72
|
+
return String(__unwrapped)
|
|
73
|
+
} else {
|
|
74
|
+
return nil
|
|
75
|
+
}
|
|
76
|
+
}()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@inline(__always)
|
|
80
|
+
var advertisingData: AdvertisingDataTypes? {
|
|
81
|
+
return self.__advertisingData.value
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CharacteristicValue.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `CharacteristicValue`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias CharacteristicValue = margelo.nitro.munimbluetooth.CharacteristicValue
|
|
15
|
+
|
|
16
|
+
public extension CharacteristicValue {
|
|
17
|
+
private typealias bridge = margelo.nitro.munimbluetooth.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `CharacteristicValue`.
|
|
21
|
+
*/
|
|
22
|
+
init(value: String, serviceUUID: String, characteristicUUID: String) {
|
|
23
|
+
self.init(std.string(value), std.string(serviceUUID), std.string(characteristicUUID))
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@inline(__always)
|
|
27
|
+
var value: String {
|
|
28
|
+
return String(self.__value)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@inline(__always)
|
|
32
|
+
var serviceUUID: String {
|
|
33
|
+
return String(self.__serviceUUID)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@inline(__always)
|
|
37
|
+
var characteristicUUID: String {
|
|
38
|
+
return String(self.__characteristicUUID)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `() -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimbluetooth.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: () -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping () -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call() -> Void {
|
|
26
|
+
self.closure()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
45
|
+
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_AdvertisingDataTypes.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: AdvertisingDataTypes) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_AdvertisingDataTypes {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimbluetooth.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: AdvertisingDataTypes) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: AdvertisingDataTypes) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: AdvertisingDataTypes) -> Void {
|
|
26
|
+
self.closure(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_AdvertisingDataTypes`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_AdvertisingDataTypes>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_AdvertisingDataTypes {
|
|
45
|
+
return Unmanaged<Func_void_AdvertisingDataTypes>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_CharacteristicValue.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ value: CharacteristicValue) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_CharacteristicValue {
|
|
16
|
+
public typealias bridge = margelo.nitro.munimbluetooth.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ value: CharacteristicValue) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ value: CharacteristicValue) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(value: CharacteristicValue) -> Void {
|
|
26
|
+
self.closure(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_CharacteristicValue`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_CharacteristicValue>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_CharacteristicValue {
|
|
45
|
+
return Unmanaged<Func_void_CharacteristicValue>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|