react-native-ble-nitro 1.0.0-beta.5 → 1.0.0-beta.7
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/src/main/kotlin/co/zyke/ble/BleNitroBleManager.kt +1 -1
- package/android/src/main/kotlin/co/zyke/ble/BleNitroPackage.kt +4 -4
- package/ios/BleNitro.podspec +1 -1
- package/ios/BleNitroModule.swift +11 -9
- package/lib/BleManagerCompatFactory.d.ts +3 -3
- package/lib/BleManagerCompatFactory.js +3 -3
- package/lib/BleManagerFactory.d.ts +2 -2
- package/lib/commonjs/BleManagerCompatFactory.d.ts +3 -3
- package/lib/commonjs/BleManagerCompatFactory.d.ts.map +1 -1
- package/lib/commonjs/BleManagerCompatFactory.js +20 -20
- package/lib/commonjs/BleManagerCompatFactory.js.map +1 -1
- package/lib/commonjs/BleManagerFactory.d.ts +2 -2
- package/lib/commonjs/BleManagerFactory.d.ts.map +1 -1
- package/lib/commonjs/compatibility/constants.d.ts +1 -1
- package/lib/commonjs/compatibility/constants.d.ts.map +1 -1
- package/lib/commonjs/compatibility/constants.js +5 -5
- package/lib/commonjs/compatibility/constants.js.map +1 -1
- package/lib/commonjs/compatibility/deviceWrapper.d.ts +2 -2
- package/lib/commonjs/compatibility/deviceWrapper.d.ts.map +1 -1
- package/lib/commonjs/compatibility/deviceWrapper.js +4 -4
- package/lib/commonjs/compatibility/deviceWrapper.js.map +1 -1
- package/lib/commonjs/compatibility/enums.d.ts +1 -1
- package/lib/commonjs/compatibility/enums.d.ts.map +1 -1
- package/lib/commonjs/compatibility/enums.js +34 -34
- package/lib/commonjs/compatibility/enums.js.map +1 -1
- package/lib/commonjs/compatibility/index.d.ts +5 -5
- package/lib/commonjs/compatibility/index.d.ts.map +1 -1
- package/lib/commonjs/compatibility/index.js +15 -15
- package/lib/commonjs/compatibility/index.js.map +1 -1
- package/lib/commonjs/compatibility/serviceData.d.ts +1 -1
- package/lib/commonjs/compatibility/serviceData.d.ts.map +1 -1
- package/lib/commonjs/errors/BleError.d.ts +2 -2
- package/lib/commonjs/errors/BleError.d.ts.map +1 -1
- package/lib/commonjs/errors/BleError.js +41 -41
- package/lib/commonjs/errors/BleError.js.map +1 -1
- package/lib/commonjs/index.d.ts +10 -10
- package/lib/commonjs/index.d.ts.map +1 -1
- package/lib/commonjs/index.js +16 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/BleManager.nitro.d.ts +1 -1
- package/lib/commonjs/specs/BleManager.nitro.d.ts.map +1 -1
- package/lib/commonjs/specs/Characteristic.nitro.d.ts +1 -1
- package/lib/commonjs/specs/Characteristic.nitro.d.ts.map +1 -1
- package/lib/commonjs/specs/Descriptor.nitro.d.ts +1 -1
- package/lib/commonjs/specs/Descriptor.nitro.d.ts.map +1 -1
- package/lib/commonjs/specs/Device.nitro.d.ts +1 -1
- package/lib/commonjs/specs/Device.nitro.d.ts.map +1 -1
- package/lib/commonjs/specs/Service.nitro.d.ts +1 -1
- package/lib/commonjs/specs/Service.nitro.d.ts.map +1 -1
- package/lib/commonjs/utils/base64.d.ts +1 -1
- package/lib/commonjs/utils/base64.d.ts.map +1 -1
- package/lib/commonjs/utils/index.d.ts +2 -2
- package/lib/commonjs/utils/index.d.ts.map +1 -1
- package/lib/commonjs/utils/index.js +2 -2
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/uuid.d.ts +1 -1
- package/lib/commonjs/utils/uuid.d.ts.map +1 -1
- 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 -10
- package/lib/index.js +8 -8
- package/lib/specs/BleManager.nitro.d.ts +1 -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/lib/utils/base64.d.ts +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +2 -2
- package/lib/utils/uuid.d.ts +1 -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 +52 -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/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 +7 -6
- package/plugin/build/index.d.ts +1 -1
- package/plugin/build/index.js +5 -5
- package/src/BleManagerCompatFactory.ts +6 -6
- package/src/BleManagerFactory.ts +2 -2
- package/src/__tests__/BleManager.test.ts +2 -2
- 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 +10 -10
- package/src/specs/BleManager.nitro.ts +1 -1
- 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/src/utils/base64.ts +1 -1
- package/src/utils/index.ts +2 -2
- package/src/utils/uuid.ts +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JConnectionPriority.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 <fbjni/fbjni.h>
|
|
11
|
+
#include "ConnectionPriority.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ConnectionPriority" and the the Kotlin enum "ConnectionPriority".
|
|
19
|
+
*/
|
|
20
|
+
struct JConnectionPriority final: public jni::JavaClass<JConnectionPriority> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/ConnectionPriority;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum ConnectionPriority.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
ConnectionPriority toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("_ordinal");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<ConnectionPriority>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JConnectionPriority> fromCpp(ConnectionPriority value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
static const auto fieldBALANCED = clazz->getStaticField<JConnectionPriority>("BALANCED");
|
|
45
|
+
static const auto fieldHIGH = clazz->getStaticField<JConnectionPriority>("HIGH");
|
|
46
|
+
static const auto fieldLOWPOWER = clazz->getStaticField<JConnectionPriority>("LOWPOWER");
|
|
47
|
+
|
|
48
|
+
switch (value) {
|
|
49
|
+
case ConnectionPriority::BALANCED:
|
|
50
|
+
return clazz->getStaticFieldValue(fieldBALANCED);
|
|
51
|
+
case ConnectionPriority::HIGH:
|
|
52
|
+
return clazz->getStaticFieldValue(fieldHIGH);
|
|
53
|
+
case ConnectionPriority::LOWPOWER:
|
|
54
|
+
return clazz->getStaticFieldValue(fieldLOWPOWER);
|
|
55
|
+
default:
|
|
56
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
57
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Represents the Java/Kotlin callback `() -> Unit`.
|
|
21
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
22
|
+
*/
|
|
23
|
+
struct JFunc_void: public jni::JavaClass<JFunc_void> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Invokes the function this `JFunc_void` instance holds through JNI.
|
|
30
|
+
*/
|
|
31
|
+
void invoke() const {
|
|
32
|
+
static const auto method = javaClassStatic()->getMethod<void()>("invoke");
|
|
33
|
+
method(self());
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An implementation of Func_void that is backed by a C++ implementation (using `std::function<...>`)
|
|
39
|
+
*/
|
|
40
|
+
struct JFunc_void_cxx final: public jni::HybridClass<JFunc_void_cxx, JFunc_void> {
|
|
41
|
+
public:
|
|
42
|
+
static jni::local_ref<JFunc_void::javaobject> fromCpp(const std::function<void()>& func) {
|
|
43
|
+
return JFunc_void_cxx::newObjectCxxArgs(func);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
/**
|
|
48
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_cxx` instance holds.
|
|
49
|
+
*/
|
|
50
|
+
void invoke_cxx() {
|
|
51
|
+
_func();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
[[nodiscard]]
|
|
56
|
+
inline const std::function<void()>& getFunction() const {
|
|
57
|
+
return _func;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_cxx;";
|
|
62
|
+
static void registerNatives() {
|
|
63
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_cxx::invoke_cxx)});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
explicit JFunc_void_cxx(const std::function<void()>& func): _func(func) { }
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
friend HybridBase;
|
|
71
|
+
std::function<void()> _func;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_State.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
#include "State.hpp"
|
|
15
|
+
#include "JState.hpp"
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Represents the Java/Kotlin callback `(newState: State) -> Unit`.
|
|
23
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
24
|
+
*/
|
|
25
|
+
struct JFunc_void_State: public jni::JavaClass<JFunc_void_State> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_State;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Invokes the function this `JFunc_void_State` instance holds through JNI.
|
|
32
|
+
*/
|
|
33
|
+
void invoke(State newState) const {
|
|
34
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JState> /* newState */)>("invoke");
|
|
35
|
+
method(self(), JState::fromCpp(newState));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* An implementation of Func_void_State that is backed by a C++ implementation (using `std::function<...>`)
|
|
41
|
+
*/
|
|
42
|
+
struct JFunc_void_State_cxx final: public jni::HybridClass<JFunc_void_State_cxx, JFunc_void_State> {
|
|
43
|
+
public:
|
|
44
|
+
static jni::local_ref<JFunc_void_State::javaobject> fromCpp(const std::function<void(State /* newState */)>& func) {
|
|
45
|
+
return JFunc_void_State_cxx::newObjectCxxArgs(func);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
/**
|
|
50
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_State_cxx` instance holds.
|
|
51
|
+
*/
|
|
52
|
+
void invoke_cxx(jni::alias_ref<JState> newState) {
|
|
53
|
+
_func(newState->toCpp());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
[[nodiscard]]
|
|
58
|
+
inline const std::function<void(State /* newState */)>& getFunction() const {
|
|
59
|
+
return _func;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_State_cxx;";
|
|
64
|
+
static void registerNatives() {
|
|
65
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_State_cxx::invoke_cxx)});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
explicit JFunc_void_State_cxx(const std::function<void(State /* newState */)>& func): _func(func) { }
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
friend HybridBase;
|
|
73
|
+
std::function<void(State /* newState */)> _func;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
#include <optional>
|
|
15
|
+
#include "NativeBleError.hpp"
|
|
16
|
+
#include "NativeCharacteristic.hpp"
|
|
17
|
+
#include "JNativeBleError.hpp"
|
|
18
|
+
#include "BleErrorCode.hpp"
|
|
19
|
+
#include "JBleErrorCode.hpp"
|
|
20
|
+
#include "BleATTErrorCode.hpp"
|
|
21
|
+
#include "JBleATTErrorCode.hpp"
|
|
22
|
+
#include "BleIOSErrorCode.hpp"
|
|
23
|
+
#include "JBleIOSErrorCode.hpp"
|
|
24
|
+
#include "BleAndroidErrorCode.hpp"
|
|
25
|
+
#include "JBleAndroidErrorCode.hpp"
|
|
26
|
+
#include <string>
|
|
27
|
+
#include "JNativeCharacteristic.hpp"
|
|
28
|
+
|
|
29
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
30
|
+
|
|
31
|
+
using namespace facebook;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Represents the Java/Kotlin callback `(error: NativeBleError?, characteristic: NativeCharacteristic?) -> Unit`.
|
|
35
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
36
|
+
*/
|
|
37
|
+
struct JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_: public jni::JavaClass<JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_> {
|
|
38
|
+
public:
|
|
39
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_;";
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
/**
|
|
43
|
+
* Invokes the function this `JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_` instance holds through JNI.
|
|
44
|
+
*/
|
|
45
|
+
void invoke(const std::optional<NativeBleError>& error, const std::optional<NativeCharacteristic>& characteristic) const {
|
|
46
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JNativeBleError> /* error */, jni::alias_ref<JNativeCharacteristic> /* characteristic */)>("invoke");
|
|
47
|
+
method(self(), error.has_value() ? JNativeBleError::fromCpp(error.value()) : nullptr, characteristic.has_value() ? JNativeCharacteristic::fromCpp(characteristic.value()) : nullptr);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An implementation of Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_ that is backed by a C++ implementation (using `std::function<...>`)
|
|
53
|
+
*/
|
|
54
|
+
struct JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx final: public jni::HybridClass<JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx, JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_> {
|
|
55
|
+
public:
|
|
56
|
+
static jni::local_ref<JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_::javaobject> fromCpp(const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)>& func) {
|
|
57
|
+
return JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx::newObjectCxxArgs(func);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
/**
|
|
62
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx` instance holds.
|
|
63
|
+
*/
|
|
64
|
+
void invoke_cxx(jni::alias_ref<JNativeBleError> error, jni::alias_ref<JNativeCharacteristic> characteristic) {
|
|
65
|
+
_func(error != nullptr ? std::make_optional(error->toCpp()) : std::nullopt, characteristic != nullptr ? std::make_optional(characteristic->toCpp()) : std::nullopt);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
[[nodiscard]]
|
|
70
|
+
inline const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)>& getFunction() const {
|
|
71
|
+
return _func;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public:
|
|
75
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx;";
|
|
76
|
+
static void registerNatives() {
|
|
77
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx::invoke_cxx)});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private:
|
|
81
|
+
explicit JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic__cxx(const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)>& func): _func(func) { }
|
|
82
|
+
|
|
83
|
+
private:
|
|
84
|
+
friend HybridBase;
|
|
85
|
+
std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)> _func;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_.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 <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
#include <optional>
|
|
15
|
+
#include "NativeBleError.hpp"
|
|
16
|
+
#include "NativeDevice.hpp"
|
|
17
|
+
#include "JNativeBleError.hpp"
|
|
18
|
+
#include "BleErrorCode.hpp"
|
|
19
|
+
#include "JBleErrorCode.hpp"
|
|
20
|
+
#include "BleATTErrorCode.hpp"
|
|
21
|
+
#include "JBleATTErrorCode.hpp"
|
|
22
|
+
#include "BleIOSErrorCode.hpp"
|
|
23
|
+
#include "JBleIOSErrorCode.hpp"
|
|
24
|
+
#include "BleAndroidErrorCode.hpp"
|
|
25
|
+
#include "JBleAndroidErrorCode.hpp"
|
|
26
|
+
#include <string>
|
|
27
|
+
#include "JNativeDevice.hpp"
|
|
28
|
+
#include <vector>
|
|
29
|
+
#include "ServiceDataEntry.hpp"
|
|
30
|
+
#include "JServiceDataEntry.hpp"
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::co::zyke::ble {
|
|
33
|
+
|
|
34
|
+
using namespace facebook;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Represents the Java/Kotlin callback `(error: NativeBleError?, device: NativeDevice?) -> Unit`.
|
|
38
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
39
|
+
*/
|
|
40
|
+
struct JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_: public jni::JavaClass<JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_> {
|
|
41
|
+
public:
|
|
42
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeDevice_;";
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Invokes the function this `JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_` instance holds through JNI.
|
|
47
|
+
*/
|
|
48
|
+
void invoke(const std::optional<NativeBleError>& error, const std::optional<NativeDevice>& device) const {
|
|
49
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JNativeBleError> /* error */, jni::alias_ref<JNativeDevice> /* device */)>("invoke");
|
|
50
|
+
method(self(), error.has_value() ? JNativeBleError::fromCpp(error.value()) : nullptr, device.has_value() ? JNativeDevice::fromCpp(device.value()) : nullptr);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* An implementation of Func_void_std__optional_NativeBleError__std__optional_NativeDevice_ that is backed by a C++ implementation (using `std::function<...>`)
|
|
56
|
+
*/
|
|
57
|
+
struct JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx final: public jni::HybridClass<JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx, JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_> {
|
|
58
|
+
public:
|
|
59
|
+
static jni::local_ref<JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_::javaobject> fromCpp(const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeDevice>& /* device */)>& func) {
|
|
60
|
+
return JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx::newObjectCxxArgs(func);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
/**
|
|
65
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx` instance holds.
|
|
66
|
+
*/
|
|
67
|
+
void invoke_cxx(jni::alias_ref<JNativeBleError> error, jni::alias_ref<JNativeDevice> device) {
|
|
68
|
+
_func(error != nullptr ? std::make_optional(error->toCpp()) : std::nullopt, device != nullptr ? std::make_optional(device->toCpp()) : std::nullopt);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public:
|
|
72
|
+
[[nodiscard]]
|
|
73
|
+
inline const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeDevice>& /* device */)>& getFunction() const {
|
|
74
|
+
return _func;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public:
|
|
78
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx;";
|
|
79
|
+
static void registerNatives() {
|
|
80
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx::invoke_cxx)});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private:
|
|
84
|
+
explicit JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice__cxx(const std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeDevice>& /* device */)>& func): _func(func) { }
|
|
85
|
+
|
|
86
|
+
private:
|
|
87
|
+
friend HybridBase;
|
|
88
|
+
std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeDevice>& /* device */)> _func;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
} // namespace margelo::nitro::co::zyke::ble
|