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,192 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCharacteristicSpecSwift.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridCharacteristicSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridCharacteristicSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace BleNitro { class HybridCharacteristicSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `HybridCharacteristicSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::co::zyke::ble { class HybridCharacteristicSpec; }
|
|
17
|
+
// Forward declaration of `Subscription` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::co::zyke::ble { struct Subscription; }
|
|
19
|
+
// Forward declaration of `NativeBleError` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeBleError; }
|
|
21
|
+
// Forward declaration of `NativeCharacteristic` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeCharacteristic; }
|
|
23
|
+
// Forward declaration of `BleErrorCode` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleErrorCode; }
|
|
25
|
+
// Forward declaration of `BleATTErrorCode` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleATTErrorCode; }
|
|
27
|
+
// Forward declaration of `BleIOSErrorCode` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleIOSErrorCode; }
|
|
29
|
+
// Forward declaration of `BleAndroidErrorCode` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleAndroidErrorCode; }
|
|
31
|
+
// Forward declaration of `CharacteristicSubscriptionType` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::co::zyke::ble { enum class CharacteristicSubscriptionType; }
|
|
33
|
+
// Forward declaration of `NativeDescriptor` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeDescriptor; }
|
|
35
|
+
|
|
36
|
+
#include <string>
|
|
37
|
+
#include <optional>
|
|
38
|
+
#include <NitroModules/Promise.hpp>
|
|
39
|
+
#include <memory>
|
|
40
|
+
#include "HybridCharacteristicSpec.hpp"
|
|
41
|
+
#include "Subscription.hpp"
|
|
42
|
+
#include <functional>
|
|
43
|
+
#include "NativeBleError.hpp"
|
|
44
|
+
#include "NativeCharacteristic.hpp"
|
|
45
|
+
#include "BleErrorCode.hpp"
|
|
46
|
+
#include "BleATTErrorCode.hpp"
|
|
47
|
+
#include "BleIOSErrorCode.hpp"
|
|
48
|
+
#include "BleAndroidErrorCode.hpp"
|
|
49
|
+
#include "CharacteristicSubscriptionType.hpp"
|
|
50
|
+
#include <vector>
|
|
51
|
+
#include "NativeDescriptor.hpp"
|
|
52
|
+
|
|
53
|
+
#include "BleNitro-Swift-Cxx-Umbrella.hpp"
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The C++ part of HybridCharacteristicSpec_cxx.swift.
|
|
59
|
+
*
|
|
60
|
+
* HybridCharacteristicSpecSwift (C++) accesses HybridCharacteristicSpec_cxx (Swift), and might
|
|
61
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
62
|
+
*
|
|
63
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
64
|
+
* the future, HybridCharacteristicSpec_cxx can directly inherit from the C++ class HybridCharacteristicSpec
|
|
65
|
+
* to simplify the whole structure and memory management.
|
|
66
|
+
*/
|
|
67
|
+
class HybridCharacteristicSpecSwift: public virtual HybridCharacteristicSpec {
|
|
68
|
+
public:
|
|
69
|
+
// Constructor from a Swift instance
|
|
70
|
+
explicit HybridCharacteristicSpecSwift(const BleNitro::HybridCharacteristicSpec_cxx& swiftPart):
|
|
71
|
+
HybridObject(HybridCharacteristicSpec::TAG),
|
|
72
|
+
_swiftPart(swiftPart) { }
|
|
73
|
+
|
|
74
|
+
public:
|
|
75
|
+
// Get the Swift part
|
|
76
|
+
inline BleNitro::HybridCharacteristicSpec_cxx& getSwiftPart() noexcept {
|
|
77
|
+
return _swiftPart;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public:
|
|
81
|
+
// Get memory pressure
|
|
82
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
83
|
+
return _swiftPart.getMemorySize();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public:
|
|
87
|
+
// Properties
|
|
88
|
+
inline double getId() noexcept override {
|
|
89
|
+
return _swiftPart.getId();
|
|
90
|
+
}
|
|
91
|
+
inline std::string getUuid() noexcept override {
|
|
92
|
+
auto __result = _swiftPart.getUuid();
|
|
93
|
+
return __result;
|
|
94
|
+
}
|
|
95
|
+
inline double getServiceID() noexcept override {
|
|
96
|
+
return _swiftPart.getServiceID();
|
|
97
|
+
}
|
|
98
|
+
inline std::string getServiceUUID() noexcept override {
|
|
99
|
+
auto __result = _swiftPart.getServiceUUID();
|
|
100
|
+
return __result;
|
|
101
|
+
}
|
|
102
|
+
inline std::string getDeviceID() noexcept override {
|
|
103
|
+
auto __result = _swiftPart.getDeviceID();
|
|
104
|
+
return __result;
|
|
105
|
+
}
|
|
106
|
+
inline bool getIsReadable() noexcept override {
|
|
107
|
+
return _swiftPart.isReadable();
|
|
108
|
+
}
|
|
109
|
+
inline bool getIsWritableWithResponse() noexcept override {
|
|
110
|
+
return _swiftPart.isWritableWithResponse();
|
|
111
|
+
}
|
|
112
|
+
inline bool getIsWritableWithoutResponse() noexcept override {
|
|
113
|
+
return _swiftPart.isWritableWithoutResponse();
|
|
114
|
+
}
|
|
115
|
+
inline bool getIsNotifiable() noexcept override {
|
|
116
|
+
return _swiftPart.isNotifiable();
|
|
117
|
+
}
|
|
118
|
+
inline bool getIsNotifying() noexcept override {
|
|
119
|
+
return _swiftPart.isNotifying();
|
|
120
|
+
}
|
|
121
|
+
inline bool getIsIndicatable() noexcept override {
|
|
122
|
+
return _swiftPart.isIndicatable();
|
|
123
|
+
}
|
|
124
|
+
inline std::optional<std::string> getValue() noexcept override {
|
|
125
|
+
auto __result = _swiftPart.getValue();
|
|
126
|
+
return __result;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public:
|
|
130
|
+
// Methods
|
|
131
|
+
inline std::shared_ptr<Promise<std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec>>> read(const std::optional<std::string>& transactionId) override {
|
|
132
|
+
auto __result = _swiftPart.read(transactionId);
|
|
133
|
+
if (__result.hasError()) [[unlikely]] {
|
|
134
|
+
std::rethrow_exception(__result.error());
|
|
135
|
+
}
|
|
136
|
+
auto __value = std::move(__result.value());
|
|
137
|
+
return __value;
|
|
138
|
+
}
|
|
139
|
+
inline std::shared_ptr<Promise<std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec>>> writeWithResponse(const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
140
|
+
auto __result = _swiftPart.writeWithResponse(valueBase64, transactionId);
|
|
141
|
+
if (__result.hasError()) [[unlikely]] {
|
|
142
|
+
std::rethrow_exception(__result.error());
|
|
143
|
+
}
|
|
144
|
+
auto __value = std::move(__result.value());
|
|
145
|
+
return __value;
|
|
146
|
+
}
|
|
147
|
+
inline std::shared_ptr<Promise<std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec>>> writeWithoutResponse(const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
148
|
+
auto __result = _swiftPart.writeWithoutResponse(valueBase64, transactionId);
|
|
149
|
+
if (__result.hasError()) [[unlikely]] {
|
|
150
|
+
std::rethrow_exception(__result.error());
|
|
151
|
+
}
|
|
152
|
+
auto __value = std::move(__result.value());
|
|
153
|
+
return __value;
|
|
154
|
+
}
|
|
155
|
+
inline Subscription monitor(const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)>& listener, const std::optional<std::string>& transactionId, std::optional<CharacteristicSubscriptionType> subscriptionType) override {
|
|
156
|
+
auto __result = _swiftPart.monitor(listener, transactionId, subscriptionType);
|
|
157
|
+
if (__result.hasError()) [[unlikely]] {
|
|
158
|
+
std::rethrow_exception(__result.error());
|
|
159
|
+
}
|
|
160
|
+
auto __value = std::move(__result.value());
|
|
161
|
+
return __value;
|
|
162
|
+
}
|
|
163
|
+
inline std::shared_ptr<Promise<std::vector<NativeDescriptor>>> descriptors() override {
|
|
164
|
+
auto __result = _swiftPart.descriptors();
|
|
165
|
+
if (__result.hasError()) [[unlikely]] {
|
|
166
|
+
std::rethrow_exception(__result.error());
|
|
167
|
+
}
|
|
168
|
+
auto __value = std::move(__result.value());
|
|
169
|
+
return __value;
|
|
170
|
+
}
|
|
171
|
+
inline std::shared_ptr<Promise<NativeDescriptor>> readDescriptor(const std::string& descriptorUUID, const std::optional<std::string>& transactionId) override {
|
|
172
|
+
auto __result = _swiftPart.readDescriptor(descriptorUUID, transactionId);
|
|
173
|
+
if (__result.hasError()) [[unlikely]] {
|
|
174
|
+
std::rethrow_exception(__result.error());
|
|
175
|
+
}
|
|
176
|
+
auto __value = std::move(__result.value());
|
|
177
|
+
return __value;
|
|
178
|
+
}
|
|
179
|
+
inline std::shared_ptr<Promise<NativeDescriptor>> writeDescriptor(const std::string& descriptorUUID, const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
180
|
+
auto __result = _swiftPart.writeDescriptor(descriptorUUID, valueBase64, transactionId);
|
|
181
|
+
if (__result.hasError()) [[unlikely]] {
|
|
182
|
+
std::rethrow_exception(__result.error());
|
|
183
|
+
}
|
|
184
|
+
auto __value = std::move(__result.value());
|
|
185
|
+
return __value;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private:
|
|
189
|
+
BleNitro::HybridCharacteristicSpec_cxx _swiftPart;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDescriptorSpecSwift.cpp
|
|
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
|
+
#include "HybridDescriptorSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
11
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDescriptorSpecSwift.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridDescriptorSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridDescriptorSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace BleNitro { class HybridDescriptorSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `HybridDescriptorSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::co::zyke::ble { class HybridDescriptorSpec; }
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include <NitroModules/Promise.hpp>
|
|
21
|
+
#include <memory>
|
|
22
|
+
#include "HybridDescriptorSpec.hpp"
|
|
23
|
+
|
|
24
|
+
#include "BleNitro-Swift-Cxx-Umbrella.hpp"
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The C++ part of HybridDescriptorSpec_cxx.swift.
|
|
30
|
+
*
|
|
31
|
+
* HybridDescriptorSpecSwift (C++) accesses HybridDescriptorSpec_cxx (Swift), and might
|
|
32
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
33
|
+
*
|
|
34
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
35
|
+
* the future, HybridDescriptorSpec_cxx can directly inherit from the C++ class HybridDescriptorSpec
|
|
36
|
+
* to simplify the whole structure and memory management.
|
|
37
|
+
*/
|
|
38
|
+
class HybridDescriptorSpecSwift: public virtual HybridDescriptorSpec {
|
|
39
|
+
public:
|
|
40
|
+
// Constructor from a Swift instance
|
|
41
|
+
explicit HybridDescriptorSpecSwift(const BleNitro::HybridDescriptorSpec_cxx& swiftPart):
|
|
42
|
+
HybridObject(HybridDescriptorSpec::TAG),
|
|
43
|
+
_swiftPart(swiftPart) { }
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
// Get the Swift part
|
|
47
|
+
inline BleNitro::HybridDescriptorSpec_cxx& getSwiftPart() noexcept {
|
|
48
|
+
return _swiftPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Get memory pressure
|
|
53
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
54
|
+
return _swiftPart.getMemorySize();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
// Properties
|
|
59
|
+
inline double getId() noexcept override {
|
|
60
|
+
return _swiftPart.getId();
|
|
61
|
+
}
|
|
62
|
+
inline std::string getUuid() noexcept override {
|
|
63
|
+
auto __result = _swiftPart.getUuid();
|
|
64
|
+
return __result;
|
|
65
|
+
}
|
|
66
|
+
inline double getCharacteristicID() noexcept override {
|
|
67
|
+
return _swiftPart.getCharacteristicID();
|
|
68
|
+
}
|
|
69
|
+
inline std::string getCharacteristicUUID() noexcept override {
|
|
70
|
+
auto __result = _swiftPart.getCharacteristicUUID();
|
|
71
|
+
return __result;
|
|
72
|
+
}
|
|
73
|
+
inline double getServiceID() noexcept override {
|
|
74
|
+
return _swiftPart.getServiceID();
|
|
75
|
+
}
|
|
76
|
+
inline std::string getServiceUUID() noexcept override {
|
|
77
|
+
auto __result = _swiftPart.getServiceUUID();
|
|
78
|
+
return __result;
|
|
79
|
+
}
|
|
80
|
+
inline std::string getDeviceID() noexcept override {
|
|
81
|
+
auto __result = _swiftPart.getDeviceID();
|
|
82
|
+
return __result;
|
|
83
|
+
}
|
|
84
|
+
inline std::optional<std::string> getValue() noexcept override {
|
|
85
|
+
auto __result = _swiftPart.getValue();
|
|
86
|
+
return __result;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public:
|
|
90
|
+
// Methods
|
|
91
|
+
inline std::shared_ptr<Promise<std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpec>>> read(const std::optional<std::string>& transactionId) override {
|
|
92
|
+
auto __result = _swiftPart.read(transactionId);
|
|
93
|
+
if (__result.hasError()) [[unlikely]] {
|
|
94
|
+
std::rethrow_exception(__result.error());
|
|
95
|
+
}
|
|
96
|
+
auto __value = std::move(__result.value());
|
|
97
|
+
return __value;
|
|
98
|
+
}
|
|
99
|
+
inline std::shared_ptr<Promise<std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpec>>> write(const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
100
|
+
auto __result = _swiftPart.write(valueBase64, transactionId);
|
|
101
|
+
if (__result.hasError()) [[unlikely]] {
|
|
102
|
+
std::rethrow_exception(__result.error());
|
|
103
|
+
}
|
|
104
|
+
auto __value = std::move(__result.value());
|
|
105
|
+
return __value;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private:
|
|
109
|
+
BleNitro::HybridDescriptorSpec_cxx _swiftPart;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDeviceSpecSwift.cpp
|
|
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
|
+
#include "HybridDeviceSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
11
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDeviceSpecSwift.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridDeviceSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridDeviceSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace BleNitro { class HybridDeviceSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `ServiceDataEntry` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::co::zyke::ble { struct ServiceDataEntry; }
|
|
17
|
+
// Forward declaration of `NativeDevice` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeDevice; }
|
|
19
|
+
// Forward declaration of `ConnectionPriority` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::co::zyke::ble { enum class ConnectionPriority; }
|
|
21
|
+
// Forward declaration of `ConnectionOptions` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::co::zyke::ble { struct ConnectionOptions; }
|
|
23
|
+
// Forward declaration of `Subscription` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::co::zyke::ble { struct Subscription; }
|
|
25
|
+
// Forward declaration of `NativeBleError` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeBleError; }
|
|
27
|
+
// Forward declaration of `BleErrorCode` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleErrorCode; }
|
|
29
|
+
// Forward declaration of `BleATTErrorCode` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleATTErrorCode; }
|
|
31
|
+
// Forward declaration of `BleIOSErrorCode` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleIOSErrorCode; }
|
|
33
|
+
// Forward declaration of `BleAndroidErrorCode` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::co::zyke::ble { enum class BleAndroidErrorCode; }
|
|
35
|
+
// Forward declaration of `NativeService` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeService; }
|
|
37
|
+
// Forward declaration of `NativeCharacteristic` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeCharacteristic; }
|
|
39
|
+
// Forward declaration of `CharacteristicSubscriptionType` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::co::zyke::ble { enum class CharacteristicSubscriptionType; }
|
|
41
|
+
// Forward declaration of `NativeDescriptor` to properly resolve imports.
|
|
42
|
+
namespace margelo::nitro::co::zyke::ble { struct NativeDescriptor; }
|
|
43
|
+
|
|
44
|
+
#include <string>
|
|
45
|
+
#include <optional>
|
|
46
|
+
#include <vector>
|
|
47
|
+
#include "ServiceDataEntry.hpp"
|
|
48
|
+
#include <NitroModules/Promise.hpp>
|
|
49
|
+
#include "NativeDevice.hpp"
|
|
50
|
+
#include "ConnectionPriority.hpp"
|
|
51
|
+
#include "ConnectionOptions.hpp"
|
|
52
|
+
#include "Subscription.hpp"
|
|
53
|
+
#include <functional>
|
|
54
|
+
#include "NativeBleError.hpp"
|
|
55
|
+
#include "BleErrorCode.hpp"
|
|
56
|
+
#include "BleATTErrorCode.hpp"
|
|
57
|
+
#include "BleIOSErrorCode.hpp"
|
|
58
|
+
#include "BleAndroidErrorCode.hpp"
|
|
59
|
+
#include "NativeService.hpp"
|
|
60
|
+
#include "NativeCharacteristic.hpp"
|
|
61
|
+
#include "CharacteristicSubscriptionType.hpp"
|
|
62
|
+
#include "NativeDescriptor.hpp"
|
|
63
|
+
|
|
64
|
+
#include "BleNitro-Swift-Cxx-Umbrella.hpp"
|
|
65
|
+
|
|
66
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The C++ part of HybridDeviceSpec_cxx.swift.
|
|
70
|
+
*
|
|
71
|
+
* HybridDeviceSpecSwift (C++) accesses HybridDeviceSpec_cxx (Swift), and might
|
|
72
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
73
|
+
*
|
|
74
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
75
|
+
* the future, HybridDeviceSpec_cxx can directly inherit from the C++ class HybridDeviceSpec
|
|
76
|
+
* to simplify the whole structure and memory management.
|
|
77
|
+
*/
|
|
78
|
+
class HybridDeviceSpecSwift: public virtual HybridDeviceSpec {
|
|
79
|
+
public:
|
|
80
|
+
// Constructor from a Swift instance
|
|
81
|
+
explicit HybridDeviceSpecSwift(const BleNitro::HybridDeviceSpec_cxx& swiftPart):
|
|
82
|
+
HybridObject(HybridDeviceSpec::TAG),
|
|
83
|
+
_swiftPart(swiftPart) { }
|
|
84
|
+
|
|
85
|
+
public:
|
|
86
|
+
// Get the Swift part
|
|
87
|
+
inline BleNitro::HybridDeviceSpec_cxx& getSwiftPart() noexcept {
|
|
88
|
+
return _swiftPart;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public:
|
|
92
|
+
// Get memory pressure
|
|
93
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
94
|
+
return _swiftPart.getMemorySize();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public:
|
|
98
|
+
// Properties
|
|
99
|
+
inline std::string getId() noexcept override {
|
|
100
|
+
auto __result = _swiftPart.getId();
|
|
101
|
+
return __result;
|
|
102
|
+
}
|
|
103
|
+
inline std::optional<std::string> getDeviceName() noexcept override {
|
|
104
|
+
auto __result = _swiftPart.getDeviceName();
|
|
105
|
+
return __result;
|
|
106
|
+
}
|
|
107
|
+
inline std::optional<double> getRssi() noexcept override {
|
|
108
|
+
auto __result = _swiftPart.getRssi();
|
|
109
|
+
return __result;
|
|
110
|
+
}
|
|
111
|
+
inline double getMtu() noexcept override {
|
|
112
|
+
return _swiftPart.getMtu();
|
|
113
|
+
}
|
|
114
|
+
inline std::optional<std::string> getManufacturerData() noexcept override {
|
|
115
|
+
auto __result = _swiftPart.getManufacturerData();
|
|
116
|
+
return __result;
|
|
117
|
+
}
|
|
118
|
+
inline std::string getRawScanRecord() noexcept override {
|
|
119
|
+
auto __result = _swiftPart.getRawScanRecord();
|
|
120
|
+
return __result;
|
|
121
|
+
}
|
|
122
|
+
inline std::optional<std::vector<ServiceDataEntry>> getServiceData() noexcept override {
|
|
123
|
+
auto __result = _swiftPart.getServiceData();
|
|
124
|
+
return __result;
|
|
125
|
+
}
|
|
126
|
+
inline std::optional<std::vector<std::string>> getServiceUUIDs() noexcept override {
|
|
127
|
+
auto __result = _swiftPart.getServiceUUIDs();
|
|
128
|
+
return __result;
|
|
129
|
+
}
|
|
130
|
+
inline std::optional<std::string> getLocalName() noexcept override {
|
|
131
|
+
auto __result = _swiftPart.getLocalName();
|
|
132
|
+
return __result;
|
|
133
|
+
}
|
|
134
|
+
inline std::optional<double> getTxPowerLevel() noexcept override {
|
|
135
|
+
auto __result = _swiftPart.getTxPowerLevel();
|
|
136
|
+
return __result;
|
|
137
|
+
}
|
|
138
|
+
inline std::optional<std::vector<std::string>> getSolicitedServiceUUIDs() noexcept override {
|
|
139
|
+
auto __result = _swiftPart.getSolicitedServiceUUIDs();
|
|
140
|
+
return __result;
|
|
141
|
+
}
|
|
142
|
+
inline std::optional<bool> getIsConnectable() noexcept override {
|
|
143
|
+
auto __result = _swiftPart.getIsConnectable();
|
|
144
|
+
return __result;
|
|
145
|
+
}
|
|
146
|
+
inline std::optional<std::vector<std::string>> getOverflowServiceUUIDs() noexcept override {
|
|
147
|
+
auto __result = _swiftPart.getOverflowServiceUUIDs();
|
|
148
|
+
return __result;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
public:
|
|
152
|
+
// Methods
|
|
153
|
+
inline std::shared_ptr<Promise<NativeDevice>> requestConnectionPriority(ConnectionPriority connectionPriority, const std::optional<std::string>& transactionId) override {
|
|
154
|
+
auto __result = _swiftPart.requestConnectionPriority(static_cast<int>(connectionPriority), transactionId);
|
|
155
|
+
if (__result.hasError()) [[unlikely]] {
|
|
156
|
+
std::rethrow_exception(__result.error());
|
|
157
|
+
}
|
|
158
|
+
auto __value = std::move(__result.value());
|
|
159
|
+
return __value;
|
|
160
|
+
}
|
|
161
|
+
inline std::shared_ptr<Promise<NativeDevice>> readRSSI(const std::optional<std::string>& transactionId) override {
|
|
162
|
+
auto __result = _swiftPart.readRSSI(transactionId);
|
|
163
|
+
if (__result.hasError()) [[unlikely]] {
|
|
164
|
+
std::rethrow_exception(__result.error());
|
|
165
|
+
}
|
|
166
|
+
auto __value = std::move(__result.value());
|
|
167
|
+
return __value;
|
|
168
|
+
}
|
|
169
|
+
inline std::shared_ptr<Promise<NativeDevice>> requestMTU(double mtu, const std::optional<std::string>& transactionId) override {
|
|
170
|
+
auto __result = _swiftPart.requestMTU(std::forward<decltype(mtu)>(mtu), transactionId);
|
|
171
|
+
if (__result.hasError()) [[unlikely]] {
|
|
172
|
+
std::rethrow_exception(__result.error());
|
|
173
|
+
}
|
|
174
|
+
auto __value = std::move(__result.value());
|
|
175
|
+
return __value;
|
|
176
|
+
}
|
|
177
|
+
inline std::shared_ptr<Promise<NativeDevice>> connect(const std::optional<ConnectionOptions>& options) override {
|
|
178
|
+
auto __result = _swiftPart.connect(options);
|
|
179
|
+
if (__result.hasError()) [[unlikely]] {
|
|
180
|
+
std::rethrow_exception(__result.error());
|
|
181
|
+
}
|
|
182
|
+
auto __value = std::move(__result.value());
|
|
183
|
+
return __value;
|
|
184
|
+
}
|
|
185
|
+
inline std::shared_ptr<Promise<NativeDevice>> cancelConnection() override {
|
|
186
|
+
auto __result = _swiftPart.cancelConnection();
|
|
187
|
+
if (__result.hasError()) [[unlikely]] {
|
|
188
|
+
std::rethrow_exception(__result.error());
|
|
189
|
+
}
|
|
190
|
+
auto __value = std::move(__result.value());
|
|
191
|
+
return __value;
|
|
192
|
+
}
|
|
193
|
+
inline std::shared_ptr<Promise<bool>> isConnected() override {
|
|
194
|
+
auto __result = _swiftPart.isConnected();
|
|
195
|
+
if (__result.hasError()) [[unlikely]] {
|
|
196
|
+
std::rethrow_exception(__result.error());
|
|
197
|
+
}
|
|
198
|
+
auto __value = std::move(__result.value());
|
|
199
|
+
return __value;
|
|
200
|
+
}
|
|
201
|
+
inline Subscription onDisconnected(const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeDevice>& /* device */)>& listener) override {
|
|
202
|
+
auto __result = _swiftPart.onDisconnected(listener);
|
|
203
|
+
if (__result.hasError()) [[unlikely]] {
|
|
204
|
+
std::rethrow_exception(__result.error());
|
|
205
|
+
}
|
|
206
|
+
auto __value = std::move(__result.value());
|
|
207
|
+
return __value;
|
|
208
|
+
}
|
|
209
|
+
inline std::shared_ptr<Promise<NativeDevice>> discoverAllServicesAndCharacteristics(const std::optional<std::string>& transactionId) override {
|
|
210
|
+
auto __result = _swiftPart.discoverAllServicesAndCharacteristics(transactionId);
|
|
211
|
+
if (__result.hasError()) [[unlikely]] {
|
|
212
|
+
std::rethrow_exception(__result.error());
|
|
213
|
+
}
|
|
214
|
+
auto __value = std::move(__result.value());
|
|
215
|
+
return __value;
|
|
216
|
+
}
|
|
217
|
+
inline std::shared_ptr<Promise<std::vector<NativeService>>> services() override {
|
|
218
|
+
auto __result = _swiftPart.services();
|
|
219
|
+
if (__result.hasError()) [[unlikely]] {
|
|
220
|
+
std::rethrow_exception(__result.error());
|
|
221
|
+
}
|
|
222
|
+
auto __value = std::move(__result.value());
|
|
223
|
+
return __value;
|
|
224
|
+
}
|
|
225
|
+
inline std::shared_ptr<Promise<std::vector<NativeCharacteristic>>> characteristicsForService(const std::string& serviceUUID) override {
|
|
226
|
+
auto __result = _swiftPart.characteristicsForService(serviceUUID);
|
|
227
|
+
if (__result.hasError()) [[unlikely]] {
|
|
228
|
+
std::rethrow_exception(__result.error());
|
|
229
|
+
}
|
|
230
|
+
auto __value = std::move(__result.value());
|
|
231
|
+
return __value;
|
|
232
|
+
}
|
|
233
|
+
inline std::shared_ptr<Promise<NativeCharacteristic>> readCharacteristicForService(const std::string& serviceUUID, const std::string& characteristicUUID, const std::optional<std::string>& transactionId) override {
|
|
234
|
+
auto __result = _swiftPart.readCharacteristicForService(serviceUUID, characteristicUUID, transactionId);
|
|
235
|
+
if (__result.hasError()) [[unlikely]] {
|
|
236
|
+
std::rethrow_exception(__result.error());
|
|
237
|
+
}
|
|
238
|
+
auto __value = std::move(__result.value());
|
|
239
|
+
return __value;
|
|
240
|
+
}
|
|
241
|
+
inline std::shared_ptr<Promise<NativeCharacteristic>> writeCharacteristicWithResponseForService(const std::string& serviceUUID, const std::string& characteristicUUID, const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
242
|
+
auto __result = _swiftPart.writeCharacteristicWithResponseForService(serviceUUID, characteristicUUID, valueBase64, transactionId);
|
|
243
|
+
if (__result.hasError()) [[unlikely]] {
|
|
244
|
+
std::rethrow_exception(__result.error());
|
|
245
|
+
}
|
|
246
|
+
auto __value = std::move(__result.value());
|
|
247
|
+
return __value;
|
|
248
|
+
}
|
|
249
|
+
inline std::shared_ptr<Promise<NativeCharacteristic>> writeCharacteristicWithoutResponseForService(const std::string& serviceUUID, const std::string& characteristicUUID, const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
250
|
+
auto __result = _swiftPart.writeCharacteristicWithoutResponseForService(serviceUUID, characteristicUUID, valueBase64, transactionId);
|
|
251
|
+
if (__result.hasError()) [[unlikely]] {
|
|
252
|
+
std::rethrow_exception(__result.error());
|
|
253
|
+
}
|
|
254
|
+
auto __value = std::move(__result.value());
|
|
255
|
+
return __value;
|
|
256
|
+
}
|
|
257
|
+
inline Subscription monitorCharacteristicForService(const std::string& serviceUUID, const std::string& characteristicUUID, const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)>& listener, const std::optional<std::string>& transactionId, std::optional<CharacteristicSubscriptionType> subscriptionType) override {
|
|
258
|
+
auto __result = _swiftPart.monitorCharacteristicForService(serviceUUID, characteristicUUID, listener, transactionId, subscriptionType);
|
|
259
|
+
if (__result.hasError()) [[unlikely]] {
|
|
260
|
+
std::rethrow_exception(__result.error());
|
|
261
|
+
}
|
|
262
|
+
auto __value = std::move(__result.value());
|
|
263
|
+
return __value;
|
|
264
|
+
}
|
|
265
|
+
inline std::shared_ptr<Promise<std::vector<NativeDescriptor>>> descriptorsForService(const std::string& serviceUUID, const std::string& characteristicUUID) override {
|
|
266
|
+
auto __result = _swiftPart.descriptorsForService(serviceUUID, characteristicUUID);
|
|
267
|
+
if (__result.hasError()) [[unlikely]] {
|
|
268
|
+
std::rethrow_exception(__result.error());
|
|
269
|
+
}
|
|
270
|
+
auto __value = std::move(__result.value());
|
|
271
|
+
return __value;
|
|
272
|
+
}
|
|
273
|
+
inline std::shared_ptr<Promise<NativeDescriptor>> readDescriptorForService(const std::string& serviceUUID, const std::string& characteristicUUID, const std::string& descriptorUUID, const std::optional<std::string>& transactionId) override {
|
|
274
|
+
auto __result = _swiftPart.readDescriptorForService(serviceUUID, characteristicUUID, descriptorUUID, transactionId);
|
|
275
|
+
if (__result.hasError()) [[unlikely]] {
|
|
276
|
+
std::rethrow_exception(__result.error());
|
|
277
|
+
}
|
|
278
|
+
auto __value = std::move(__result.value());
|
|
279
|
+
return __value;
|
|
280
|
+
}
|
|
281
|
+
inline std::shared_ptr<Promise<NativeDescriptor>> writeDescriptorForService(const std::string& serviceUUID, const std::string& characteristicUUID, const std::string& descriptorUUID, const std::string& valueBase64, const std::optional<std::string>& transactionId) override {
|
|
282
|
+
auto __result = _swiftPart.writeDescriptorForService(serviceUUID, characteristicUUID, descriptorUUID, valueBase64, transactionId);
|
|
283
|
+
if (__result.hasError()) [[unlikely]] {
|
|
284
|
+
std::rethrow_exception(__result.error());
|
|
285
|
+
}
|
|
286
|
+
auto __value = std::move(__result.value());
|
|
287
|
+
return __value;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
private:
|
|
291
|
+
BleNitro::HybridDeviceSpec_cxx _swiftPart;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridServiceSpecSwift.cpp
|
|
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
|
+
#include "HybridServiceSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
11
|
+
} // namespace margelo::nitro::co::zyke::ble
|