react-native-ble-nitro 1.0.0-beta.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BleNitro.podspec +39 -0
- package/LICENSE +1 -1
- package/README.md +273 -77
- package/ios/BleNitroBleManager.swift +425 -464
- package/ios/BlePeripheralDelegate.swift +174 -0
- package/lib/commonjs/index.d.ts +174 -10
- package/lib/commonjs/index.d.ts.map +1 -1
- package/lib/commonjs/index.js +461 -38
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeBleNitro.d.ts +5 -0
- package/lib/commonjs/specs/NativeBleNitro.d.ts.map +1 -0
- package/lib/commonjs/{utils/index.js → specs/NativeBleNitro.js} +6 -3
- package/lib/commonjs/specs/NativeBleNitro.js.map +1 -0
- package/lib/commonjs/specs/NativeBleNitro.nitro.d.ts +69 -0
- package/lib/commonjs/specs/NativeBleNitro.nitro.d.ts.map +1 -0
- package/lib/commonjs/specs/NativeBleNitro.nitro.js +14 -0
- package/lib/commonjs/specs/NativeBleNitro.nitro.js.map +1 -0
- package/lib/index.d.ts +174 -10
- package/lib/index.js +456 -16
- package/lib/specs/NativeBleNitro.d.ts +4 -0
- package/lib/specs/NativeBleNitro.js +5 -0
- package/lib/specs/NativeBleNitro.nitro.d.ts +68 -0
- package/lib/specs/NativeBleNitro.nitro.js +10 -0
- package/nitro.json +1 -1
- package/nitrogen/generated/android/BleNitro+autolinking.cmake +2 -10
- package/nitrogen/generated/android/BleNitroOnLoad.cpp +25 -22
- package/nitrogen/generated/android/c++/JBLEDevice.hpp +95 -0
- package/nitrogen/generated/android/c++/{JState.hpp → JBLEState.hpp} +22 -22
- package/nitrogen/generated/android/c++/JFunc_void_BLEDevice.hpp +82 -0
- package/nitrogen/generated/android/c++/JFunc_void_BLEState.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__string.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__string_std__string.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool_std__vector_double__std__string.hpp +86 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_bool_std__string.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__vector_double_.hpp +86 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_BLEDevice_.hpp +99 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_std__string_.hpp +93 -0
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.cpp +171 -0
- package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.hpp +83 -0
- package/nitrogen/generated/android/c++/JManufacturerData.hpp +73 -0
- package/nitrogen/generated/android/c++/JManufacturerDataEntry.hpp +68 -0
- package/nitrogen/generated/android/c++/JScanFilter.hpp +79 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BLEDevice.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{LogLevel.kt → BLEState.kt} +9 -13
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_std__optional_NativeBleError__std__optional_NativeDevice_.kt → Func_void_BLEDevice.kt} +15 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void.kt → Func_void_BLEState.kt} +15 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_State.kt → Func_void_bool.kt} +15 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.kt → Func_void_bool_std__string.kt} +15 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__string_std__string.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_bool_std__vector_double__std__string.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__string_bool_std__string.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__string_std__vector_double_.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__vector_BLEDevice_.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__vector_std__string_.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridNativeBleNitroSpec.kt +223 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{ServiceDataEntry.kt → ManufacturerData.kt} +7 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{ConnectionOptions.kt → ManufacturerDataEntry.kt} +10 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{NativeService.kt → ScanFilter.kt} +13 -7
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.cpp +67 -175
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp +205 -867
- package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Umbrella.hpp +20 -88
- package/nitrogen/generated/ios/BleNitroAutolinking.mm +3 -3
- package/nitrogen/generated/ios/BleNitroAutolinking.swift +4 -4
- package/nitrogen/generated/ios/c++/{HybridCharacteristicSpecSwift.cpp → HybridNativeBleNitroSpecSwift.cpp} +2 -2
- package/nitrogen/generated/ios/c++/HybridNativeBleNitroSpecSwift.hpp +205 -0
- package/nitrogen/generated/ios/swift/BLEDevice.swift +102 -0
- package/nitrogen/generated/ios/swift/{State.swift → BLEState.swift} +6 -6
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -0
- package/nitrogen/generated/ios/swift/{Func_void_State.swift → Func_void_BLEDevice.swift} +12 -11
- package/nitrogen/generated/ios/swift/{Func_void_LogLevel.swift → Func_void_BLEState.swift} +12 -11
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +6 -5
- package/nitrogen/generated/ios/swift/{Func_void_NativeDescriptor.swift → Func_void_bool_std__string.swift} +12 -11
- package/nitrogen/generated/ios/swift/{Func_void_std__vector_NativeCharacteristic_.swift → Func_void_bool_std__string_std__string.swift} +12 -11
- package/nitrogen/generated/ios/swift/Func_void_bool_std__vector_double__std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -0
- package/nitrogen/generated/ios/swift/{Func_void_NativeDevice.swift → Func_void_std__string_bool_std__string.swift} +12 -11
- package/nitrogen/generated/ios/swift/{Func_void_std__optional_BleRestoredState_.swift → Func_void_std__string_std__vector_double_.swift} +12 -17
- package/nitrogen/generated/ios/swift/{Func_void_NativeCharacteristic.swift → Func_void_std__vector_BLEDevice_.swift} +12 -11
- package/nitrogen/generated/ios/swift/{Func_void_std__vector_NativeDevice_.swift → Func_void_std__vector_std__string_.swift} +12 -11
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec.swift +68 -0
- package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec_cxx.swift +485 -0
- package/nitrogen/generated/ios/swift/ManufacturerData.swift +47 -0
- package/nitrogen/generated/ios/swift/ManufacturerDataEntry.swift +58 -0
- package/nitrogen/generated/ios/swift/ScanFilter.swift +69 -0
- package/nitrogen/generated/shared/c++/BLEDevice.hpp +90 -0
- package/nitrogen/generated/shared/c++/{State.hpp → BLEState.hpp} +13 -15
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.hpp +93 -0
- package/nitrogen/generated/shared/c++/ManufacturerData.hpp +69 -0
- package/nitrogen/generated/shared/c++/{ServiceDataEntry.hpp → ManufacturerDataEntry.hpp} +19 -20
- package/nitrogen/generated/shared/c++/ScanFilter.hpp +76 -0
- package/package.json +9 -11
- package/react-native.config.js +2 -7
- package/src/__tests__/index.test.ts +188 -0
- package/src/index.ts +604 -45
- package/src/specs/NativeBleNitro.nitro.ts +84 -0
- package/src/specs/NativeBleNitro.ts +8 -0
- package/android/build.gradle +0 -58
- package/android/src/main/AndroidManifest.xml +0 -23
- package/android/src/main/kotlin/com/margelo/nitro/co/zyke/ble/BleNitroBleManager.kt +0 -760
- package/ios/BleNitro.podspec +0 -44
- package/ios/BleNitroModule.swift +0 -24
- package/lib/BleManagerCompatFactory.d.ts +0 -55
- package/lib/BleManagerCompatFactory.js +0 -194
- package/lib/BleManagerFactory.d.ts +0 -30
- package/lib/BleManagerFactory.js +0 -73
- package/lib/commonjs/BleManagerCompatFactory.d.ts +0 -56
- package/lib/commonjs/BleManagerCompatFactory.d.ts.map +0 -1
- package/lib/commonjs/BleManagerCompatFactory.js +0 -201
- package/lib/commonjs/BleManagerCompatFactory.js.map +0 -1
- package/lib/commonjs/BleManagerFactory.d.ts +0 -31
- package/lib/commonjs/BleManagerFactory.d.ts.map +0 -1
- package/lib/commonjs/BleManagerFactory.js +0 -81
- package/lib/commonjs/BleManagerFactory.js.map +0 -1
- package/lib/commonjs/compatibility/constants.d.ts +0 -50
- package/lib/commonjs/compatibility/constants.d.ts.map +0 -1
- package/lib/commonjs/compatibility/constants.js +0 -58
- package/lib/commonjs/compatibility/constants.js.map +0 -1
- package/lib/commonjs/compatibility/deviceWrapper.d.ts +0 -100
- package/lib/commonjs/compatibility/deviceWrapper.d.ts.map +0 -1
- package/lib/commonjs/compatibility/deviceWrapper.js +0 -268
- package/lib/commonjs/compatibility/deviceWrapper.js.map +0 -1
- package/lib/commonjs/compatibility/enums.d.ts +0 -39
- package/lib/commonjs/compatibility/enums.d.ts.map +0 -1
- package/lib/commonjs/compatibility/enums.js +0 -179
- package/lib/commonjs/compatibility/enums.js.map +0 -1
- package/lib/commonjs/compatibility/index.d.ts +0 -13
- package/lib/commonjs/compatibility/index.d.ts.map +0 -1
- package/lib/commonjs/compatibility/index.js +0 -41
- package/lib/commonjs/compatibility/index.js.map +0 -1
- package/lib/commonjs/compatibility/serviceData.d.ts +0 -52
- package/lib/commonjs/compatibility/serviceData.d.ts.map +0 -1
- package/lib/commonjs/compatibility/serviceData.js +0 -80
- package/lib/commonjs/compatibility/serviceData.js.map +0 -1
- package/lib/commonjs/errors/BleError.d.ts +0 -60
- package/lib/commonjs/errors/BleError.d.ts.map +0 -1
- package/lib/commonjs/errors/BleError.js +0 -125
- package/lib/commonjs/errors/BleError.js.map +0 -1
- package/lib/commonjs/specs/BleManager.nitro.d.ts +0 -45
- package/lib/commonjs/specs/BleManager.nitro.d.ts.map +0 -1
- package/lib/commonjs/specs/BleManager.nitro.js +0 -3
- package/lib/commonjs/specs/BleManager.nitro.js.map +0 -1
- package/lib/commonjs/specs/Characteristic.nitro.d.ts +0 -27
- package/lib/commonjs/specs/Characteristic.nitro.d.ts.map +0 -1
- package/lib/commonjs/specs/Characteristic.nitro.js +0 -3
- package/lib/commonjs/specs/Characteristic.nitro.js.map +0 -1
- package/lib/commonjs/specs/Descriptor.nitro.d.ts +0 -18
- package/lib/commonjs/specs/Descriptor.nitro.d.ts.map +0 -1
- package/lib/commonjs/specs/Descriptor.nitro.js +0 -3
- package/lib/commonjs/specs/Descriptor.nitro.js.map +0 -1
- package/lib/commonjs/specs/Device.nitro.d.ts +0 -38
- package/lib/commonjs/specs/Device.nitro.d.ts.map +0 -1
- package/lib/commonjs/specs/Device.nitro.js +0 -3
- package/lib/commonjs/specs/Device.nitro.js.map +0 -1
- package/lib/commonjs/specs/Service.nitro.d.ts +0 -20
- package/lib/commonjs/specs/Service.nitro.d.ts.map +0 -1
- package/lib/commonjs/specs/Service.nitro.js +0 -3
- package/lib/commonjs/specs/Service.nitro.js.map +0 -1
- package/lib/commonjs/specs/types.d.ts +0 -229
- package/lib/commonjs/specs/types.d.ts.map +0 -1
- package/lib/commonjs/specs/types.js +0 -150
- package/lib/commonjs/specs/types.js.map +0 -1
- package/lib/commonjs/utils/base64.d.ts +0 -26
- package/lib/commonjs/utils/base64.d.ts.map +0 -1
- package/lib/commonjs/utils/base64.js +0 -88
- package/lib/commonjs/utils/base64.js.map +0 -1
- package/lib/commonjs/utils/index.d.ts +0 -3
- package/lib/commonjs/utils/index.d.ts.map +0 -1
- package/lib/commonjs/utils/index.js.map +0 -1
- package/lib/commonjs/utils/uuid.d.ts +0 -10
- package/lib/commonjs/utils/uuid.d.ts.map +0 -1
- package/lib/commonjs/utils/uuid.js +0 -41
- package/lib/commonjs/utils/uuid.js.map +0 -1
- package/lib/compatibility/constants.d.ts +0 -49
- package/lib/compatibility/constants.js +0 -50
- package/lib/compatibility/deviceWrapper.d.ts +0 -99
- package/lib/compatibility/deviceWrapper.js +0 -259
- package/lib/compatibility/enums.d.ts +0 -38
- package/lib/compatibility/enums.js +0 -159
- package/lib/compatibility/index.d.ts +0 -12
- package/lib/compatibility/index.js +0 -12
- package/lib/compatibility/serviceData.d.ts +0 -51
- package/lib/compatibility/serviceData.js +0 -70
- package/lib/errors/BleError.d.ts +0 -59
- package/lib/errors/BleError.js +0 -120
- package/lib/specs/BleManager.nitro.d.ts +0 -44
- package/lib/specs/BleManager.nitro.js +0 -1
- package/lib/specs/Characteristic.nitro.d.ts +0 -26
- package/lib/specs/Characteristic.nitro.js +0 -1
- package/lib/specs/Descriptor.nitro.d.ts +0 -17
- package/lib/specs/Descriptor.nitro.js +0 -1
- package/lib/specs/Device.nitro.d.ts +0 -37
- package/lib/specs/Device.nitro.js +0 -1
- package/lib/specs/Service.nitro.d.ts +0 -19
- package/lib/specs/Service.nitro.js +0 -1
- package/lib/specs/types.d.ts +0 -228
- package/lib/specs/types.js +0 -146
- package/lib/utils/base64.d.ts +0 -25
- package/lib/utils/base64.js +0 -80
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -2
- package/lib/utils/uuid.d.ts +0 -9
- package/lib/utils/uuid.js +0 -37
- package/nitrogen/generated/android/c++/JBleATTErrorCode.hpp +0 -107
- package/nitrogen/generated/android/c++/JBleAndroidErrorCode.hpp +0 -101
- package/nitrogen/generated/android/c++/JBleErrorCode.hpp +0 -170
- package/nitrogen/generated/android/c++/JBleIOSErrorCode.hpp +0 -92
- package/nitrogen/generated/android/c++/JBleManagerNitroOptions.hpp +0 -54
- package/nitrogen/generated/android/c++/JBleRestoredState.hpp +0 -76
- package/nitrogen/generated/android/c++/JCharacteristicSubscriptionType.hpp +0 -59
- package/nitrogen/generated/android/c++/JConnectionOptions.hpp +0 -61
- package/nitrogen/generated/android/c++/JConnectionPriority.hpp +0 -62
- package/nitrogen/generated/android/c++/JFunc_void.hpp +0 -74
- package/nitrogen/generated/android/c++/JFunc_void_State.hpp +0 -76
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.hpp +0 -88
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_.hpp +0 -91
- package/nitrogen/generated/android/c++/JHybridBleManagerSpec.cpp +0 -653
- package/nitrogen/generated/android/c++/JHybridBleManagerSpec.hpp +0 -92
- package/nitrogen/generated/android/c++/JHybridCharacteristicSpec.cpp +0 -253
- package/nitrogen/generated/android/c++/JHybridCharacteristicSpec.hpp +0 -79
- package/nitrogen/generated/android/c++/JHybridDescriptorSpec.cpp +0 -115
- package/nitrogen/generated/android/c++/JHybridDescriptorSpec.hpp +0 -70
- package/nitrogen/generated/android/c++/JHybridDeviceSpec.cpp +0 -476
- package/nitrogen/generated/android/c++/JHybridDeviceSpec.hpp +0 -90
- package/nitrogen/generated/android/c++/JHybridServiceSpec.cpp +0 -232
- package/nitrogen/generated/android/c++/JHybridServiceSpec.hpp +0 -72
- package/nitrogen/generated/android/c++/JLogLevel.hpp +0 -71
- package/nitrogen/generated/android/c++/JNativeBleError.hpp +0 -98
- package/nitrogen/generated/android/c++/JNativeCharacteristic.hpp +0 -98
- package/nitrogen/generated/android/c++/JNativeDescriptor.hpp +0 -82
- package/nitrogen/generated/android/c++/JNativeDevice.hpp +0 -173
- package/nitrogen/generated/android/c++/JNativeService.hpp +0 -65
- package/nitrogen/generated/android/c++/JScanCallbackType.hpp +0 -62
- package/nitrogen/generated/android/c++/JScanMode.hpp +0 -65
- package/nitrogen/generated/android/c++/JScanOptions.hpp +0 -69
- package/nitrogen/generated/android/c++/JServiceDataEntry.hpp +0 -57
- package/nitrogen/generated/android/c++/JSubscription.hpp +0 -64
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleATTErrorCode.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleAndroidErrorCode.kt +0 -39
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleErrorCode.kt +0 -62
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleIOSErrorCode.kt +0 -36
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleManagerNitroOptions.kt +0 -26
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleRestoredState.kt +0 -26
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/CharacteristicSubscriptionType.kt +0 -25
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ConnectionPriority.kt +0 -26
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridBleManagerSpec.kt +0 -192
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridCharacteristicSpec.kt +0 -127
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridDescriptorSpec.kt +0 -86
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridDeviceSpec.kt +0 -176
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridServiceSpec.kt +0 -99
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeBleError.kt +0 -35
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeCharacteristic.kt +0 -37
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeDescriptor.kt +0 -33
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeDevice.kt +0 -38
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanCallbackType.kt +0 -26
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanMode.kt +0 -27
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanOptions.kt +0 -29
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/State.kt +0 -29
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Subscription.kt +0 -30
- package/nitrogen/generated/ios/c++/HybridBleManagerSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridBleManagerSpecSwift.hpp +0 -377
- package/nitrogen/generated/ios/c++/HybridCharacteristicSpecSwift.hpp +0 -192
- package/nitrogen/generated/ios/c++/HybridDescriptorSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridDescriptorSpecSwift.hpp +0 -112
- package/nitrogen/generated/ios/c++/HybridDeviceSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridDeviceSpecSwift.hpp +0 -294
- package/nitrogen/generated/ios/c++/HybridServiceSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridServiceSpecSwift.hpp +0 -170
- package/nitrogen/generated/ios/swift/BleATTErrorCode.swift +0 -104
- package/nitrogen/generated/ios/swift/BleAndroidErrorCode.swift +0 -96
- package/nitrogen/generated/ios/swift/BleErrorCode.swift +0 -188
- package/nitrogen/generated/ios/swift/BleIOSErrorCode.swift +0 -84
- package/nitrogen/generated/ios/swift/BleManagerNitroOptions.swift +0 -53
- package/nitrogen/generated/ios/swift/BleRestoredState.swift +0 -47
- package/nitrogen/generated/ios/swift/CharacteristicSubscriptionType.swift +0 -40
- package/nitrogen/generated/ios/swift/ConnectionOptions.swift +0 -57
- package/nitrogen/generated/ios/swift/ConnectionPriority.swift +0 -44
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.swift +0 -58
- package/nitrogen/generated/ios/swift/Func_void_std__optional_NativeBleError__std__optional_NativeDevice_.swift +0 -58
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_.swift +0 -50
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_.swift +0 -50
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeDescriptor_.swift +0 -46
- package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeService_.swift +0 -46
- package/nitrogen/generated/ios/swift/HybridBleManagerSpec.swift +0 -78
- package/nitrogen/generated/ios/swift/HybridBleManagerSpec_cxx.swift +0 -852
- package/nitrogen/generated/ios/swift/HybridCharacteristicSpec.swift +0 -65
- package/nitrogen/generated/ios/swift/HybridCharacteristicSpec_cxx.swift +0 -384
- package/nitrogen/generated/ios/swift/HybridDescriptorSpec.swift +0 -56
- package/nitrogen/generated/ios/swift/HybridDescriptorSpec_cxx.swift +0 -218
- package/nitrogen/generated/ios/swift/HybridDeviceSpec.swift +0 -76
- package/nitrogen/generated/ios/swift/HybridDeviceSpec_cxx.swift +0 -702
- package/nitrogen/generated/ios/swift/HybridServiceSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridServiceSpec_cxx.swift +0 -338
- package/nitrogen/generated/ios/swift/LogLevel.swift +0 -56
- package/nitrogen/generated/ios/swift/NativeBleError.swift +0 -278
- package/nitrogen/generated/ios/swift/NativeCharacteristic.swift +0 -174
- package/nitrogen/generated/ios/swift/NativeDescriptor.swift +0 -130
- package/nitrogen/generated/ios/swift/NativeDevice.swift +0 -377
- package/nitrogen/generated/ios/swift/NativeService.swift +0 -68
- package/nitrogen/generated/ios/swift/ScanCallbackType.swift +0 -44
- package/nitrogen/generated/ios/swift/ScanMode.swift +0 -48
- package/nitrogen/generated/ios/swift/ScanOptions.swift +0 -116
- package/nitrogen/generated/ios/swift/ServiceDataEntry.swift +0 -46
- package/nitrogen/generated/ios/swift/Subscription.swift +0 -46
- package/nitrogen/generated/shared/c++/BleATTErrorCode.hpp +0 -80
- package/nitrogen/generated/shared/c++/BleAndroidErrorCode.hpp +0 -78
- package/nitrogen/generated/shared/c++/BleErrorCode.hpp +0 -101
- package/nitrogen/generated/shared/c++/BleIOSErrorCode.hpp +0 -75
- package/nitrogen/generated/shared/c++/BleManagerNitroOptions.hpp +0 -70
- package/nitrogen/generated/shared/c++/BleRestoredState.hpp +0 -71
- package/nitrogen/generated/shared/c++/CharacteristicSubscriptionType.hpp +0 -64
- package/nitrogen/generated/shared/c++/ConnectionOptions.hpp +0 -77
- package/nitrogen/generated/shared/c++/ConnectionPriority.hpp +0 -65
- package/nitrogen/generated/shared/c++/HybridBleManagerSpec.cpp +0 -51
- package/nitrogen/generated/shared/c++/HybridBleManagerSpec.hpp +0 -137
- package/nitrogen/generated/shared/c++/HybridCharacteristicSpec.cpp +0 -39
- package/nitrogen/generated/shared/c++/HybridCharacteristicSpec.hpp +0 -101
- package/nitrogen/generated/shared/c++/HybridDescriptorSpec.cpp +0 -30
- package/nitrogen/generated/shared/c++/HybridDescriptorSpec.hpp +0 -75
- package/nitrogen/generated/shared/c++/HybridDeviceSpec.cpp +0 -50
- package/nitrogen/generated/shared/c++/HybridDeviceSpec.hpp +0 -123
- package/nitrogen/generated/shared/c++/HybridServiceSpec.cpp +0 -32
- package/nitrogen/generated/shared/c++/HybridServiceSpec.hpp +0 -90
- package/nitrogen/generated/shared/c++/LogLevel.hpp +0 -68
- package/nitrogen/generated/shared/c++/NativeBleError.hpp +0 -117
- package/nitrogen/generated/shared/c++/NativeCharacteristic.hpp +0 -114
- package/nitrogen/generated/shared/c++/NativeDescriptor.hpp +0 -98
- package/nitrogen/generated/shared/c++/NativeDevice.hpp +0 -121
- package/nitrogen/generated/shared/c++/NativeService.hpp +0 -81
- package/nitrogen/generated/shared/c++/ScanCallbackType.hpp +0 -65
- package/nitrogen/generated/shared/c++/ScanMode.hpp +0 -66
- package/nitrogen/generated/shared/c++/ScanOptions.hpp +0 -86
- package/nitrogen/generated/shared/c++/Subscription.hpp +0 -69
- package/src/BleManagerCompatFactory.ts +0 -371
- package/src/BleManagerFactory.ts +0 -93
- package/src/__tests__/BleManager.test.ts +0 -327
- package/src/__tests__/compatibility/deviceWrapper.test.ts +0 -563
- package/src/__tests__/compatibility/enums.test.ts +0 -264
- package/src/compatibility/constants.ts +0 -71
- package/src/compatibility/deviceWrapper.ts +0 -427
- package/src/compatibility/enums.ts +0 -190
- package/src/compatibility/index.ts +0 -32
- package/src/compatibility/serviceData.ts +0 -85
- package/src/errors/BleError.ts +0 -193
- package/src/specs/BleManager.nitro.ts +0 -165
- package/src/specs/Characteristic.nitro.ts +0 -61
- package/src/specs/Descriptor.nitro.ts +0 -28
- package/src/specs/Device.nitro.ts +0 -104
- package/src/specs/Service.nitro.ts +0 -64
- package/src/specs/types.ts +0 -259
- package/src/utils/base64.ts +0 -80
- package/src/utils/index.ts +0 -2
- package/src/utils/uuid.ts +0 -45
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JNativeDevice.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 "NativeDevice.hpp"
|
|
12
|
-
|
|
13
|
-
#include "JServiceDataEntry.hpp"
|
|
14
|
-
#include "ServiceDataEntry.hpp"
|
|
15
|
-
#include <optional>
|
|
16
|
-
#include <string>
|
|
17
|
-
#include <vector>
|
|
18
|
-
|
|
19
|
-
namespace margelo::nitro::co::zyke::ble {
|
|
20
|
-
|
|
21
|
-
using namespace facebook;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The C++ JNI bridge between the C++ struct "NativeDevice" and the the Kotlin data class "NativeDevice".
|
|
25
|
-
*/
|
|
26
|
-
struct JNativeDevice final: public jni::JavaClass<JNativeDevice> {
|
|
27
|
-
public:
|
|
28
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/NativeDevice;";
|
|
29
|
-
|
|
30
|
-
public:
|
|
31
|
-
/**
|
|
32
|
-
* Convert this Java/Kotlin-based struct to the C++ struct NativeDevice by copying all values to C++.
|
|
33
|
-
*/
|
|
34
|
-
[[maybe_unused]]
|
|
35
|
-
[[nodiscard]]
|
|
36
|
-
NativeDevice toCpp() const {
|
|
37
|
-
static const auto clazz = javaClassStatic();
|
|
38
|
-
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
39
|
-
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
40
|
-
static const auto fieldName = clazz->getField<jni::JString>("name");
|
|
41
|
-
jni::local_ref<jni::JString> name = this->getFieldValue(fieldName);
|
|
42
|
-
static const auto fieldRssi = clazz->getField<jni::JDouble>("rssi");
|
|
43
|
-
jni::local_ref<jni::JDouble> rssi = this->getFieldValue(fieldRssi);
|
|
44
|
-
static const auto fieldMtu = clazz->getField<double>("mtu");
|
|
45
|
-
double mtu = this->getFieldValue(fieldMtu);
|
|
46
|
-
static const auto fieldManufacturerData = clazz->getField<jni::JString>("manufacturerData");
|
|
47
|
-
jni::local_ref<jni::JString> manufacturerData = this->getFieldValue(fieldManufacturerData);
|
|
48
|
-
static const auto fieldRawScanRecord = clazz->getField<jni::JString>("rawScanRecord");
|
|
49
|
-
jni::local_ref<jni::JString> rawScanRecord = this->getFieldValue(fieldRawScanRecord);
|
|
50
|
-
static const auto fieldServiceData = clazz->getField<jni::JArrayClass<JServiceDataEntry>>("serviceData");
|
|
51
|
-
jni::local_ref<jni::JArrayClass<JServiceDataEntry>> serviceData = this->getFieldValue(fieldServiceData);
|
|
52
|
-
static const auto fieldServiceUUIDs = clazz->getField<jni::JArrayClass<jni::JString>>("serviceUUIDs");
|
|
53
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> serviceUUIDs = this->getFieldValue(fieldServiceUUIDs);
|
|
54
|
-
static const auto fieldLocalName = clazz->getField<jni::JString>("localName");
|
|
55
|
-
jni::local_ref<jni::JString> localName = this->getFieldValue(fieldLocalName);
|
|
56
|
-
static const auto fieldTxPowerLevel = clazz->getField<jni::JDouble>("txPowerLevel");
|
|
57
|
-
jni::local_ref<jni::JDouble> txPowerLevel = this->getFieldValue(fieldTxPowerLevel);
|
|
58
|
-
static const auto fieldSolicitedServiceUUIDs = clazz->getField<jni::JArrayClass<jni::JString>>("solicitedServiceUUIDs");
|
|
59
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> solicitedServiceUUIDs = this->getFieldValue(fieldSolicitedServiceUUIDs);
|
|
60
|
-
static const auto fieldIsConnectable = clazz->getField<jni::JBoolean>("isConnectable");
|
|
61
|
-
jni::local_ref<jni::JBoolean> isConnectable = this->getFieldValue(fieldIsConnectable);
|
|
62
|
-
static const auto fieldOverflowServiceUUIDs = clazz->getField<jni::JArrayClass<jni::JString>>("overflowServiceUUIDs");
|
|
63
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> overflowServiceUUIDs = this->getFieldValue(fieldOverflowServiceUUIDs);
|
|
64
|
-
return NativeDevice(
|
|
65
|
-
id->toStdString(),
|
|
66
|
-
name != nullptr ? std::make_optional(name->toStdString()) : std::nullopt,
|
|
67
|
-
rssi != nullptr ? std::make_optional(rssi->value()) : std::nullopt,
|
|
68
|
-
mtu,
|
|
69
|
-
manufacturerData != nullptr ? std::make_optional(manufacturerData->toStdString()) : std::nullopt,
|
|
70
|
-
rawScanRecord->toStdString(),
|
|
71
|
-
serviceData != nullptr ? std::make_optional([&]() {
|
|
72
|
-
size_t __size = serviceData->size();
|
|
73
|
-
std::vector<ServiceDataEntry> __vector;
|
|
74
|
-
__vector.reserve(__size);
|
|
75
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
76
|
-
auto __element = serviceData->getElement(__i);
|
|
77
|
-
__vector.push_back(__element->toCpp());
|
|
78
|
-
}
|
|
79
|
-
return __vector;
|
|
80
|
-
}()) : std::nullopt,
|
|
81
|
-
serviceUUIDs != nullptr ? std::make_optional([&]() {
|
|
82
|
-
size_t __size = serviceUUIDs->size();
|
|
83
|
-
std::vector<std::string> __vector;
|
|
84
|
-
__vector.reserve(__size);
|
|
85
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
86
|
-
auto __element = serviceUUIDs->getElement(__i);
|
|
87
|
-
__vector.push_back(__element->toStdString());
|
|
88
|
-
}
|
|
89
|
-
return __vector;
|
|
90
|
-
}()) : std::nullopt,
|
|
91
|
-
localName != nullptr ? std::make_optional(localName->toStdString()) : std::nullopt,
|
|
92
|
-
txPowerLevel != nullptr ? std::make_optional(txPowerLevel->value()) : std::nullopt,
|
|
93
|
-
solicitedServiceUUIDs != nullptr ? std::make_optional([&]() {
|
|
94
|
-
size_t __size = solicitedServiceUUIDs->size();
|
|
95
|
-
std::vector<std::string> __vector;
|
|
96
|
-
__vector.reserve(__size);
|
|
97
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
98
|
-
auto __element = solicitedServiceUUIDs->getElement(__i);
|
|
99
|
-
__vector.push_back(__element->toStdString());
|
|
100
|
-
}
|
|
101
|
-
return __vector;
|
|
102
|
-
}()) : std::nullopt,
|
|
103
|
-
isConnectable != nullptr ? std::make_optional(static_cast<bool>(isConnectable->value())) : std::nullopt,
|
|
104
|
-
overflowServiceUUIDs != nullptr ? std::make_optional([&]() {
|
|
105
|
-
size_t __size = overflowServiceUUIDs->size();
|
|
106
|
-
std::vector<std::string> __vector;
|
|
107
|
-
__vector.reserve(__size);
|
|
108
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
109
|
-
auto __element = overflowServiceUUIDs->getElement(__i);
|
|
110
|
-
__vector.push_back(__element->toStdString());
|
|
111
|
-
}
|
|
112
|
-
return __vector;
|
|
113
|
-
}()) : std::nullopt
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public:
|
|
118
|
-
/**
|
|
119
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
120
|
-
*/
|
|
121
|
-
[[maybe_unused]]
|
|
122
|
-
static jni::local_ref<JNativeDevice::javaobject> fromCpp(const NativeDevice& value) {
|
|
123
|
-
return newInstance(
|
|
124
|
-
jni::make_jstring(value.id),
|
|
125
|
-
value.name.has_value() ? jni::make_jstring(value.name.value()) : nullptr,
|
|
126
|
-
value.rssi.has_value() ? jni::JDouble::valueOf(value.rssi.value()) : nullptr,
|
|
127
|
-
value.mtu,
|
|
128
|
-
value.manufacturerData.has_value() ? jni::make_jstring(value.manufacturerData.value()) : nullptr,
|
|
129
|
-
jni::make_jstring(value.rawScanRecord),
|
|
130
|
-
value.serviceData.has_value() ? [&]() {
|
|
131
|
-
size_t __size = value.serviceData.value().size();
|
|
132
|
-
jni::local_ref<jni::JArrayClass<JServiceDataEntry>> __array = jni::JArrayClass<JServiceDataEntry>::newArray(__size);
|
|
133
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
134
|
-
const auto& __element = value.serviceData.value()[__i];
|
|
135
|
-
__array->setElement(__i, *JServiceDataEntry::fromCpp(__element));
|
|
136
|
-
}
|
|
137
|
-
return __array;
|
|
138
|
-
}() : nullptr,
|
|
139
|
-
value.serviceUUIDs.has_value() ? [&]() {
|
|
140
|
-
size_t __size = value.serviceUUIDs.value().size();
|
|
141
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
142
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
143
|
-
const auto& __element = value.serviceUUIDs.value()[__i];
|
|
144
|
-
__array->setElement(__i, *jni::make_jstring(__element));
|
|
145
|
-
}
|
|
146
|
-
return __array;
|
|
147
|
-
}() : nullptr,
|
|
148
|
-
value.localName.has_value() ? jni::make_jstring(value.localName.value()) : nullptr,
|
|
149
|
-
value.txPowerLevel.has_value() ? jni::JDouble::valueOf(value.txPowerLevel.value()) : nullptr,
|
|
150
|
-
value.solicitedServiceUUIDs.has_value() ? [&]() {
|
|
151
|
-
size_t __size = value.solicitedServiceUUIDs.value().size();
|
|
152
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
153
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
154
|
-
const auto& __element = value.solicitedServiceUUIDs.value()[__i];
|
|
155
|
-
__array->setElement(__i, *jni::make_jstring(__element));
|
|
156
|
-
}
|
|
157
|
-
return __array;
|
|
158
|
-
}() : nullptr,
|
|
159
|
-
value.isConnectable.has_value() ? jni::JBoolean::valueOf(value.isConnectable.value()) : nullptr,
|
|
160
|
-
value.overflowServiceUUIDs.has_value() ? [&]() {
|
|
161
|
-
size_t __size = value.overflowServiceUUIDs.value().size();
|
|
162
|
-
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
163
|
-
for (size_t __i = 0; __i < __size; __i++) {
|
|
164
|
-
const auto& __element = value.overflowServiceUUIDs.value()[__i];
|
|
165
|
-
__array->setElement(__i, *jni::make_jstring(__element));
|
|
166
|
-
}
|
|
167
|
-
return __array;
|
|
168
|
-
}() : nullptr
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JNativeService.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 "NativeService.hpp"
|
|
12
|
-
|
|
13
|
-
#include <string>
|
|
14
|
-
|
|
15
|
-
namespace margelo::nitro::co::zyke::ble {
|
|
16
|
-
|
|
17
|
-
using namespace facebook;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "NativeService" and the the Kotlin data class "NativeService".
|
|
21
|
-
*/
|
|
22
|
-
struct JNativeService final: public jni::JavaClass<JNativeService> {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/NativeService;";
|
|
25
|
-
|
|
26
|
-
public:
|
|
27
|
-
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct NativeService by copying all values to C++.
|
|
29
|
-
*/
|
|
30
|
-
[[maybe_unused]]
|
|
31
|
-
[[nodiscard]]
|
|
32
|
-
NativeService toCpp() const {
|
|
33
|
-
static const auto clazz = javaClassStatic();
|
|
34
|
-
static const auto fieldId = clazz->getField<double>("id");
|
|
35
|
-
double id = this->getFieldValue(fieldId);
|
|
36
|
-
static const auto fieldUuid = clazz->getField<jni::JString>("uuid");
|
|
37
|
-
jni::local_ref<jni::JString> uuid = this->getFieldValue(fieldUuid);
|
|
38
|
-
static const auto fieldDeviceID = clazz->getField<jni::JString>("deviceID");
|
|
39
|
-
jni::local_ref<jni::JString> deviceID = this->getFieldValue(fieldDeviceID);
|
|
40
|
-
static const auto fieldIsPrimary = clazz->getField<jboolean>("isPrimary");
|
|
41
|
-
jboolean isPrimary = this->getFieldValue(fieldIsPrimary);
|
|
42
|
-
return NativeService(
|
|
43
|
-
id,
|
|
44
|
-
uuid->toStdString(),
|
|
45
|
-
deviceID->toStdString(),
|
|
46
|
-
static_cast<bool>(isPrimary)
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public:
|
|
51
|
-
/**
|
|
52
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
|
-
*/
|
|
54
|
-
[[maybe_unused]]
|
|
55
|
-
static jni::local_ref<JNativeService::javaobject> fromCpp(const NativeService& value) {
|
|
56
|
-
return newInstance(
|
|
57
|
-
value.id,
|
|
58
|
-
jni::make_jstring(value.uuid),
|
|
59
|
-
jni::make_jstring(value.deviceID),
|
|
60
|
-
value.isPrimary
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JScanCallbackType.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 "ScanCallbackType.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 "ScanCallbackType" and the the Kotlin enum "ScanCallbackType".
|
|
19
|
-
*/
|
|
20
|
-
struct JScanCallbackType final: public jni::JavaClass<JScanCallbackType> {
|
|
21
|
-
public:
|
|
22
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/ScanCallbackType;";
|
|
23
|
-
|
|
24
|
-
public:
|
|
25
|
-
/**
|
|
26
|
-
* Convert this Java/Kotlin-based enum to the C++ enum ScanCallbackType.
|
|
27
|
-
*/
|
|
28
|
-
[[maybe_unused]]
|
|
29
|
-
[[nodiscard]]
|
|
30
|
-
ScanCallbackType 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<ScanCallbackType>(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<JScanCallbackType> fromCpp(ScanCallbackType value) {
|
|
43
|
-
static const auto clazz = javaClassStatic();
|
|
44
|
-
static const auto fieldALLMATCHES = clazz->getStaticField<JScanCallbackType>("ALLMATCHES");
|
|
45
|
-
static const auto fieldFIRSTMATCH = clazz->getStaticField<JScanCallbackType>("FIRSTMATCH");
|
|
46
|
-
static const auto fieldMATCHLOST = clazz->getStaticField<JScanCallbackType>("MATCHLOST");
|
|
47
|
-
|
|
48
|
-
switch (value) {
|
|
49
|
-
case ScanCallbackType::ALLMATCHES:
|
|
50
|
-
return clazz->getStaticFieldValue(fieldALLMATCHES);
|
|
51
|
-
case ScanCallbackType::FIRSTMATCH:
|
|
52
|
-
return clazz->getStaticFieldValue(fieldFIRSTMATCH);
|
|
53
|
-
case ScanCallbackType::MATCHLOST:
|
|
54
|
-
return clazz->getStaticFieldValue(fieldMATCHLOST);
|
|
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
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JScanMode.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 "ScanMode.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 "ScanMode" and the the Kotlin enum "ScanMode".
|
|
19
|
-
*/
|
|
20
|
-
struct JScanMode final: public jni::JavaClass<JScanMode> {
|
|
21
|
-
public:
|
|
22
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/ScanMode;";
|
|
23
|
-
|
|
24
|
-
public:
|
|
25
|
-
/**
|
|
26
|
-
* Convert this Java/Kotlin-based enum to the C++ enum ScanMode.
|
|
27
|
-
*/
|
|
28
|
-
[[maybe_unused]]
|
|
29
|
-
[[nodiscard]]
|
|
30
|
-
ScanMode 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<ScanMode>(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<JScanMode> fromCpp(ScanMode value) {
|
|
43
|
-
static const auto clazz = javaClassStatic();
|
|
44
|
-
static const auto fieldOPPORTUNISTIC = clazz->getStaticField<JScanMode>("OPPORTUNISTIC");
|
|
45
|
-
static const auto fieldLOWPOWER = clazz->getStaticField<JScanMode>("LOWPOWER");
|
|
46
|
-
static const auto fieldBALANCED = clazz->getStaticField<JScanMode>("BALANCED");
|
|
47
|
-
static const auto fieldLOWLATENCY = clazz->getStaticField<JScanMode>("LOWLATENCY");
|
|
48
|
-
|
|
49
|
-
switch (value) {
|
|
50
|
-
case ScanMode::OPPORTUNISTIC:
|
|
51
|
-
return clazz->getStaticFieldValue(fieldOPPORTUNISTIC);
|
|
52
|
-
case ScanMode::LOWPOWER:
|
|
53
|
-
return clazz->getStaticFieldValue(fieldLOWPOWER);
|
|
54
|
-
case ScanMode::BALANCED:
|
|
55
|
-
return clazz->getStaticFieldValue(fieldBALANCED);
|
|
56
|
-
case ScanMode::LOWLATENCY:
|
|
57
|
-
return clazz->getStaticFieldValue(fieldLOWLATENCY);
|
|
58
|
-
default:
|
|
59
|
-
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
60
|
-
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JScanOptions.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 "ScanOptions.hpp"
|
|
12
|
-
|
|
13
|
-
#include "JScanCallbackType.hpp"
|
|
14
|
-
#include "JScanMode.hpp"
|
|
15
|
-
#include "ScanCallbackType.hpp"
|
|
16
|
-
#include "ScanMode.hpp"
|
|
17
|
-
#include <optional>
|
|
18
|
-
|
|
19
|
-
namespace margelo::nitro::co::zyke::ble {
|
|
20
|
-
|
|
21
|
-
using namespace facebook;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The C++ JNI bridge between the C++ struct "ScanOptions" and the the Kotlin data class "ScanOptions".
|
|
25
|
-
*/
|
|
26
|
-
struct JScanOptions final: public jni::JavaClass<JScanOptions> {
|
|
27
|
-
public:
|
|
28
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/ScanOptions;";
|
|
29
|
-
|
|
30
|
-
public:
|
|
31
|
-
/**
|
|
32
|
-
* Convert this Java/Kotlin-based struct to the C++ struct ScanOptions by copying all values to C++.
|
|
33
|
-
*/
|
|
34
|
-
[[maybe_unused]]
|
|
35
|
-
[[nodiscard]]
|
|
36
|
-
ScanOptions toCpp() const {
|
|
37
|
-
static const auto clazz = javaClassStatic();
|
|
38
|
-
static const auto fieldAllowDuplicates = clazz->getField<jni::JBoolean>("allowDuplicates");
|
|
39
|
-
jni::local_ref<jni::JBoolean> allowDuplicates = this->getFieldValue(fieldAllowDuplicates);
|
|
40
|
-
static const auto fieldScanMode = clazz->getField<JScanMode>("scanMode");
|
|
41
|
-
jni::local_ref<JScanMode> scanMode = this->getFieldValue(fieldScanMode);
|
|
42
|
-
static const auto fieldCallbackType = clazz->getField<JScanCallbackType>("callbackType");
|
|
43
|
-
jni::local_ref<JScanCallbackType> callbackType = this->getFieldValue(fieldCallbackType);
|
|
44
|
-
static const auto fieldLegacyScan = clazz->getField<jni::JBoolean>("legacyScan");
|
|
45
|
-
jni::local_ref<jni::JBoolean> legacyScan = this->getFieldValue(fieldLegacyScan);
|
|
46
|
-
return ScanOptions(
|
|
47
|
-
allowDuplicates != nullptr ? std::make_optional(static_cast<bool>(allowDuplicates->value())) : std::nullopt,
|
|
48
|
-
scanMode != nullptr ? std::make_optional(scanMode->toCpp()) : std::nullopt,
|
|
49
|
-
callbackType != nullptr ? std::make_optional(callbackType->toCpp()) : std::nullopt,
|
|
50
|
-
legacyScan != nullptr ? std::make_optional(static_cast<bool>(legacyScan->value())) : std::nullopt
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public:
|
|
55
|
-
/**
|
|
56
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
57
|
-
*/
|
|
58
|
-
[[maybe_unused]]
|
|
59
|
-
static jni::local_ref<JScanOptions::javaobject> fromCpp(const ScanOptions& value) {
|
|
60
|
-
return newInstance(
|
|
61
|
-
value.allowDuplicates.has_value() ? jni::JBoolean::valueOf(value.allowDuplicates.value()) : nullptr,
|
|
62
|
-
value.scanMode.has_value() ? JScanMode::fromCpp(value.scanMode.value()) : nullptr,
|
|
63
|
-
value.callbackType.has_value() ? JScanCallbackType::fromCpp(value.callbackType.value()) : nullptr,
|
|
64
|
-
value.legacyScan.has_value() ? jni::JBoolean::valueOf(value.legacyScan.value()) : nullptr
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JServiceDataEntry.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 "ServiceDataEntry.hpp"
|
|
12
|
-
|
|
13
|
-
#include <string>
|
|
14
|
-
|
|
15
|
-
namespace margelo::nitro::co::zyke::ble {
|
|
16
|
-
|
|
17
|
-
using namespace facebook;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "ServiceDataEntry" and the the Kotlin data class "ServiceDataEntry".
|
|
21
|
-
*/
|
|
22
|
-
struct JServiceDataEntry final: public jni::JavaClass<JServiceDataEntry> {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/ServiceDataEntry;";
|
|
25
|
-
|
|
26
|
-
public:
|
|
27
|
-
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct ServiceDataEntry by copying all values to C++.
|
|
29
|
-
*/
|
|
30
|
-
[[maybe_unused]]
|
|
31
|
-
[[nodiscard]]
|
|
32
|
-
ServiceDataEntry toCpp() const {
|
|
33
|
-
static const auto clazz = javaClassStatic();
|
|
34
|
-
static const auto fieldUuid = clazz->getField<jni::JString>("uuid");
|
|
35
|
-
jni::local_ref<jni::JString> uuid = this->getFieldValue(fieldUuid);
|
|
36
|
-
static const auto fieldData = clazz->getField<jni::JString>("data");
|
|
37
|
-
jni::local_ref<jni::JString> data = this->getFieldValue(fieldData);
|
|
38
|
-
return ServiceDataEntry(
|
|
39
|
-
uuid->toStdString(),
|
|
40
|
-
data->toStdString()
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public:
|
|
45
|
-
/**
|
|
46
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
-
*/
|
|
48
|
-
[[maybe_unused]]
|
|
49
|
-
static jni::local_ref<JServiceDataEntry::javaobject> fromCpp(const ServiceDataEntry& value) {
|
|
50
|
-
return newInstance(
|
|
51
|
-
jni::make_jstring(value.uuid),
|
|
52
|
-
jni::make_jstring(value.data)
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JSubscription.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 "Subscription.hpp"
|
|
12
|
-
|
|
13
|
-
#include "JFunc_void.hpp"
|
|
14
|
-
#include <functional>
|
|
15
|
-
|
|
16
|
-
namespace margelo::nitro::co::zyke::ble {
|
|
17
|
-
|
|
18
|
-
using namespace facebook;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "Subscription" and the the Kotlin data class "Subscription".
|
|
22
|
-
*/
|
|
23
|
-
struct JSubscription final: public jni::JavaClass<JSubscription> {
|
|
24
|
-
public:
|
|
25
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/co/zyke/ble/Subscription;";
|
|
26
|
-
|
|
27
|
-
public:
|
|
28
|
-
/**
|
|
29
|
-
* Convert this Java/Kotlin-based struct to the C++ struct Subscription by copying all values to C++.
|
|
30
|
-
*/
|
|
31
|
-
[[maybe_unused]]
|
|
32
|
-
[[nodiscard]]
|
|
33
|
-
Subscription toCpp() const {
|
|
34
|
-
static const auto clazz = javaClassStatic();
|
|
35
|
-
static const auto fieldRemove = clazz->getField<JFunc_void::javaobject>("remove");
|
|
36
|
-
jni::local_ref<JFunc_void::javaobject> remove = this->getFieldValue(fieldRemove);
|
|
37
|
-
return Subscription(
|
|
38
|
-
[&]() -> std::function<void()> {
|
|
39
|
-
if (remove->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
|
|
40
|
-
auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(remove);
|
|
41
|
-
return downcast->cthis()->getFunction();
|
|
42
|
-
} else {
|
|
43
|
-
auto removeRef = jni::make_global(remove);
|
|
44
|
-
return [removeRef]() -> void {
|
|
45
|
-
return removeRef->invoke();
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}()
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public:
|
|
53
|
-
/**
|
|
54
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
55
|
-
*/
|
|
56
|
-
[[maybe_unused]]
|
|
57
|
-
static jni::local_ref<JSubscription::javaobject> fromCpp(const Subscription& value) {
|
|
58
|
-
return newInstance(
|
|
59
|
-
JFunc_void_cxx::fromCpp(value.remove)
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
} // namespace margelo::nitro::co::zyke::ble
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// BleATTErrorCode.kt
|
|
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
|
-
package com.margelo.nitro.co.zyke.ble
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Represents the JavaScript enum/union "BleATTErrorCode".
|
|
15
|
-
*/
|
|
16
|
-
@DoNotStrip
|
|
17
|
-
@Keep
|
|
18
|
-
enum class BleATTErrorCode {
|
|
19
|
-
SUCCESS,
|
|
20
|
-
INVALIDHANDLE,
|
|
21
|
-
READNOTPERMITTED,
|
|
22
|
-
WRITENOTPERMITTED,
|
|
23
|
-
INVALIDPDU,
|
|
24
|
-
INSUFFICIENTAUTHENTICATION,
|
|
25
|
-
REQUESTNOTSUPPORTED,
|
|
26
|
-
INVALIDOFFSET,
|
|
27
|
-
INSUFFICIENTAUTHORIZATION,
|
|
28
|
-
PREPAREQUEUEFULL,
|
|
29
|
-
ATTRIBUTENOTFOUND,
|
|
30
|
-
ATTRIBUTENOTLONG,
|
|
31
|
-
INSUFFICIENTENCRYPTIONKEYSIZE,
|
|
32
|
-
INVALIDATTRIBUTEVALUELENGTH,
|
|
33
|
-
UNLIKELYERROR,
|
|
34
|
-
INSUFFICIENTENCRYPTION,
|
|
35
|
-
UNSUPPORTEDGROUPTYPE,
|
|
36
|
-
INSUFFICIENTRESOURCES;
|
|
37
|
-
|
|
38
|
-
@DoNotStrip
|
|
39
|
-
@Keep
|
|
40
|
-
private val _ordinal = ordinal
|
|
41
|
-
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleAndroidErrorCode.kt
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// BleAndroidErrorCode.kt
|
|
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
|
-
package com.margelo.nitro.co.zyke.ble
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Represents the JavaScript enum/union "BleAndroidErrorCode".
|
|
15
|
-
*/
|
|
16
|
-
@DoNotStrip
|
|
17
|
-
@Keep
|
|
18
|
-
enum class BleAndroidErrorCode {
|
|
19
|
-
NORESOURCES,
|
|
20
|
-
INTERNALERROR,
|
|
21
|
-
WRONGSTATE,
|
|
22
|
-
DBFULL,
|
|
23
|
-
BUSY,
|
|
24
|
-
ERROR,
|
|
25
|
-
CMDSTARTED,
|
|
26
|
-
ILLEGALPARAMETER,
|
|
27
|
-
PENDING,
|
|
28
|
-
AUTHFAIL,
|
|
29
|
-
MORE,
|
|
30
|
-
INVALIDCFG,
|
|
31
|
-
SERVICESTARTED,
|
|
32
|
-
ENCRYPEDNOMITM,
|
|
33
|
-
NOTENCRYPTED,
|
|
34
|
-
CONGESTED;
|
|
35
|
-
|
|
36
|
-
@DoNotStrip
|
|
37
|
-
@Keep
|
|
38
|
-
private val _ordinal = ordinal
|
|
39
|
-
}
|