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.
Files changed (290) hide show
  1. package/android/build.gradle +3 -0
  2. package/android/src/main/kotlin/{co → com/margelo/nitro/co}/zyke/ble/BleNitroBleManager.kt +111 -2
  3. package/app.plugin.cjs +1 -0
  4. package/ios/BleNitroBleManager.swift +66 -0
  5. package/ios/BleNitroModule.swift +2 -9
  6. package/lib/BleManagerCompatFactory.d.ts +5 -4
  7. package/lib/BleManagerCompatFactory.js +9 -6
  8. package/lib/BleManagerFactory.d.ts +21 -3
  9. package/lib/BleManagerFactory.js +53 -2
  10. package/lib/commonjs/BleManagerCompatFactory.d.ts +56 -0
  11. package/lib/commonjs/BleManagerCompatFactory.d.ts.map +1 -0
  12. package/lib/commonjs/BleManagerCompatFactory.js +201 -0
  13. package/lib/commonjs/BleManagerCompatFactory.js.map +1 -0
  14. package/lib/commonjs/BleManagerFactory.d.ts +31 -0
  15. package/lib/commonjs/BleManagerFactory.d.ts.map +1 -0
  16. package/lib/commonjs/BleManagerFactory.js +81 -0
  17. package/lib/commonjs/BleManagerFactory.js.map +1 -0
  18. package/lib/commonjs/compatibility/constants.d.ts +50 -0
  19. package/lib/commonjs/compatibility/constants.d.ts.map +1 -0
  20. package/lib/commonjs/compatibility/constants.js +58 -0
  21. package/lib/commonjs/compatibility/constants.js.map +1 -0
  22. package/lib/commonjs/compatibility/deviceWrapper.d.ts +100 -0
  23. package/lib/commonjs/compatibility/deviceWrapper.d.ts.map +1 -0
  24. package/lib/commonjs/compatibility/deviceWrapper.js +268 -0
  25. package/lib/commonjs/compatibility/deviceWrapper.js.map +1 -0
  26. package/lib/commonjs/compatibility/enums.d.ts +39 -0
  27. package/lib/commonjs/compatibility/enums.d.ts.map +1 -0
  28. package/lib/commonjs/compatibility/enums.js +179 -0
  29. package/lib/commonjs/compatibility/enums.js.map +1 -0
  30. package/lib/commonjs/compatibility/index.d.ts +13 -0
  31. package/lib/commonjs/compatibility/index.d.ts.map +1 -0
  32. package/lib/commonjs/compatibility/index.js +41 -0
  33. package/lib/commonjs/compatibility/index.js.map +1 -0
  34. package/lib/commonjs/compatibility/serviceData.d.ts +52 -0
  35. package/lib/commonjs/compatibility/serviceData.d.ts.map +1 -0
  36. package/lib/commonjs/compatibility/serviceData.js +80 -0
  37. package/lib/commonjs/compatibility/serviceData.js.map +1 -0
  38. package/lib/commonjs/errors/BleError.d.ts +60 -0
  39. package/lib/commonjs/errors/BleError.d.ts.map +1 -0
  40. package/lib/commonjs/errors/BleError.js +125 -0
  41. package/lib/commonjs/errors/BleError.js.map +1 -0
  42. package/lib/commonjs/index.d.ts +11 -0
  43. package/lib/commonjs/index.d.ts.map +1 -0
  44. package/lib/commonjs/index.js +42 -0
  45. package/lib/commonjs/index.js.map +1 -0
  46. package/lib/commonjs/specs/BleManager.nitro.d.ts +45 -0
  47. package/lib/commonjs/specs/BleManager.nitro.d.ts.map +1 -0
  48. package/lib/commonjs/specs/BleManager.nitro.js +3 -0
  49. package/lib/commonjs/specs/BleManager.nitro.js.map +1 -0
  50. package/lib/commonjs/specs/Characteristic.nitro.d.ts +27 -0
  51. package/lib/commonjs/specs/Characteristic.nitro.d.ts.map +1 -0
  52. package/lib/commonjs/specs/Characteristic.nitro.js +3 -0
  53. package/lib/commonjs/specs/Characteristic.nitro.js.map +1 -0
  54. package/lib/commonjs/specs/Descriptor.nitro.d.ts +18 -0
  55. package/lib/commonjs/specs/Descriptor.nitro.d.ts.map +1 -0
  56. package/lib/commonjs/specs/Descriptor.nitro.js +3 -0
  57. package/lib/commonjs/specs/Descriptor.nitro.js.map +1 -0
  58. package/lib/commonjs/specs/Device.nitro.d.ts +38 -0
  59. package/lib/commonjs/specs/Device.nitro.d.ts.map +1 -0
  60. package/lib/commonjs/specs/Device.nitro.js +3 -0
  61. package/lib/commonjs/specs/Device.nitro.js.map +1 -0
  62. package/lib/commonjs/specs/Service.nitro.d.ts +20 -0
  63. package/lib/commonjs/specs/Service.nitro.d.ts.map +1 -0
  64. package/lib/commonjs/specs/Service.nitro.js +3 -0
  65. package/lib/commonjs/specs/Service.nitro.js.map +1 -0
  66. package/lib/commonjs/specs/types.d.ts +229 -0
  67. package/lib/commonjs/specs/types.d.ts.map +1 -0
  68. package/lib/commonjs/specs/types.js +150 -0
  69. package/lib/commonjs/specs/types.js.map +1 -0
  70. package/lib/commonjs/utils/base64.d.ts +26 -0
  71. package/lib/commonjs/utils/base64.d.ts.map +1 -0
  72. package/lib/commonjs/utils/base64.js +88 -0
  73. package/lib/commonjs/utils/base64.js.map +1 -0
  74. package/lib/commonjs/utils/index.d.ts +3 -0
  75. package/lib/commonjs/utils/index.d.ts.map +1 -0
  76. package/lib/commonjs/utils/index.js +19 -0
  77. package/lib/commonjs/utils/index.js.map +1 -0
  78. package/lib/commonjs/utils/uuid.d.ts +10 -0
  79. package/lib/commonjs/utils/uuid.d.ts.map +1 -0
  80. package/lib/commonjs/utils/uuid.js +41 -0
  81. package/lib/commonjs/utils/uuid.js.map +1 -0
  82. package/lib/compatibility/constants.d.ts +1 -1
  83. package/lib/compatibility/constants.js +1 -1
  84. package/lib/compatibility/deviceWrapper.d.ts +2 -2
  85. package/lib/compatibility/deviceWrapper.js +2 -2
  86. package/lib/compatibility/enums.d.ts +1 -1
  87. package/lib/compatibility/enums.js +1 -1
  88. package/lib/compatibility/index.d.ts +5 -5
  89. package/lib/compatibility/index.js +4 -4
  90. package/lib/compatibility/serviceData.d.ts +1 -1
  91. package/lib/errors/BleError.d.ts +2 -2
  92. package/lib/errors/BleError.js +1 -1
  93. package/lib/index.d.ts +10 -9
  94. package/lib/index.js +9 -7
  95. package/lib/specs/BleManager.nitro.d.ts +9 -1
  96. package/lib/specs/Characteristic.nitro.d.ts +1 -1
  97. package/lib/specs/Descriptor.nitro.d.ts +1 -1
  98. package/lib/specs/Device.nitro.d.ts +1 -1
  99. package/lib/specs/Service.nitro.d.ts +1 -1
  100. package/nitro.json +6 -1
  101. package/nitrogen/generated/.gitattributes +1 -0
  102. package/nitrogen/generated/android/BleNitro+autolinking.cmake +86 -0
  103. package/nitrogen/generated/android/BleNitro+autolinking.gradle +27 -0
  104. package/nitrogen/generated/android/BleNitroOnLoad.cpp +62 -0
  105. package/nitrogen/generated/android/BleNitroOnLoad.hpp +25 -0
  106. package/nitrogen/generated/android/c++/JBleATTErrorCode.hpp +107 -0
  107. package/nitrogen/generated/android/c++/JBleAndroidErrorCode.hpp +101 -0
  108. package/nitrogen/generated/android/c++/JBleErrorCode.hpp +170 -0
  109. package/nitrogen/generated/android/c++/JBleIOSErrorCode.hpp +92 -0
  110. package/nitrogen/generated/android/c++/JBleManagerNitroOptions.hpp +54 -0
  111. package/nitrogen/generated/android/c++/JBleRestoredState.hpp +76 -0
  112. package/nitrogen/generated/android/c++/JCharacteristicSubscriptionType.hpp +59 -0
  113. package/nitrogen/generated/android/c++/JConnectionOptions.hpp +61 -0
  114. package/nitrogen/generated/android/c++/JConnectionPriority.hpp +62 -0
  115. package/nitrogen/generated/android/c++/JFunc_void.hpp +74 -0
  116. package/nitrogen/generated/android/c++/JFunc_void_State.hpp +76 -0
  117. package/nitrogen/generated/android/c++/JFunc_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.hpp +88 -0
  118. package/nitrogen/generated/android/c++/JFunc_void_std__optional_NativeBleError__std__optional_NativeDevice_.hpp +91 -0
  119. package/nitrogen/generated/android/c++/JHybridBleManagerSpec.cpp +653 -0
  120. package/nitrogen/generated/android/c++/JHybridBleManagerSpec.hpp +92 -0
  121. package/nitrogen/generated/android/c++/JHybridCharacteristicSpec.cpp +253 -0
  122. package/nitrogen/generated/android/c++/JHybridCharacteristicSpec.hpp +79 -0
  123. package/nitrogen/generated/android/c++/JHybridDescriptorSpec.cpp +115 -0
  124. package/nitrogen/generated/android/c++/JHybridDescriptorSpec.hpp +70 -0
  125. package/nitrogen/generated/android/c++/JHybridDeviceSpec.cpp +476 -0
  126. package/nitrogen/generated/android/c++/JHybridDeviceSpec.hpp +90 -0
  127. package/nitrogen/generated/android/c++/JHybridServiceSpec.cpp +232 -0
  128. package/nitrogen/generated/android/c++/JHybridServiceSpec.hpp +72 -0
  129. package/nitrogen/generated/android/c++/JLogLevel.hpp +71 -0
  130. package/nitrogen/generated/android/c++/JNativeBleError.hpp +98 -0
  131. package/nitrogen/generated/android/c++/JNativeCharacteristic.hpp +98 -0
  132. package/nitrogen/generated/android/c++/JNativeDescriptor.hpp +82 -0
  133. package/nitrogen/generated/android/c++/JNativeDevice.hpp +173 -0
  134. package/nitrogen/generated/android/c++/JNativeService.hpp +65 -0
  135. package/nitrogen/generated/android/c++/JScanCallbackType.hpp +62 -0
  136. package/nitrogen/generated/android/c++/JScanMode.hpp +65 -0
  137. package/nitrogen/generated/android/c++/JScanOptions.hpp +69 -0
  138. package/nitrogen/generated/android/c++/JServiceDataEntry.hpp +57 -0
  139. package/nitrogen/generated/android/c++/JState.hpp +71 -0
  140. package/nitrogen/generated/android/c++/JSubscription.hpp +64 -0
  141. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleATTErrorCode.kt +41 -0
  142. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleAndroidErrorCode.kt +39 -0
  143. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleErrorCode.kt +62 -0
  144. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleIOSErrorCode.kt +36 -0
  145. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleManagerNitroOptions.kt +26 -0
  146. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleNitroOnLoad.kt +35 -0
  147. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/BleRestoredState.kt +26 -0
  148. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/CharacteristicSubscriptionType.kt +25 -0
  149. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ConnectionOptions.kt +28 -0
  150. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ConnectionPriority.kt +26 -0
  151. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void.kt +80 -0
  152. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_State.kt +80 -0
  153. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.kt +80 -0
  154. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Func_void_std__optional_NativeBleError__std__optional_NativeDevice_.kt +80 -0
  155. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridBleManagerSpec.kt +192 -0
  156. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridCharacteristicSpec.kt +127 -0
  157. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridDescriptorSpec.kt +86 -0
  158. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridDeviceSpec.kt +176 -0
  159. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridServiceSpec.kt +99 -0
  160. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/LogLevel.kt +29 -0
  161. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeBleError.kt +35 -0
  162. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeCharacteristic.kt +37 -0
  163. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeDescriptor.kt +33 -0
  164. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeDevice.kt +38 -0
  165. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/NativeService.kt +29 -0
  166. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanCallbackType.kt +26 -0
  167. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanMode.kt +27 -0
  168. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanOptions.kt +29 -0
  169. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ServiceDataEntry.kt +27 -0
  170. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/State.kt +29 -0
  171. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/Subscription.kt +30 -0
  172. package/nitrogen/generated/ios/BleNitro+autolinking.rb +60 -0
  173. package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.cpp +236 -0
  174. package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp +1069 -0
  175. package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Umbrella.hpp +131 -0
  176. package/nitrogen/generated/ios/BleNitroAutolinking.mm +33 -0
  177. package/nitrogen/generated/ios/BleNitroAutolinking.swift +25 -0
  178. package/nitrogen/generated/ios/c++/HybridBleManagerSpecSwift.cpp +11 -0
  179. package/nitrogen/generated/ios/c++/HybridBleManagerSpecSwift.hpp +377 -0
  180. package/nitrogen/generated/ios/c++/HybridCharacteristicSpecSwift.cpp +11 -0
  181. package/nitrogen/generated/ios/c++/HybridCharacteristicSpecSwift.hpp +192 -0
  182. package/nitrogen/generated/ios/c++/HybridDescriptorSpecSwift.cpp +11 -0
  183. package/nitrogen/generated/ios/c++/HybridDescriptorSpecSwift.hpp +112 -0
  184. package/nitrogen/generated/ios/c++/HybridDeviceSpecSwift.cpp +11 -0
  185. package/nitrogen/generated/ios/c++/HybridDeviceSpecSwift.hpp +294 -0
  186. package/nitrogen/generated/ios/c++/HybridServiceSpecSwift.cpp +11 -0
  187. package/nitrogen/generated/ios/c++/HybridServiceSpecSwift.hpp +170 -0
  188. package/nitrogen/generated/ios/swift/BleATTErrorCode.swift +104 -0
  189. package/nitrogen/generated/ios/swift/BleAndroidErrorCode.swift +96 -0
  190. package/nitrogen/generated/ios/swift/BleErrorCode.swift +188 -0
  191. package/nitrogen/generated/ios/swift/BleIOSErrorCode.swift +84 -0
  192. package/nitrogen/generated/ios/swift/BleManagerNitroOptions.swift +53 -0
  193. package/nitrogen/generated/ios/swift/BleRestoredState.swift +47 -0
  194. package/nitrogen/generated/ios/swift/CharacteristicSubscriptionType.swift +40 -0
  195. package/nitrogen/generated/ios/swift/ConnectionOptions.swift +57 -0
  196. package/nitrogen/generated/ios/swift/ConnectionPriority.swift +44 -0
  197. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  198. package/nitrogen/generated/ios/swift/Func_void_LogLevel.swift +46 -0
  199. package/nitrogen/generated/ios/swift/Func_void_NativeCharacteristic.swift +46 -0
  200. package/nitrogen/generated/ios/swift/Func_void_NativeDescriptor.swift +46 -0
  201. package/nitrogen/generated/ios/swift/Func_void_NativeDevice.swift +46 -0
  202. package/nitrogen/generated/ios/swift/Func_void_State.swift +46 -0
  203. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  204. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  205. package/nitrogen/generated/ios/swift/Func_void_std__optional_BleRestoredState_.swift +52 -0
  206. package/nitrogen/generated/ios/swift/Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_.swift +58 -0
  207. package/nitrogen/generated/ios/swift/Func_void_std__optional_NativeBleError__std__optional_NativeDevice_.swift +58 -0
  208. package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_.swift +50 -0
  209. package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_.swift +50 -0
  210. package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeCharacteristic_.swift +46 -0
  211. package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeDescriptor_.swift +46 -0
  212. package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeDevice_.swift +46 -0
  213. package/nitrogen/generated/ios/swift/Func_void_std__vector_NativeService_.swift +46 -0
  214. package/nitrogen/generated/ios/swift/HybridBleManagerSpec.swift +78 -0
  215. package/nitrogen/generated/ios/swift/HybridBleManagerSpec_cxx.swift +852 -0
  216. package/nitrogen/generated/ios/swift/HybridCharacteristicSpec.swift +65 -0
  217. package/nitrogen/generated/ios/swift/HybridCharacteristicSpec_cxx.swift +384 -0
  218. package/nitrogen/generated/ios/swift/HybridDescriptorSpec.swift +56 -0
  219. package/nitrogen/generated/ios/swift/HybridDescriptorSpec_cxx.swift +218 -0
  220. package/nitrogen/generated/ios/swift/HybridDeviceSpec.swift +76 -0
  221. package/nitrogen/generated/ios/swift/HybridDeviceSpec_cxx.swift +702 -0
  222. package/nitrogen/generated/ios/swift/HybridServiceSpec.swift +58 -0
  223. package/nitrogen/generated/ios/swift/HybridServiceSpec_cxx.swift +338 -0
  224. package/nitrogen/generated/ios/swift/LogLevel.swift +56 -0
  225. package/nitrogen/generated/ios/swift/NativeBleError.swift +278 -0
  226. package/nitrogen/generated/ios/swift/NativeCharacteristic.swift +174 -0
  227. package/nitrogen/generated/ios/swift/NativeDescriptor.swift +130 -0
  228. package/nitrogen/generated/ios/swift/NativeDevice.swift +377 -0
  229. package/nitrogen/generated/ios/swift/NativeService.swift +68 -0
  230. package/nitrogen/generated/ios/swift/ScanCallbackType.swift +44 -0
  231. package/nitrogen/generated/ios/swift/ScanMode.swift +48 -0
  232. package/nitrogen/generated/ios/swift/ScanOptions.swift +116 -0
  233. package/nitrogen/generated/ios/swift/ServiceDataEntry.swift +46 -0
  234. package/nitrogen/generated/ios/swift/State.swift +56 -0
  235. package/nitrogen/generated/ios/swift/Subscription.swift +46 -0
  236. package/nitrogen/generated/shared/c++/BleATTErrorCode.hpp +80 -0
  237. package/nitrogen/generated/shared/c++/BleAndroidErrorCode.hpp +78 -0
  238. package/nitrogen/generated/shared/c++/BleErrorCode.hpp +101 -0
  239. package/nitrogen/generated/shared/c++/BleIOSErrorCode.hpp +75 -0
  240. package/nitrogen/generated/shared/c++/BleManagerNitroOptions.hpp +70 -0
  241. package/nitrogen/generated/shared/c++/BleRestoredState.hpp +71 -0
  242. package/nitrogen/generated/shared/c++/CharacteristicSubscriptionType.hpp +64 -0
  243. package/nitrogen/generated/shared/c++/ConnectionOptions.hpp +77 -0
  244. package/nitrogen/generated/shared/c++/ConnectionPriority.hpp +65 -0
  245. package/nitrogen/generated/shared/c++/HybridBleManagerSpec.cpp +51 -0
  246. package/nitrogen/generated/shared/c++/HybridBleManagerSpec.hpp +137 -0
  247. package/nitrogen/generated/shared/c++/HybridCharacteristicSpec.cpp +39 -0
  248. package/nitrogen/generated/shared/c++/HybridCharacteristicSpec.hpp +101 -0
  249. package/nitrogen/generated/shared/c++/HybridDescriptorSpec.cpp +30 -0
  250. package/nitrogen/generated/shared/c++/HybridDescriptorSpec.hpp +75 -0
  251. package/nitrogen/generated/shared/c++/HybridDeviceSpec.cpp +50 -0
  252. package/nitrogen/generated/shared/c++/HybridDeviceSpec.hpp +123 -0
  253. package/nitrogen/generated/shared/c++/HybridServiceSpec.cpp +32 -0
  254. package/nitrogen/generated/shared/c++/HybridServiceSpec.hpp +90 -0
  255. package/nitrogen/generated/shared/c++/LogLevel.hpp +68 -0
  256. package/nitrogen/generated/shared/c++/NativeBleError.hpp +117 -0
  257. package/nitrogen/generated/shared/c++/NativeCharacteristic.hpp +114 -0
  258. package/nitrogen/generated/shared/c++/NativeDescriptor.hpp +98 -0
  259. package/nitrogen/generated/shared/c++/NativeDevice.hpp +121 -0
  260. package/nitrogen/generated/shared/c++/NativeService.hpp +81 -0
  261. package/nitrogen/generated/shared/c++/ScanCallbackType.hpp +65 -0
  262. package/nitrogen/generated/shared/c++/ScanMode.hpp +66 -0
  263. package/nitrogen/generated/shared/c++/ScanOptions.hpp +86 -0
  264. package/nitrogen/generated/shared/c++/ServiceDataEntry.hpp +73 -0
  265. package/nitrogen/generated/shared/c++/State.hpp +68 -0
  266. package/nitrogen/generated/shared/c++/Subscription.hpp +69 -0
  267. package/package.json +15 -14
  268. package/plugin/build/index.d.ts +1 -1
  269. package/plugin/build/index.js +42 -4
  270. package/plugin/build/withBleNitro.d.ts +1 -1
  271. package/plugin/build/withBleNitro.js +16 -11
  272. package/react-native.config.js +2 -7
  273. package/src/BleManagerCompatFactory.ts +10 -10
  274. package/src/BleManagerFactory.ts +68 -5
  275. package/src/__tests__/BleManager.test.ts +2 -2
  276. package/src/__tests__/compatibility/enums.test.ts +0 -1
  277. package/src/compatibility/constants.ts +1 -1
  278. package/src/compatibility/deviceWrapper.ts +4 -4
  279. package/src/compatibility/enums.ts +1 -1
  280. package/src/compatibility/index.ts +5 -5
  281. package/src/compatibility/serviceData.ts +1 -1
  282. package/src/errors/BleError.ts +2 -2
  283. package/src/index.ts +12 -9
  284. package/src/specs/BleManager.nitro.ts +17 -4
  285. package/src/specs/Characteristic.nitro.ts +1 -1
  286. package/src/specs/Descriptor.nitro.ts +1 -1
  287. package/src/specs/Device.nitro.ts +1 -1
  288. package/src/specs/Service.nitro.ts +1 -1
  289. package/android/src/main/kotlin/co/zyke/ble/BleNitroPackage.kt +0 -37
  290. package/ios/BleNitro.podspec +0 -37
@@ -0,0 +1,35 @@
1
+ ///
2
+ /// NativeBleError.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NativeBleError".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NativeBleError
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val errorCode: BleErrorCode,
24
+ val attErrorCode: BleATTErrorCode?,
25
+ val iosErrorCode: BleIOSErrorCode?,
26
+ val androidErrorCode: BleAndroidErrorCode?,
27
+ val reason: String?,
28
+ val deviceID: String?,
29
+ val serviceUUID: String?,
30
+ val characteristicUUID: String?,
31
+ val descriptorUUID: String?,
32
+ val internalMessage: String?
33
+ ) {
34
+ /* main constructor */
35
+ }
@@ -0,0 +1,37 @@
1
+ ///
2
+ /// NativeCharacteristic.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NativeCharacteristic".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NativeCharacteristic
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val id: Double,
24
+ val uuid: String,
25
+ val serviceID: Double,
26
+ val serviceUUID: String,
27
+ val deviceID: String,
28
+ val isReadable: Boolean,
29
+ val isWritableWithResponse: Boolean,
30
+ val isWritableWithoutResponse: Boolean,
31
+ val isNotifiable: Boolean,
32
+ val isNotifying: Boolean,
33
+ val isIndicatable: Boolean,
34
+ val value: String?
35
+ ) {
36
+ /* main constructor */
37
+ }
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// NativeDescriptor.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NativeDescriptor".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NativeDescriptor
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val id: Double,
24
+ val uuid: String,
25
+ val characteristicID: Double,
26
+ val characteristicUUID: String,
27
+ val serviceID: Double,
28
+ val serviceUUID: String,
29
+ val deviceID: String,
30
+ val value: String?
31
+ ) {
32
+ /* main constructor */
33
+ }
@@ -0,0 +1,38 @@
1
+ ///
2
+ /// NativeDevice.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NativeDevice".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NativeDevice
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val id: String,
24
+ val name: String?,
25
+ val rssi: Double?,
26
+ val mtu: Double,
27
+ val manufacturerData: String?,
28
+ val rawScanRecord: String,
29
+ val serviceData: Array<ServiceDataEntry>?,
30
+ val serviceUUIDs: Array<String>?,
31
+ val localName: String?,
32
+ val txPowerLevel: Double?,
33
+ val solicitedServiceUUIDs: Array<String>?,
34
+ val isConnectable: Boolean?,
35
+ val overflowServiceUUIDs: Array<String>?
36
+ ) {
37
+ /* main constructor */
38
+ }
@@ -0,0 +1,29 @@
1
+ ///
2
+ /// NativeService.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "NativeService".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class NativeService
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val id: Double,
24
+ val uuid: String,
25
+ val deviceID: String,
26
+ val isPrimary: Boolean
27
+ ) {
28
+ /* main constructor */
29
+ }
@@ -0,0 +1,26 @@
1
+ ///
2
+ /// ScanCallbackType.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 "ScanCallbackType".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class ScanCallbackType {
19
+ ALLMATCHES,
20
+ FIRSTMATCH,
21
+ MATCHLOST;
22
+
23
+ @DoNotStrip
24
+ @Keep
25
+ private val _ordinal = ordinal
26
+ }
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// ScanMode.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 "ScanMode".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class ScanMode {
19
+ OPPORTUNISTIC,
20
+ LOWPOWER,
21
+ BALANCED,
22
+ LOWLATENCY;
23
+
24
+ @DoNotStrip
25
+ @Keep
26
+ private val _ordinal = ordinal
27
+ }
@@ -0,0 +1,29 @@
1
+ ///
2
+ /// ScanOptions.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "ScanOptions".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class ScanOptions
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val allowDuplicates: Boolean?,
24
+ val scanMode: ScanMode?,
25
+ val callbackType: ScanCallbackType?,
26
+ val legacyScan: Boolean?
27
+ ) {
28
+ /* main constructor */
29
+ }
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// ServiceDataEntry.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "ServiceDataEntry".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class ServiceDataEntry
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val uuid: String,
24
+ val data: String
25
+ ) {
26
+ /* main constructor */
27
+ }
@@ -0,0 +1,29 @@
1
+ ///
2
+ /// State.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 "State".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class State {
19
+ UNKNOWN,
20
+ RESETTING,
21
+ UNSUPPORTED,
22
+ UNAUTHORIZED,
23
+ POWEREDOFF,
24
+ POWEREDON;
25
+
26
+ @DoNotStrip
27
+ @Keep
28
+ private val _ordinal = ordinal
29
+ }
@@ -0,0 +1,30 @@
1
+ ///
2
+ /// Subscription.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
+ import com.margelo.nitro.core.*
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "Subscription".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class Subscription
20
+ @DoNotStrip
21
+ @Keep
22
+ constructor(
23
+ val remove: () -> Unit
24
+ ) {
25
+ @DoNotStrip
26
+ @Keep
27
+ @Suppress("unused")
28
+ private constructor(remove: Func_void)
29
+ : this(remove as () -> Unit)
30
+ }
@@ -0,0 +1,60 @@
1
+ #
2
+ # BleNitro+autolinking.rb
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
+ # This is a Ruby script that adds all files generated by Nitrogen
9
+ # to the given podspec.
10
+ #
11
+ # To use it, add this to your .podspec:
12
+ # ```ruby
13
+ # Pod::Spec.new do |spec|
14
+ # # ...
15
+ #
16
+ # # Add all files generated by Nitrogen
17
+ # load 'nitrogen/generated/ios/BleNitro+autolinking.rb'
18
+ # add_nitrogen_files(spec)
19
+ # end
20
+ # ```
21
+
22
+ def add_nitrogen_files(spec)
23
+ Pod::UI.puts "[NitroModules] 🔥 BleNitro is boosted by nitro!"
24
+
25
+ spec.dependency "NitroModules"
26
+
27
+ current_source_files = Array(spec.attributes_hash['source_files'])
28
+ spec.source_files = current_source_files + [
29
+ # Generated cross-platform specs
30
+ "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
31
+ # Generated bridges for the cross-platform specs
32
+ "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
33
+ ]
34
+
35
+ current_public_header_files = Array(spec.attributes_hash['public_header_files'])
36
+ spec.public_header_files = current_public_header_files + [
37
+ # Generated specs
38
+ "nitrogen/generated/shared/**/*.{h,hpp}",
39
+ # Swift to C++ bridging helpers
40
+ "nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp"
41
+ ]
42
+
43
+ current_private_header_files = Array(spec.attributes_hash['private_header_files'])
44
+ spec.private_header_files = current_private_header_files + [
45
+ # iOS specific specs
46
+ "nitrogen/generated/ios/c++/**/*.{h,hpp}",
47
+ # Views are framework-specific and should be private
48
+ "nitrogen/generated/shared/**/views/**/*"
49
+ ]
50
+
51
+ current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
52
+ spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
+ # Use C++ 20
54
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
+ # Enables C++ <-> Swift interop (by default it's only C)
56
+ "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
+ # Enables stricter modular headers
58
+ "DEFINES_MODULE" => "YES",
59
+ })
60
+ end
@@ -0,0 +1,236 @@
1
+ ///
2
+ /// BleNitro-Swift-Cxx-Bridge.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 "BleNitro-Swift-Cxx-Bridge.hpp"
9
+
10
+ // Include C++ implementation defined types
11
+ #include "BleNitro-Swift-Cxx-Umbrella.hpp"
12
+ #include "HybridBleManagerSpecSwift.hpp"
13
+ #include "HybridCharacteristicSpecSwift.hpp"
14
+ #include "HybridDescriptorSpecSwift.hpp"
15
+ #include "HybridDeviceSpecSwift.hpp"
16
+ #include "HybridServiceSpecSwift.hpp"
17
+
18
+ namespace margelo::nitro::co::zyke::ble::bridge::swift {
19
+
20
+ // pragma MARK: std::function<void()>
21
+ Func_void create_Func_void(void* _Nonnull swiftClosureWrapper) {
22
+ auto swiftClosure = BleNitro::Func_void::fromUnsafe(swiftClosureWrapper);
23
+ return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
24
+ swiftClosure.call();
25
+ };
26
+ }
27
+
28
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
29
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) {
30
+ auto swiftClosure = BleNitro::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
31
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
32
+ swiftClosure.call(error);
33
+ };
34
+ }
35
+
36
+ // pragma MARK: std::function<void(const std::optional<BleRestoredState>& /* result */)>
37
+ Func_void_std__optional_BleRestoredState_ create_Func_void_std__optional_BleRestoredState_(void* _Nonnull swiftClosureWrapper) {
38
+ auto swiftClosure = BleNitro::Func_void_std__optional_BleRestoredState_::fromUnsafe(swiftClosureWrapper);
39
+ return [swiftClosure = std::move(swiftClosure)](const std::optional<BleRestoredState>& result) mutable -> void {
40
+ swiftClosure.call(result);
41
+ };
42
+ }
43
+
44
+ // pragma MARK: std::function<void(LogLevel /* result */)>
45
+ Func_void_LogLevel create_Func_void_LogLevel(void* _Nonnull swiftClosureWrapper) {
46
+ auto swiftClosure = BleNitro::Func_void_LogLevel::fromUnsafe(swiftClosureWrapper);
47
+ return [swiftClosure = std::move(swiftClosure)](LogLevel result) mutable -> void {
48
+ swiftClosure.call(static_cast<int>(result));
49
+ };
50
+ }
51
+
52
+ // pragma MARK: std::function<void(State /* result */)>
53
+ Func_void_State create_Func_void_State(void* _Nonnull swiftClosureWrapper) {
54
+ auto swiftClosure = BleNitro::Func_void_State::fromUnsafe(swiftClosureWrapper);
55
+ return [swiftClosure = std::move(swiftClosure)](State result) mutable -> void {
56
+ swiftClosure.call(static_cast<int>(result));
57
+ };
58
+ }
59
+
60
+ // pragma MARK: std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeDevice>& /* scannedDevice */)>
61
+ Func_void_std__optional_NativeBleError__std__optional_NativeDevice_ create_Func_void_std__optional_NativeBleError__std__optional_NativeDevice_(void* _Nonnull swiftClosureWrapper) {
62
+ auto swiftClosure = BleNitro::Func_void_std__optional_NativeBleError__std__optional_NativeDevice_::fromUnsafe(swiftClosureWrapper);
63
+ return [swiftClosure = std::move(swiftClosure)](const std::optional<NativeBleError>& error, const std::optional<NativeDevice>& scannedDevice) mutable -> void {
64
+ swiftClosure.call(error, scannedDevice);
65
+ };
66
+ }
67
+
68
+ // pragma MARK: std::function<void(const NativeDevice& /* result */)>
69
+ Func_void_NativeDevice create_Func_void_NativeDevice(void* _Nonnull swiftClosureWrapper) {
70
+ auto swiftClosure = BleNitro::Func_void_NativeDevice::fromUnsafe(swiftClosureWrapper);
71
+ return [swiftClosure = std::move(swiftClosure)](const NativeDevice& result) mutable -> void {
72
+ swiftClosure.call(result);
73
+ };
74
+ }
75
+
76
+ // pragma MARK: std::function<void(const std::vector<NativeDevice>& /* result */)>
77
+ Func_void_std__vector_NativeDevice_ create_Func_void_std__vector_NativeDevice_(void* _Nonnull swiftClosureWrapper) {
78
+ auto swiftClosure = BleNitro::Func_void_std__vector_NativeDevice_::fromUnsafe(swiftClosureWrapper);
79
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<NativeDevice>& result) mutable -> void {
80
+ swiftClosure.call(result);
81
+ };
82
+ }
83
+
84
+ // pragma MARK: std::function<void(bool /* result */)>
85
+ Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper) {
86
+ auto swiftClosure = BleNitro::Func_void_bool::fromUnsafe(swiftClosureWrapper);
87
+ return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
88
+ swiftClosure.call(result);
89
+ };
90
+ }
91
+
92
+ // pragma MARK: std::function<void(const std::vector<NativeService>& /* result */)>
93
+ Func_void_std__vector_NativeService_ create_Func_void_std__vector_NativeService_(void* _Nonnull swiftClosureWrapper) {
94
+ auto swiftClosure = BleNitro::Func_void_std__vector_NativeService_::fromUnsafe(swiftClosureWrapper);
95
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<NativeService>& result) mutable -> void {
96
+ swiftClosure.call(result);
97
+ };
98
+ }
99
+
100
+ // pragma MARK: std::function<void(const std::vector<NativeCharacteristic>& /* result */)>
101
+ Func_void_std__vector_NativeCharacteristic_ create_Func_void_std__vector_NativeCharacteristic_(void* _Nonnull swiftClosureWrapper) {
102
+ auto swiftClosure = BleNitro::Func_void_std__vector_NativeCharacteristic_::fromUnsafe(swiftClosureWrapper);
103
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<NativeCharacteristic>& result) mutable -> void {
104
+ swiftClosure.call(result);
105
+ };
106
+ }
107
+
108
+ // pragma MARK: std::function<void(const NativeCharacteristic& /* result */)>
109
+ Func_void_NativeCharacteristic create_Func_void_NativeCharacteristic(void* _Nonnull swiftClosureWrapper) {
110
+ auto swiftClosure = BleNitro::Func_void_NativeCharacteristic::fromUnsafe(swiftClosureWrapper);
111
+ return [swiftClosure = std::move(swiftClosure)](const NativeCharacteristic& result) mutable -> void {
112
+ swiftClosure.call(result);
113
+ };
114
+ }
115
+
116
+ // pragma MARK: std::function<void(const std::optional<NativeBleError>& /* error */, const std::optional<NativeCharacteristic>& /* characteristic */)>
117
+ Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_ create_Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_(void* _Nonnull swiftClosureWrapper) {
118
+ auto swiftClosure = BleNitro::Func_void_std__optional_NativeBleError__std__optional_NativeCharacteristic_::fromUnsafe(swiftClosureWrapper);
119
+ return [swiftClosure = std::move(swiftClosure)](const std::optional<NativeBleError>& error, const std::optional<NativeCharacteristic>& characteristic) mutable -> void {
120
+ swiftClosure.call(error, characteristic);
121
+ };
122
+ }
123
+
124
+ // pragma MARK: std::function<void(const std::vector<NativeDescriptor>& /* result */)>
125
+ Func_void_std__vector_NativeDescriptor_ create_Func_void_std__vector_NativeDescriptor_(void* _Nonnull swiftClosureWrapper) {
126
+ auto swiftClosure = BleNitro::Func_void_std__vector_NativeDescriptor_::fromUnsafe(swiftClosureWrapper);
127
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<NativeDescriptor>& result) mutable -> void {
128
+ swiftClosure.call(result);
129
+ };
130
+ }
131
+
132
+ // pragma MARK: std::function<void(const NativeDescriptor& /* result */)>
133
+ Func_void_NativeDescriptor create_Func_void_NativeDescriptor(void* _Nonnull swiftClosureWrapper) {
134
+ auto swiftClosure = BleNitro::Func_void_NativeDescriptor::fromUnsafe(swiftClosureWrapper);
135
+ return [swiftClosure = std::move(swiftClosure)](const NativeDescriptor& result) mutable -> void {
136
+ swiftClosure.call(result);
137
+ };
138
+ }
139
+
140
+ // pragma MARK: std::shared_ptr<margelo::nitro::co::zyke::ble::HybridBleManagerSpec>
141
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridBleManagerSpec> create_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridBleManagerSpec_(void* _Nonnull swiftUnsafePointer) {
142
+ BleNitro::HybridBleManagerSpec_cxx swiftPart = BleNitro::HybridBleManagerSpec_cxx::fromUnsafe(swiftUnsafePointer);
143
+ return std::make_shared<margelo::nitro::co::zyke::ble::HybridBleManagerSpecSwift>(swiftPart);
144
+ }
145
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridBleManagerSpec_(std__shared_ptr_margelo__nitro__co__zyke__ble__HybridBleManagerSpec_ cppType) {
146
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridBleManagerSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridBleManagerSpecSwift>(cppType);
147
+ #ifdef NITRO_DEBUG
148
+ if (swiftWrapper == nullptr) [[unlikely]] {
149
+ throw std::runtime_error("Class \"HybridBleManagerSpec\" is not implemented in Swift!");
150
+ }
151
+ #endif
152
+ BleNitro::HybridBleManagerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
153
+ return swiftPart.toUnsafe();
154
+ }
155
+
156
+ // pragma MARK: std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec>
157
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec> create_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_(void* _Nonnull swiftUnsafePointer) {
158
+ BleNitro::HybridCharacteristicSpec_cxx swiftPart = BleNitro::HybridCharacteristicSpec_cxx::fromUnsafe(swiftUnsafePointer);
159
+ return std::make_shared<margelo::nitro::co::zyke::ble::HybridCharacteristicSpecSwift>(swiftPart);
160
+ }
161
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_(std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_ cppType) {
162
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridCharacteristicSpecSwift>(cppType);
163
+ #ifdef NITRO_DEBUG
164
+ if (swiftWrapper == nullptr) [[unlikely]] {
165
+ throw std::runtime_error("Class \"HybridCharacteristicSpec\" is not implemented in Swift!");
166
+ }
167
+ #endif
168
+ BleNitro::HybridCharacteristicSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
169
+ return swiftPart.toUnsafe();
170
+ }
171
+
172
+ // pragma MARK: std::function<void(const std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec>& /* result */)>
173
+ Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_ create_Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_(void* _Nonnull swiftClosureWrapper) {
174
+ auto swiftClosure = BleNitro::Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridCharacteristicSpec_::fromUnsafe(swiftClosureWrapper);
175
+ return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr<margelo::nitro::co::zyke::ble::HybridCharacteristicSpec>& result) mutable -> void {
176
+ swiftClosure.call(result);
177
+ };
178
+ }
179
+
180
+ // pragma MARK: std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpec>
181
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpec> create_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_(void* _Nonnull swiftUnsafePointer) {
182
+ BleNitro::HybridDescriptorSpec_cxx swiftPart = BleNitro::HybridDescriptorSpec_cxx::fromUnsafe(swiftUnsafePointer);
183
+ return std::make_shared<margelo::nitro::co::zyke::ble::HybridDescriptorSpecSwift>(swiftPart);
184
+ }
185
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_(std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_ cppType) {
186
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridDescriptorSpecSwift>(cppType);
187
+ #ifdef NITRO_DEBUG
188
+ if (swiftWrapper == nullptr) [[unlikely]] {
189
+ throw std::runtime_error("Class \"HybridDescriptorSpec\" is not implemented in Swift!");
190
+ }
191
+ #endif
192
+ BleNitro::HybridDescriptorSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
193
+ return swiftPart.toUnsafe();
194
+ }
195
+
196
+ // pragma MARK: std::function<void(const std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpec>& /* result */)>
197
+ Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_ create_Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_(void* _Nonnull swiftClosureWrapper) {
198
+ auto swiftClosure = BleNitro::Func_void_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDescriptorSpec_::fromUnsafe(swiftClosureWrapper);
199
+ return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDescriptorSpec>& result) mutable -> void {
200
+ swiftClosure.call(result);
201
+ };
202
+ }
203
+
204
+ // pragma MARK: std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDeviceSpec>
205
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDeviceSpec> create_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDeviceSpec_(void* _Nonnull swiftUnsafePointer) {
206
+ BleNitro::HybridDeviceSpec_cxx swiftPart = BleNitro::HybridDeviceSpec_cxx::fromUnsafe(swiftUnsafePointer);
207
+ return std::make_shared<margelo::nitro::co::zyke::ble::HybridDeviceSpecSwift>(swiftPart);
208
+ }
209
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDeviceSpec_(std__shared_ptr_margelo__nitro__co__zyke__ble__HybridDeviceSpec_ cppType) {
210
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridDeviceSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridDeviceSpecSwift>(cppType);
211
+ #ifdef NITRO_DEBUG
212
+ if (swiftWrapper == nullptr) [[unlikely]] {
213
+ throw std::runtime_error("Class \"HybridDeviceSpec\" is not implemented in Swift!");
214
+ }
215
+ #endif
216
+ BleNitro::HybridDeviceSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
217
+ return swiftPart.toUnsafe();
218
+ }
219
+
220
+ // pragma MARK: std::shared_ptr<margelo::nitro::co::zyke::ble::HybridServiceSpec>
221
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridServiceSpec> create_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridServiceSpec_(void* _Nonnull swiftUnsafePointer) {
222
+ BleNitro::HybridServiceSpec_cxx swiftPart = BleNitro::HybridServiceSpec_cxx::fromUnsafe(swiftUnsafePointer);
223
+ return std::make_shared<margelo::nitro::co::zyke::ble::HybridServiceSpecSwift>(swiftPart);
224
+ }
225
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__co__zyke__ble__HybridServiceSpec_(std__shared_ptr_margelo__nitro__co__zyke__ble__HybridServiceSpec_ cppType) {
226
+ std::shared_ptr<margelo::nitro::co::zyke::ble::HybridServiceSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::co::zyke::ble::HybridServiceSpecSwift>(cppType);
227
+ #ifdef NITRO_DEBUG
228
+ if (swiftWrapper == nullptr) [[unlikely]] {
229
+ throw std::runtime_error("Class \"HybridServiceSpec\" is not implemented in Swift!");
230
+ }
231
+ #endif
232
+ BleNitro::HybridServiceSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
233
+ return swiftPart.toUnsafe();
234
+ }
235
+
236
+ } // namespace margelo::nitro::co::zyke::ble::bridge::swift