react-native-ble-nitro 1.0.0-beta.0 → 1.0.0-beta.10
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/android/build.gradle +3 -0
- package/android/src/main/kotlin/{co → com/margelo/nitro/co}/zyke/ble/BleNitroBleManager.kt +111 -2
- package/app.plugin.cjs +1 -0
- package/ios/BleNitroBleManager.swift +66 -0
- package/ios/BleNitroModule.swift +2 -9
- package/lib/BleManagerCompatFactory.d.ts +5 -4
- package/lib/BleManagerCompatFactory.js +9 -6
- package/lib/BleManagerFactory.d.ts +21 -3
- package/lib/BleManagerFactory.js +53 -2
- package/lib/commonjs/BleManagerCompatFactory.d.ts +56 -0
- package/lib/commonjs/BleManagerCompatFactory.d.ts.map +1 -0
- package/lib/commonjs/BleManagerCompatFactory.js +201 -0
- package/lib/commonjs/BleManagerCompatFactory.js.map +1 -0
- package/lib/commonjs/BleManagerFactory.d.ts +31 -0
- package/lib/commonjs/BleManagerFactory.d.ts.map +1 -0
- package/lib/commonjs/BleManagerFactory.js +81 -0
- package/lib/commonjs/BleManagerFactory.js.map +1 -0
- package/lib/commonjs/compatibility/constants.d.ts +50 -0
- package/lib/commonjs/compatibility/constants.d.ts.map +1 -0
- package/lib/commonjs/compatibility/constants.js +58 -0
- package/lib/commonjs/compatibility/constants.js.map +1 -0
- package/lib/commonjs/compatibility/deviceWrapper.d.ts +100 -0
- package/lib/commonjs/compatibility/deviceWrapper.d.ts.map +1 -0
- package/lib/commonjs/compatibility/deviceWrapper.js +268 -0
- package/lib/commonjs/compatibility/deviceWrapper.js.map +1 -0
- package/lib/commonjs/compatibility/enums.d.ts +39 -0
- package/lib/commonjs/compatibility/enums.d.ts.map +1 -0
- package/lib/commonjs/compatibility/enums.js +179 -0
- package/lib/commonjs/compatibility/enums.js.map +1 -0
- package/lib/commonjs/compatibility/index.d.ts +13 -0
- package/lib/commonjs/compatibility/index.d.ts.map +1 -0
- package/lib/commonjs/compatibility/index.js +41 -0
- package/lib/commonjs/compatibility/index.js.map +1 -0
- package/lib/commonjs/compatibility/serviceData.d.ts +52 -0
- package/lib/commonjs/compatibility/serviceData.d.ts.map +1 -0
- package/lib/commonjs/compatibility/serviceData.js +80 -0
- package/lib/commonjs/compatibility/serviceData.js.map +1 -0
- package/lib/commonjs/errors/BleError.d.ts +60 -0
- package/lib/commonjs/errors/BleError.d.ts.map +1 -0
- package/lib/commonjs/errors/BleError.js +125 -0
- package/lib/commonjs/errors/BleError.js.map +1 -0
- package/lib/commonjs/index.d.ts +11 -0
- package/lib/commonjs/index.d.ts.map +1 -0
- package/lib/commonjs/index.js +42 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/specs/BleManager.nitro.d.ts +45 -0
- package/lib/commonjs/specs/BleManager.nitro.d.ts.map +1 -0
- package/lib/commonjs/specs/BleManager.nitro.js +3 -0
- package/lib/commonjs/specs/BleManager.nitro.js.map +1 -0
- package/lib/commonjs/specs/Characteristic.nitro.d.ts +27 -0
- package/lib/commonjs/specs/Characteristic.nitro.d.ts.map +1 -0
- package/lib/commonjs/specs/Characteristic.nitro.js +3 -0
- package/lib/commonjs/specs/Characteristic.nitro.js.map +1 -0
- package/lib/commonjs/specs/Descriptor.nitro.d.ts +18 -0
- package/lib/commonjs/specs/Descriptor.nitro.d.ts.map +1 -0
- package/lib/commonjs/specs/Descriptor.nitro.js +3 -0
- package/lib/commonjs/specs/Descriptor.nitro.js.map +1 -0
- package/lib/commonjs/specs/Device.nitro.d.ts +38 -0
- package/lib/commonjs/specs/Device.nitro.d.ts.map +1 -0
- package/lib/commonjs/specs/Device.nitro.js +3 -0
- package/lib/commonjs/specs/Device.nitro.js.map +1 -0
- package/lib/commonjs/specs/Service.nitro.d.ts +20 -0
- package/lib/commonjs/specs/Service.nitro.d.ts.map +1 -0
- package/lib/commonjs/specs/Service.nitro.js +3 -0
- package/lib/commonjs/specs/Service.nitro.js.map +1 -0
- package/lib/commonjs/specs/types.d.ts +229 -0
- package/lib/commonjs/specs/types.d.ts.map +1 -0
- package/lib/commonjs/specs/types.js +150 -0
- package/lib/commonjs/specs/types.js.map +1 -0
- package/lib/commonjs/utils/base64.d.ts +26 -0
- package/lib/commonjs/utils/base64.d.ts.map +1 -0
- package/lib/commonjs/utils/base64.js +88 -0
- package/lib/commonjs/utils/base64.js.map +1 -0
- package/lib/commonjs/utils/index.d.ts +3 -0
- package/lib/commonjs/utils/index.d.ts.map +1 -0
- package/lib/commonjs/utils/index.js +19 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/uuid.d.ts +10 -0
- package/lib/commonjs/utils/uuid.d.ts.map +1 -0
- package/lib/commonjs/utils/uuid.js +41 -0
- package/lib/commonjs/utils/uuid.js.map +1 -0
- package/lib/compatibility/constants.d.ts +1 -1
- package/lib/compatibility/constants.js +1 -1
- package/lib/compatibility/deviceWrapper.d.ts +2 -2
- package/lib/compatibility/deviceWrapper.js +2 -2
- package/lib/compatibility/enums.d.ts +1 -1
- package/lib/compatibility/enums.js +1 -1
- package/lib/compatibility/index.d.ts +5 -5
- package/lib/compatibility/index.js +4 -4
- package/lib/compatibility/serviceData.d.ts +1 -1
- package/lib/errors/BleError.d.ts +2 -2
- package/lib/errors/BleError.js +1 -1
- package/lib/index.d.ts +10 -9
- package/lib/index.js +9 -7
- package/lib/specs/BleManager.nitro.d.ts +9 -1
- package/lib/specs/Characteristic.nitro.d.ts +1 -1
- package/lib/specs/Descriptor.nitro.d.ts +1 -1
- package/lib/specs/Device.nitro.d.ts +1 -1
- package/lib/specs/Service.nitro.d.ts +1 -1
- package/nitro.json +6 -1
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/BleNitro+autolinking.cmake +86 -0
- package/nitrogen/generated/android/BleNitro+autolinking.gradle +27 -0
- package/nitrogen/generated/android/BleNitroOnLoad.cpp +62 -0
- package/nitrogen/generated/android/BleNitroOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JBleATTErrorCode.hpp +107 -0
- package/nitrogen/generated/android/c++/JBleAndroidErrorCode.hpp +101 -0
- package/nitrogen/generated/android/c++/JBleErrorCode.hpp +170 -0
- package/nitrogen/generated/android/c++/JBleIOSErrorCode.hpp +92 -0
- package/nitrogen/generated/android/c++/JBleManagerNitroOptions.hpp +54 -0
- package/nitrogen/generated/android/c++/JBleRestoredState.hpp +76 -0
- package/nitrogen/generated/android/c++/JCharacteristicSubscriptionType.hpp +59 -0
- package/nitrogen/generated/android/c++/JConnectionOptions.hpp +61 -0
- package/nitrogen/generated/android/c++/JConnectionPriority.hpp +62 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_State.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.hpp +88 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_.hpp +91 -0
- package/nitrogen/generated/android/c++/JHybridBleManagerSpec.cpp +653 -0
- package/nitrogen/generated/android/c++/JHybridBleManagerSpec.hpp +92 -0
- package/nitrogen/generated/android/c++/JHybridCharacteristicSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridCharacteristicSpec.hpp +79 -0
- package/nitrogen/generated/android/c++/JHybridDescriptorSpec.cpp +115 -0
- package/nitrogen/generated/android/c++/JHybridDescriptorSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JHybridDeviceSpec.cpp +476 -0
- package/nitrogen/generated/android/c++/JHybridDeviceSpec.hpp +90 -0
- package/nitrogen/generated/android/c++/JHybridServiceSpec.cpp +232 -0
- package/nitrogen/generated/android/c++/JHybridServiceSpec.hpp +72 -0
- package/nitrogen/generated/android/c++/JLogLevel.hpp +71 -0
- package/nitrogen/generated/android/c++/JNativeBleError.hpp +98 -0
- package/nitrogen/generated/android/c++/JNativeCharacteristic.hpp +98 -0
- package/nitrogen/generated/android/c++/JNativeDescriptor.hpp +82 -0
- package/nitrogen/generated/android/c++/JNativeDevice.hpp +173 -0
- package/nitrogen/generated/android/c++/JNativeService.hpp +65 -0
- package/nitrogen/generated/android/c++/JScanCallbackType.hpp +62 -0
- package/nitrogen/generated/android/c++/JScanMode.hpp +65 -0
- package/nitrogen/generated/android/c++/JScanOptions.hpp +69 -0
- package/nitrogen/generated/android/c++/JServiceDataEntry.hpp +57 -0
- package/nitrogen/generated/android/c++/JState.hpp +71 -0
- package/nitrogen/generated/android/c++/JSubscription.hpp +64 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleATTErrorCode.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleAndroidErrorCode.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleErrorCode.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleIOSErrorCode.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleManagerNitroOptions.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleNitroOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleRestoredState.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/CharacteristicSubscriptionType.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ConnectionOptions.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ConnectionPriority.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_State.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeDevice_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridBleManagerSpec.kt +192 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridCharacteristicSpec.kt +127 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridDescriptorSpec.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridDeviceSpec.kt +176 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridServiceSpec.kt +99 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/LogLevel.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeBleError.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeCharacteristic.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeDescriptor.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeDevice.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeService.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanCallbackType.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanMode.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanOptions.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ServiceDataEntry.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/State.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Subscription.kt +30 -0
- package/nitrogen/generated/ios/BleNitro+autolinking.rb +60 -0
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.cpp +236 -0
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp +1069 -0
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Umbrella.hpp +131 -0
- package/nitrogen/generated/ios/BleNitroAutolinking.mm +33 -0
- package/nitrogen/generated/ios/BleNitroAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridBleManagerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridBleManagerSpecSwift.hpp +377 -0
- package/nitrogen/generated/ios/c++/HybridCharacteristicSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCharacteristicSpecSwift.hpp +192 -0
- package/nitrogen/generated/ios/c++/HybridDescriptorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridDescriptorSpecSwift.hpp +112 -0
- package/nitrogen/generated/ios/c++/HybridDeviceSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridDeviceSpecSwift.hpp +294 -0
- package/nitrogen/generated/ios/c++/HybridServiceSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridServiceSpecSwift.hpp +170 -0
- package/nitrogen/generated/ios/swift/BleATTErrorCode.swift +104 -0
- package/nitrogen/generated/ios/swift/BleAndroidErrorCode.swift +96 -0
- package/nitrogen/generated/ios/swift/BleErrorCode.swift +188 -0
- package/nitrogen/generated/ios/swift/BleIOSErrorCode.swift +84 -0
- package/nitrogen/generated/ios/swift/BleManagerNitroOptions.swift +53 -0
- package/nitrogen/generated/ios/swift/BleRestoredState.swift +47 -0
- package/nitrogen/generated/ios/swift/CharacteristicSubscriptionType.swift +40 -0
- package/nitrogen/generated/ios/swift/ConnectionOptions.swift +57 -0
- package/nitrogen/generated/ios/swift/ConnectionPriority.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_LogLevel.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_NativeCharacteristic.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_NativeDescriptor.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_NativeDevice.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_State.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BleRestoredState_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.swift +58 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NativeBleError__std__optional_NativeDevice_.swift +58 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_.swift +50 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_.swift +50 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeCharacteristic_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeDescriptor_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeDevice_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeService_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridBleManagerSpec.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridBleManagerSpec_cxx.swift +852 -0
- package/nitrogen/generated/ios/swift/HybridCharacteristicSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridCharacteristicSpec_cxx.swift +384 -0
- package/nitrogen/generated/ios/swift/HybridDescriptorSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridDescriptorSpec_cxx.swift +218 -0
- package/nitrogen/generated/ios/swift/HybridDeviceSpec.swift +76 -0
- package/nitrogen/generated/ios/swift/HybridDeviceSpec_cxx.swift +702 -0
- package/nitrogen/generated/ios/swift/HybridServiceSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridServiceSpec_cxx.swift +338 -0
- package/nitrogen/generated/ios/swift/LogLevel.swift +56 -0
- package/nitrogen/generated/ios/swift/NativeBleError.swift +278 -0
- package/nitrogen/generated/ios/swift/NativeCharacteristic.swift +174 -0
- package/nitrogen/generated/ios/swift/NativeDescriptor.swift +130 -0
- package/nitrogen/generated/ios/swift/NativeDevice.swift +377 -0
- package/nitrogen/generated/ios/swift/NativeService.swift +68 -0
- package/nitrogen/generated/ios/swift/ScanCallbackType.swift +44 -0
- package/nitrogen/generated/ios/swift/ScanMode.swift +48 -0
- package/nitrogen/generated/ios/swift/ScanOptions.swift +116 -0
- package/nitrogen/generated/ios/swift/ServiceDataEntry.swift +46 -0
- package/nitrogen/generated/ios/swift/State.swift +56 -0
- package/nitrogen/generated/ios/swift/Subscription.swift +46 -0
- package/nitrogen/generated/shared/c++/BleATTErrorCode.hpp +80 -0
- package/nitrogen/generated/shared/c++/BleAndroidErrorCode.hpp +78 -0
- package/nitrogen/generated/shared/c++/BleErrorCode.hpp +101 -0
- package/nitrogen/generated/shared/c++/BleIOSErrorCode.hpp +75 -0
- package/nitrogen/generated/shared/c++/BleManagerNitroOptions.hpp +70 -0
- package/nitrogen/generated/shared/c++/BleRestoredState.hpp +71 -0
- package/nitrogen/generated/shared/c++/CharacteristicSubscriptionType.hpp +64 -0
- package/nitrogen/generated/shared/c++/ConnectionOptions.hpp +77 -0
- package/nitrogen/generated/shared/c++/ConnectionPriority.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridBleManagerSpec.cpp +51 -0
- package/nitrogen/generated/shared/c++/HybridBleManagerSpec.hpp +137 -0
- package/nitrogen/generated/shared/c++/HybridCharacteristicSpec.cpp +39 -0
- package/nitrogen/generated/shared/c++/HybridCharacteristicSpec.hpp +101 -0
- package/nitrogen/generated/shared/c++/HybridDescriptorSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridDescriptorSpec.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridDeviceSpec.cpp +50 -0
- package/nitrogen/generated/shared/c++/HybridDeviceSpec.hpp +123 -0
- package/nitrogen/generated/shared/c++/HybridServiceSpec.cpp +32 -0
- package/nitrogen/generated/shared/c++/HybridServiceSpec.hpp +90 -0
- package/nitrogen/generated/shared/c++/LogLevel.hpp +68 -0
- package/nitrogen/generated/shared/c++/NativeBleError.hpp +117 -0
- package/nitrogen/generated/shared/c++/NativeCharacteristic.hpp +114 -0
- package/nitrogen/generated/shared/c++/NativeDescriptor.hpp +98 -0
- package/nitrogen/generated/shared/c++/NativeDevice.hpp +121 -0
- package/nitrogen/generated/shared/c++/NativeService.hpp +81 -0
- package/nitrogen/generated/shared/c++/ScanCallbackType.hpp +65 -0
- package/nitrogen/generated/shared/c++/ScanMode.hpp +66 -0
- package/nitrogen/generated/shared/c++/ScanOptions.hpp +86 -0
- package/nitrogen/generated/shared/c++/ServiceDataEntry.hpp +73 -0
- package/nitrogen/generated/shared/c++/State.hpp +68 -0
- package/nitrogen/generated/shared/c++/Subscription.hpp +69 -0
- package/package.json +15 -14
- package/plugin/build/index.d.ts +1 -1
- package/plugin/build/index.js +42 -4
- package/plugin/build/withBleNitro.d.ts +1 -1
- package/plugin/build/withBleNitro.js +16 -11
- package/react-native.config.js +2 -7
- package/src/BleManagerCompatFactory.ts +10 -10
- package/src/BleManagerFactory.ts +68 -5
- package/src/__tests__/BleManager.test.ts +2 -2
- package/src/__tests__/compatibility/enums.test.ts +0 -1
- package/src/compatibility/constants.ts +1 -1
- package/src/compatibility/deviceWrapper.ts +4 -4
- package/src/compatibility/enums.ts +1 -1
- package/src/compatibility/index.ts +5 -5
- package/src/compatibility/serviceData.ts +1 -1
- package/src/errors/BleError.ts +2 -2
- package/src/index.ts +12 -9
- package/src/specs/BleManager.nitro.ts +17 -4
- package/src/specs/Characteristic.nitro.ts +1 -1
- package/src/specs/Descriptor.nitro.ts +1 -1
- package/src/specs/Device.nitro.ts +1 -1
- package/src/specs/Service.nitro.ts +1 -1
- package/android/src/main/kotlin/co/zyke/ble/BleNitroPackage.kt +0 -37
- package/ios/BleNitro.podspec +0 -37
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BleRestoredState.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `BleRestoredState`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias BleRestoredState = margelo.nitro.co.zyke.ble.BleRestoredState
|
|
14
|
+
|
|
15
|
+
public extension BleRestoredState {
|
|
16
|
+
private typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `BleRestoredState`.
|
|
20
|
+
*/
|
|
21
|
+
init(connectedPeripherals: [NativeDevice]) {
|
|
22
|
+
self.init({ () -> bridge.std__vector_NativeDevice_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_NativeDevice_(connectedPeripherals.count)
|
|
24
|
+
for __item in connectedPeripherals {
|
|
25
|
+
__vector.push_back(__item)
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}())
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var connectedPeripherals: [NativeDevice] {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return self.__connectedPeripherals.map({ __item in __item })
|
|
35
|
+
}
|
|
36
|
+
@inline(__always)
|
|
37
|
+
set {
|
|
38
|
+
self.__connectedPeripherals = { () -> bridge.std__vector_NativeDevice_ in
|
|
39
|
+
var __vector = bridge.create_std__vector_NativeDevice_(newValue.count)
|
|
40
|
+
for __item in newValue {
|
|
41
|
+
__vector.push_back(__item)
|
|
42
|
+
}
|
|
43
|
+
return __vector
|
|
44
|
+
}()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CharacteristicSubscriptionType.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS enum `CharacteristicSubscriptionType`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias CharacteristicSubscriptionType = margelo.nitro.co.zyke.ble.CharacteristicSubscriptionType
|
|
12
|
+
|
|
13
|
+
public extension CharacteristicSubscriptionType {
|
|
14
|
+
/**
|
|
15
|
+
* Get a CharacteristicSubscriptionType for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "Notification":
|
|
21
|
+
self = .notification
|
|
22
|
+
case "Indication":
|
|
23
|
+
self = .indication
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this CharacteristicSubscriptionType represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .notification:
|
|
35
|
+
return "Notification"
|
|
36
|
+
case .indication:
|
|
37
|
+
return "Indication"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ConnectionOptions.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `ConnectionOptions`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ConnectionOptions = margelo.nitro.co.zyke.ble.ConnectionOptions
|
|
14
|
+
|
|
15
|
+
public extension ConnectionOptions {
|
|
16
|
+
private typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ConnectionOptions`.
|
|
20
|
+
*/
|
|
21
|
+
init(autoConnect: Bool, requestMTU: Double, timeout: Double) {
|
|
22
|
+
self.init(autoConnect, requestMTU, timeout)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var autoConnect: Bool {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__autoConnect
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__autoConnect = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var requestMTU: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__requestMTU
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__requestMTU = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var timeout: Double {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return self.__timeout
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__timeout = newValue
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ConnectionPriority.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS enum `ConnectionPriority`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias ConnectionPriority = margelo.nitro.co.zyke.ble.ConnectionPriority
|
|
12
|
+
|
|
13
|
+
public extension ConnectionPriority {
|
|
14
|
+
/**
|
|
15
|
+
* Get a ConnectionPriority for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "Balanced":
|
|
21
|
+
self = .balanced
|
|
22
|
+
case "High":
|
|
23
|
+
self = .high
|
|
24
|
+
case "LowPower":
|
|
25
|
+
self = .lowpower
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this ConnectionPriority represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .balanced:
|
|
37
|
+
return "Balanced"
|
|
38
|
+
case .high:
|
|
39
|
+
return "High"
|
|
40
|
+
case .lowpower:
|
|
41
|
+
return "LowPower"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `() -> 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 {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: () -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping () -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call() -> Void {
|
|
25
|
+
self.closure()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
44
|
+
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_LogLevel.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: LogLevel) -> 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_LogLevel {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: LogLevel) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: LogLevel) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: Int32) -> Void {
|
|
25
|
+
self.closure(margelo.nitro.co.zyke.ble.LogLevel(rawValue: value)!)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_LogLevel`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_LogLevel>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_LogLevel {
|
|
44
|
+
return Unmanaged<Func_void_LogLevel>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_NativeCharacteristic.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: NativeCharacteristic) -> 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_NativeCharacteristic {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: NativeCharacteristic) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: NativeCharacteristic) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: NativeCharacteristic) -> Void {
|
|
25
|
+
self.closure(value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_NativeCharacteristic`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_NativeCharacteristic>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_NativeCharacteristic {
|
|
44
|
+
return Unmanaged<Func_void_NativeCharacteristic>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_NativeDescriptor.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: NativeDescriptor) -> 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_NativeDescriptor {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: NativeDescriptor) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: NativeDescriptor) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: NativeDescriptor) -> Void {
|
|
25
|
+
self.closure(value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_NativeDescriptor`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_NativeDescriptor>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_NativeDescriptor {
|
|
44
|
+
return Unmanaged<Func_void_NativeDescriptor>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_NativeDevice.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: NativeDevice) -> 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_NativeDevice {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: NativeDevice) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: NativeDevice) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: NativeDevice) -> Void {
|
|
25
|
+
self.closure(value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_NativeDevice`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_NativeDevice>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_NativeDevice {
|
|
44
|
+
return Unmanaged<Func_void_NativeDevice>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_State.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ newState: State) -> 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_State {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ newState: State) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ newState: State) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(newState: Int32) -> Void {
|
|
25
|
+
self.closure(margelo.nitro.co.zyke.ble.State(rawValue: newState)!)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_State`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_State>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_State {
|
|
44
|
+
return Unmanaged<Func_void_State>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_bool.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: Bool) -> 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_bool {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: Bool) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: Bool) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: Bool) -> Void {
|
|
25
|
+
self.closure(value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_bool`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_bool>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool {
|
|
44
|
+
return Unmanaged<Func_void_bool>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__exception_ptr.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ error: Error) -> 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__exception_ptr {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ error: Error) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ error: Error) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(error: std.exception_ptr) -> Void {
|
|
25
|
+
self.closure(RuntimeError.from(cppError: error))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
|
|
44
|
+
return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__optional_BleRestoredState_.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: BleRestoredState?) -> 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_BleRestoredState_ {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: BleRestoredState?) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: BleRestoredState?) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: bridge.std__optional_BleRestoredState_) -> Void {
|
|
25
|
+
self.closure({ () -> BleRestoredState? in
|
|
26
|
+
if let __unwrapped = value.value {
|
|
27
|
+
return __unwrapped
|
|
28
|
+
} else {
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}())
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
36
|
+
* This acquires one additional strong reference on the object!
|
|
37
|
+
*/
|
|
38
|
+
@inline(__always)
|
|
39
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
40
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Casts an unsafe pointer to a `Func_void_std__optional_BleRestoredState_`.
|
|
45
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_BleRestoredState_>`.
|
|
46
|
+
* This removes one strong reference from the object!
|
|
47
|
+
*/
|
|
48
|
+
@inline(__always)
|
|
49
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_BleRestoredState_ {
|
|
50
|
+
return Unmanaged<Func_void_std__optional_BleRestoredState_>.fromOpaque(pointer).takeRetainedValue()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ error: NativeBleError?, _ characteristic: NativeCharacteristic?) -> 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_NativeBleError__std__optional_NativeCharacteristic_ {
|
|
15
|
+
public typealias bridge = margelo.nitro.co.zyke.ble.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ error: NativeBleError?, _ characteristic: NativeCharacteristic?) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ error: NativeBleError?, _ characteristic: NativeCharacteristic?) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(error: bridge.std__optional_NativeBleError_, characteristic: bridge.std__optional_NativeCharacteristic_) -> Void {
|
|
25
|
+
self.closure({ () -> NativeBleError? in
|
|
26
|
+
if let __unwrapped = error.value {
|
|
27
|
+
return __unwrapped
|
|
28
|
+
} else {
|
|
29
|
+
return nil
|
|
30
|
+
}
|
|
31
|
+
}(), { () -> NativeCharacteristic? in
|
|
32
|
+
if let __unwrapped = characteristic.value {
|
|
33
|
+
return __unwrapped
|
|
34
|
+
} else {
|
|
35
|
+
return nil
|
|
36
|
+
}
|
|
37
|
+
}())
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
42
|
+
* This acquires one additional strong reference on the object!
|
|
43
|
+
*/
|
|
44
|
+
@inline(__always)
|
|
45
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
46
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Casts an unsafe pointer to a `Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_`.
|
|
51
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_>`.
|
|
52
|
+
* This removes one strong reference from the object!
|
|
53
|
+
*/
|
|
54
|
+
@inline(__always)
|
|
55
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_ {
|
|
56
|
+
return Unmanaged<Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_>.fromOpaque(pointer).takeRetainedValue()
|
|
57
|
+
}
|
|
58
|
+
}
|