simplejsble 0.0.21 → 0.0.23

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 (174) hide show
  1. package/NitroSimplejsble.podspec +57 -4
  2. package/app.plugin.js +7 -0
  3. package/ios/CMakeLists.txt +13 -2
  4. package/lib/specs/Adapter.nitro.js +1 -1
  5. package/nitrogen/generated/android/NitroSimplejsble+autolinking.cmake +1 -1
  6. package/nitrogen/generated/android/NitroSimplejsble+autolinking.gradle +1 -1
  7. package/nitrogen/generated/android/NitroSimplejsbleOnLoad.cpp +1 -1
  8. package/nitrogen/generated/android/NitroSimplejsbleOnLoad.hpp +1 -1
  9. package/nitrogen/generated/android/kotlin/com/margelo/nitro/simplejsble/NitroSimplejsbleOnLoad.kt +1 -1
  10. package/nitrogen/generated/ios/NitroSimplejsble+autolinking.rb +1 -1
  11. package/nitrogen/generated/ios/NitroSimplejsble-Swift-Cxx-Bridge.cpp +1 -1
  12. package/nitrogen/generated/ios/NitroSimplejsble-Swift-Cxx-Bridge.hpp +1 -1
  13. package/nitrogen/generated/ios/NitroSimplejsble-Swift-Cxx-Umbrella.hpp +1 -1
  14. package/nitrogen/generated/ios/NitroSimplejsbleAutolinking.mm +1 -1
  15. package/nitrogen/generated/ios/NitroSimplejsbleAutolinking.swift +1 -1
  16. package/nitrogen/generated/shared/c++/HybridAdapterSpec.cpp +1 -1
  17. package/nitrogen/generated/shared/c++/HybridAdapterSpec.hpp +1 -1
  18. package/package.json +4 -7
  19. package/react-native.config.js +0 -4
  20. package/ios/SimpleBLE.xcframework/Info.plist +0 -47
  21. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Adapter.h +0 -102
  22. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/AdapterSafe.h +0 -58
  23. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Advanced.h +0 -50
  24. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Characteristic.h +0 -39
  25. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Config.h +0 -64
  26. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Descriptor.h +0 -30
  27. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Exceptions.h +0 -72
  28. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Logging.h +0 -73
  29. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Peripheral.h +0 -82
  30. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/PeripheralSafe.h +0 -64
  31. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Service.h +0 -34
  32. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/SimpleBLE.h +0 -8
  33. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Types.h +0 -49
  34. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/Utils.h +0 -13
  35. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/export.h +0 -43
  36. package/ios/SimpleBLE.xcframework/ios-arm64/Headers/simpleble/kvn/kvn_bytearray.h +0 -297
  37. package/ios/SimpleBLE.xcframework/ios-arm64/libsimpleble.a +0 -0
  38. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Adapter.h +0 -102
  39. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/AdapterSafe.h +0 -58
  40. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Advanced.h +0 -50
  41. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Characteristic.h +0 -39
  42. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Config.h +0 -64
  43. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Descriptor.h +0 -30
  44. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Exceptions.h +0 -72
  45. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Logging.h +0 -73
  46. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Peripheral.h +0 -82
  47. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/PeripheralSafe.h +0 -64
  48. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Service.h +0 -34
  49. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/SimpleBLE.h +0 -8
  50. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Types.h +0 -49
  51. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/Utils.h +0 -13
  52. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/export.h +0 -43
  53. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/Headers/simpleble/kvn/kvn_bytearray.h +0 -297
  54. package/ios/SimpleBLE.xcframework/ios-arm64-simulator/libsimpleble.a +0 -0
  55. package/ios/build_simpleble.sh +0 -51
  56. package/ios/simpleble_iphoneos_arm64/include/simpleble/Adapter.h +0 -102
  57. package/ios/simpleble_iphoneos_arm64/include/simpleble/AdapterSafe.h +0 -58
  58. package/ios/simpleble_iphoneos_arm64/include/simpleble/Advanced.h +0 -50
  59. package/ios/simpleble_iphoneos_arm64/include/simpleble/Characteristic.h +0 -39
  60. package/ios/simpleble_iphoneos_arm64/include/simpleble/Config.h +0 -64
  61. package/ios/simpleble_iphoneos_arm64/include/simpleble/Descriptor.h +0 -30
  62. package/ios/simpleble_iphoneos_arm64/include/simpleble/Exceptions.h +0 -72
  63. package/ios/simpleble_iphoneos_arm64/include/simpleble/Logging.h +0 -73
  64. package/ios/simpleble_iphoneos_arm64/include/simpleble/Peripheral.h +0 -82
  65. package/ios/simpleble_iphoneos_arm64/include/simpleble/PeripheralSafe.h +0 -64
  66. package/ios/simpleble_iphoneos_arm64/include/simpleble/Service.h +0 -34
  67. package/ios/simpleble_iphoneos_arm64/include/simpleble/SimpleBLE.h +0 -8
  68. package/ios/simpleble_iphoneos_arm64/include/simpleble/Types.h +0 -49
  69. package/ios/simpleble_iphoneos_arm64/include/simpleble/Utils.h +0 -13
  70. package/ios/simpleble_iphoneos_arm64/include/simpleble/export.h +0 -43
  71. package/ios/simpleble_iphoneos_arm64/include/simpleble/kvn/kvn_bytearray.h +0 -297
  72. package/ios/simpleble_iphoneos_arm64/lib/cmake/simpleble/simpleble-config-release.cmake +0 -19
  73. package/ios/simpleble_iphoneos_arm64/lib/cmake/simpleble/simpleble-config.cmake +0 -107
  74. package/ios/simpleble_iphoneos_arm64/lib/libsimpleble.a +0 -0
  75. package/ios/simpleble_iphoneos_arm64/lib/pkgconfig/simpleble.pc +0 -11
  76. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Adapter.h +0 -102
  77. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/AdapterSafe.h +0 -58
  78. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Advanced.h +0 -50
  79. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Characteristic.h +0 -39
  80. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Config.h +0 -64
  81. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Descriptor.h +0 -30
  82. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Exceptions.h +0 -72
  83. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Logging.h +0 -73
  84. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Peripheral.h +0 -82
  85. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/PeripheralSafe.h +0 -64
  86. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Service.h +0 -34
  87. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/SimpleBLE.h +0 -8
  88. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Types.h +0 -49
  89. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/Utils.h +0 -13
  90. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/export.h +0 -43
  91. package/ios/simpleble_iphonesimulator_arm64/include/simpleble/kvn/kvn_bytearray.h +0 -297
  92. package/ios/simpleble_iphonesimulator_arm64/lib/cmake/simpleble/simpleble-config-release.cmake +0 -19
  93. package/ios/simpleble_iphonesimulator_arm64/lib/cmake/simpleble/simpleble-config.cmake +0 -107
  94. package/ios/simpleble_iphonesimulator_arm64/lib/libsimpleble.a +0 -0
  95. package/ios/simpleble_iphonesimulator_arm64/lib/pkgconfig/simpleble.pc +0 -11
  96. package/macos/CMakeLists.txt +0 -21
  97. package/macos/SimpleBLE-macos.xcframework/Info.plist +0 -30
  98. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Adapter.h +0 -102
  99. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/AdapterSafe.h +0 -58
  100. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Advanced.h +0 -50
  101. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Characteristic.h +0 -39
  102. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Config.h +0 -64
  103. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Descriptor.h +0 -30
  104. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Exceptions.h +0 -72
  105. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Logging.h +0 -73
  106. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Peripheral.h +0 -82
  107. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/PeripheralSafe.h +0 -64
  108. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Service.h +0 -34
  109. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/SimpleBLE.h +0 -8
  110. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Types.h +0 -49
  111. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/Utils.h +0 -13
  112. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/export.h +0 -43
  113. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/Headers/simpleble/kvn/kvn_bytearray.h +0 -297
  114. package/macos/SimpleBLE-macos.xcframework/macos-arm64_x86_64/libsimpleble.a +0 -0
  115. package/macos/build_simpleble.sh +0 -61
  116. package/macos/simpleble_macosx_arm64/include/simpleble/Adapter.h +0 -102
  117. package/macos/simpleble_macosx_arm64/include/simpleble/AdapterSafe.h +0 -58
  118. package/macos/simpleble_macosx_arm64/include/simpleble/Advanced.h +0 -50
  119. package/macos/simpleble_macosx_arm64/include/simpleble/Characteristic.h +0 -39
  120. package/macos/simpleble_macosx_arm64/include/simpleble/Config.h +0 -64
  121. package/macos/simpleble_macosx_arm64/include/simpleble/Descriptor.h +0 -30
  122. package/macos/simpleble_macosx_arm64/include/simpleble/Exceptions.h +0 -72
  123. package/macos/simpleble_macosx_arm64/include/simpleble/Logging.h +0 -73
  124. package/macos/simpleble_macosx_arm64/include/simpleble/Peripheral.h +0 -82
  125. package/macos/simpleble_macosx_arm64/include/simpleble/PeripheralSafe.h +0 -64
  126. package/macos/simpleble_macosx_arm64/include/simpleble/Service.h +0 -34
  127. package/macos/simpleble_macosx_arm64/include/simpleble/SimpleBLE.h +0 -8
  128. package/macos/simpleble_macosx_arm64/include/simpleble/Types.h +0 -49
  129. package/macos/simpleble_macosx_arm64/include/simpleble/Utils.h +0 -13
  130. package/macos/simpleble_macosx_arm64/include/simpleble/export.h +0 -43
  131. package/macos/simpleble_macosx_arm64/include/simpleble/kvn/kvn_bytearray.h +0 -297
  132. package/macos/simpleble_macosx_arm64/lib/cmake/simpleble/simpleble-config-release.cmake +0 -19
  133. package/macos/simpleble_macosx_arm64/lib/cmake/simpleble/simpleble-config.cmake +0 -107
  134. package/macos/simpleble_macosx_arm64/lib/libsimpleble.a +0 -0
  135. package/macos/simpleble_macosx_arm64/lib/pkgconfig/simpleble.pc +0 -11
  136. package/macos/simpleble_macosx_universal/include/simpleble/Adapter.h +0 -102
  137. package/macos/simpleble_macosx_universal/include/simpleble/AdapterSafe.h +0 -58
  138. package/macos/simpleble_macosx_universal/include/simpleble/Advanced.h +0 -50
  139. package/macos/simpleble_macosx_universal/include/simpleble/Characteristic.h +0 -39
  140. package/macos/simpleble_macosx_universal/include/simpleble/Config.h +0 -64
  141. package/macos/simpleble_macosx_universal/include/simpleble/Descriptor.h +0 -30
  142. package/macos/simpleble_macosx_universal/include/simpleble/Exceptions.h +0 -72
  143. package/macos/simpleble_macosx_universal/include/simpleble/Logging.h +0 -73
  144. package/macos/simpleble_macosx_universal/include/simpleble/Peripheral.h +0 -82
  145. package/macos/simpleble_macosx_universal/include/simpleble/PeripheralSafe.h +0 -64
  146. package/macos/simpleble_macosx_universal/include/simpleble/Service.h +0 -34
  147. package/macos/simpleble_macosx_universal/include/simpleble/SimpleBLE.h +0 -8
  148. package/macos/simpleble_macosx_universal/include/simpleble/Types.h +0 -49
  149. package/macos/simpleble_macosx_universal/include/simpleble/Utils.h +0 -13
  150. package/macos/simpleble_macosx_universal/include/simpleble/export.h +0 -43
  151. package/macos/simpleble_macosx_universal/include/simpleble/kvn/kvn_bytearray.h +0 -297
  152. package/macos/simpleble_macosx_universal/lib/libsimpleble.a +0 -0
  153. package/macos/simpleble_macosx_x86_64/include/simpleble/Adapter.h +0 -102
  154. package/macos/simpleble_macosx_x86_64/include/simpleble/AdapterSafe.h +0 -58
  155. package/macos/simpleble_macosx_x86_64/include/simpleble/Advanced.h +0 -50
  156. package/macos/simpleble_macosx_x86_64/include/simpleble/Characteristic.h +0 -39
  157. package/macos/simpleble_macosx_x86_64/include/simpleble/Config.h +0 -64
  158. package/macos/simpleble_macosx_x86_64/include/simpleble/Descriptor.h +0 -30
  159. package/macos/simpleble_macosx_x86_64/include/simpleble/Exceptions.h +0 -72
  160. package/macos/simpleble_macosx_x86_64/include/simpleble/Logging.h +0 -73
  161. package/macos/simpleble_macosx_x86_64/include/simpleble/Peripheral.h +0 -82
  162. package/macos/simpleble_macosx_x86_64/include/simpleble/PeripheralSafe.h +0 -64
  163. package/macos/simpleble_macosx_x86_64/include/simpleble/Service.h +0 -34
  164. package/macos/simpleble_macosx_x86_64/include/simpleble/SimpleBLE.h +0 -8
  165. package/macos/simpleble_macosx_x86_64/include/simpleble/Types.h +0 -49
  166. package/macos/simpleble_macosx_x86_64/include/simpleble/Utils.h +0 -13
  167. package/macos/simpleble_macosx_x86_64/include/simpleble/export.h +0 -43
  168. package/macos/simpleble_macosx_x86_64/include/simpleble/kvn/kvn_bytearray.h +0 -297
  169. package/macos/simpleble_macosx_x86_64/lib/cmake/simpleble/simpleble-config-release.cmake +0 -19
  170. package/macos/simpleble_macosx_x86_64/lib/cmake/simpleble/simpleble-config.cmake +0 -107
  171. package/macos/simpleble_macosx_x86_64/lib/libsimpleble.a +0 -0
  172. package/macos/simpleble_macosx_x86_64/lib/pkgconfig/simpleble.pc +0 -11
  173. package/scripts/postinstall.js +0 -138
  174. package/scripts/prepare-package.js +0 -64
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => min_ios_version_supported, :visionos => 1.0, :osx => '13.0' }
13
+ s.platforms = { :ios => min_ios_version_supported, :osx => '13.0' }
14
14
 
15
15
  s.source = { :path => "." }
16
16
 
@@ -22,8 +22,55 @@ Pod::Spec.new do |s|
22
22
  echo "SimpleBLE.xcframework (iOS) already exists, skipping build"
23
23
  else
24
24
  echo "Building SimpleBLE for iOS..."
25
- chmod +x ios/build_simpleble.sh
26
- ios/build_simpleble.sh
25
+ set -e
26
+ IOS_DIR="ios"
27
+ IOS_DEPLOYMENT_TARGET="${IOS_DEPLOYMENT_TARGET:-13.4}"
28
+
29
+ build_for_platform() {
30
+ local PLATFORM=$1 # iphoneos or iphonesimulator
31
+ local ARCH=$2 # arm64 or x86_64
32
+
33
+ local BUILD_DIR="${IOS_DIR}/build_${PLATFORM}_${ARCH}"
34
+ local INSTALL_DIR="${IOS_DIR}/simpleble_${PLATFORM}_${ARCH}"
35
+
36
+ echo "Building SimpleBLE for ${PLATFORM} (${ARCH})..."
37
+
38
+ cmake -B "${BUILD_DIR}" -S "${IOS_DIR}" \
39
+ -DCMAKE_BUILD_TYPE=Release \
40
+ -DCMAKE_SYSTEM_NAME=iOS \
41
+ -DCMAKE_OSX_SYSROOT="${PLATFORM}" \
42
+ -DCMAKE_OSX_ARCHITECTURES="${ARCH}" \
43
+ -DCMAKE_OSX_DEPLOYMENT_TARGET="${IOS_DEPLOYMENT_TARGET}" \
44
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
45
+ -DBUILD_SHARED_LIBS=OFF \
46
+ -DSIMPLEBLE_EXCLUDE_C=ON
47
+
48
+ cmake --build "${BUILD_DIR}" --config Release --parallel
49
+ cmake --install "${BUILD_DIR}" --config Release
50
+
51
+ echo "Installed to ${INSTALL_DIR}"
52
+ }
53
+
54
+ # Build for device
55
+ build_for_platform "iphoneos" "arm64"
56
+
57
+ # Build for simulator (Apple Silicon)
58
+ build_for_platform "iphonesimulator" "arm64"
59
+
60
+ # Create XCFramework from the static libraries
61
+ echo "Creating XCFramework..."
62
+ XCFRAMEWORK_PATH="${IOS_DIR}/SimpleBLE.xcframework"
63
+ rm -rf "${XCFRAMEWORK_PATH}"
64
+
65
+ xcodebuild -create-xcframework \
66
+ -library "${IOS_DIR}/simpleble_iphoneos_arm64/lib/libsimpleble.a" \
67
+ -headers "${IOS_DIR}/simpleble_iphoneos_arm64/include" \
68
+ -library "${IOS_DIR}/simpleble_iphonesimulator_arm64/lib/libsimpleble.a" \
69
+ -headers "${IOS_DIR}/simpleble_iphonesimulator_arm64/include" \
70
+ -output "${XCFRAMEWORK_PATH}"
71
+
72
+ echo "SimpleBLE build complete!"
73
+ echo "XCFramework created at: ${XCFRAMEWORK_PATH}"
27
74
  fi
28
75
 
29
76
  # Build macOS XCFramework if not present
@@ -37,12 +84,18 @@ Pod::Spec.new do |s|
37
84
  CMD
38
85
 
39
86
  s.source_files = [
87
+ # Implementation (Swift)
88
+ "ios/**/*.{swift}",
89
+ "macos/**/*.{swift}",
90
+ # Autolinking/Registration (Objective-C++)
91
+ "ios/**/*.{m,mm}",
92
+ "macos/**/*.{m,mm}",
40
93
  # Implementation (C++ objects)
41
94
  "cpp/**/*.{hpp,cpp}",
42
95
  ]
43
96
 
44
97
  # Exclude CMakeLists.txt from source files
45
- s.exclude_files = ["ios/CMakeLists.txt", "macos/CMakeLists.txt"]
98
+ s.exclude_files = ["ios/CMakeLists.txt"]
46
99
 
47
100
  load 'nitrogen/generated/ios/NitroSimplejsble+autolinking.rb'
48
101
  add_nitrogen_files(s)
package/app.plugin.js ADDED
@@ -0,0 +1,7 @@
1
+ const { withAndroidManifest } = require('@expo/config-plugins');
2
+
3
+ // This plugin ensures Expo autolinking detects the package
4
+ // The actual native module registration is handled by react-native.config.js
5
+ module.exports = function withSimplejsble(config) {
6
+ return config;
7
+ };
@@ -1,7 +1,18 @@
1
1
  cmake_minimum_required(VERSION 3.21)
2
2
 
3
- # Path: packages/simplejsble/ios ../../../.. repo root (where simpleble/ lives)
4
- set(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
3
+ # Determine if we're in the SimpleBLE monorepo or npm package
4
+ # In monorepo: packages/simplejsble/ios → ../../../.. has cmake/
5
+ # In npm: node_modules/simplejsble/ios → .. has cmake/ (bundled)
6
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/prelude.cmake")
7
+ # npm package - bundled cmake
8
+ set(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
9
+ elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/prelude.cmake")
10
+ # Monorepo
11
+ set(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
12
+ else()
13
+ message(FATAL_ERROR "Cannot find SimpleBLE cmake files. Checked:\n ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/prelude.cmake\n ${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/prelude.cmake")
14
+ endif()
15
+
5
16
  set(BUILD_SHARED_LIBS OFF) # Static library for iOS
6
17
 
7
18
  include(${PROJECT_ROOT_DIR}/cmake/prelude.cmake)
@@ -1 +1 @@
1
- export {};
1
+ import {} from 'react-native-nitro-modules';
@@ -2,7 +2,7 @@
2
2
  # NitroSimplejsble+autolinking.cmake
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2025 Marc Rousavy @ Margelo
5
+ # Copyright © 2026 Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a CMake file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsble+autolinking.gradle
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /// This is a Gradle file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsbleOnLoad.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #ifndef BUILDING_NITROSIMPLEJSBLE_WITH_GENERATED_CMAKE_PROJECT
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsbleOnLoad.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include <jni.h>
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsbleOnLoad.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.simplejsble
@@ -2,7 +2,7 @@
2
2
  # NitroSimplejsble+autolinking.rb
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2025 Marc Rousavy @ Margelo
5
+ # Copyright © 2026 Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a Ruby script that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsble-Swift-Cxx-Bridge.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "NitroSimplejsble-Swift-Cxx-Bridge.hpp"
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsble-Swift-Cxx-Bridge.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsble-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsbleAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,7 +2,7 @@
2
2
  /// NitroSimplejsbleAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  public final class NitroSimplejsbleAutolinking {
@@ -2,7 +2,7 @@
2
2
  /// HybridAdapterSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridAdapterSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridAdapterSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simplejsble",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "React Native Bluetooth Low Energy library using SimpleBLE with Nitro Modules",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",
@@ -13,7 +13,6 @@
13
13
  "nitrogen",
14
14
  "android/",
15
15
  "ios/",
16
- "macos/",
17
16
  "cpp/",
18
17
  "simpleble/",
19
18
  "simpledroidbridge/",
@@ -23,14 +22,13 @@
23
22
  "react-native.config.js",
24
23
  "nitro.json",
25
24
  "*.podspec",
26
- "scripts/",
25
+ "app.plugin.js",
27
26
  "README.md"
28
27
  ],
29
28
  "scripts": {
30
29
  "prepack": "node scripts/prepare-package.js",
31
- "postinstall": "node scripts/postinstall.js",
32
30
  "typecheck": "tsc --noEmit",
33
- "build": "tsc --composite false",
31
+ "build": "tsc --noEmit false",
34
32
  "clean": "rm -rf android/build android/.cxx android/.gradle lib",
35
33
  "lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
36
34
  "prepublishOnly": "npm run build",
@@ -45,8 +43,7 @@
45
43
  "nitro",
46
44
  "nitro-modules",
47
45
  "ios",
48
- "android",
49
- "macos"
46
+ "android"
50
47
  ],
51
48
  "repository": {
52
49
  "type": "git",
@@ -11,10 +11,6 @@ module.exports = {
11
11
  * @type {import('@react-native-community/cli-types').AndroidDependencyParams}
12
12
  */
13
13
  android: {},
14
- /**
15
- * macOS uses the same configuration as iOS (shares Apple platform toolchain)
16
- */
17
- macos: {},
18
14
  },
19
15
  },
20
16
  }
@@ -1,47 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>AvailableLibraries</key>
6
- <array>
7
- <dict>
8
- <key>BinaryPath</key>
9
- <string>libsimpleble.a</string>
10
- <key>HeadersPath</key>
11
- <string>Headers</string>
12
- <key>LibraryIdentifier</key>
13
- <string>ios-arm64</string>
14
- <key>LibraryPath</key>
15
- <string>libsimpleble.a</string>
16
- <key>SupportedArchitectures</key>
17
- <array>
18
- <string>arm64</string>
19
- </array>
20
- <key>SupportedPlatform</key>
21
- <string>ios</string>
22
- </dict>
23
- <dict>
24
- <key>BinaryPath</key>
25
- <string>libsimpleble.a</string>
26
- <key>HeadersPath</key>
27
- <string>Headers</string>
28
- <key>LibraryIdentifier</key>
29
- <string>ios-arm64-simulator</string>
30
- <key>LibraryPath</key>
31
- <string>libsimpleble.a</string>
32
- <key>SupportedArchitectures</key>
33
- <array>
34
- <string>arm64</string>
35
- </array>
36
- <key>SupportedPlatform</key>
37
- <string>ios</string>
38
- <key>SupportedPlatformVariant</key>
39
- <string>simulator</string>
40
- </dict>
41
- </array>
42
- <key>CFBundlePackageType</key>
43
- <string>XFWK</string>
44
- <key>XCFrameworkFormatVersion</key>
45
- <string>1.0</string>
46
- </dict>
47
- </plist>
@@ -1,102 +0,0 @@
1
- #pragma once
2
-
3
- #include <functional>
4
- #include <memory>
5
- #include <string>
6
- #include <vector>
7
-
8
- #include <simpleble/export.h>
9
-
10
- #include <simpleble/Exceptions.h>
11
- #include <simpleble/Peripheral.h>
12
- #include <simpleble/Types.h>
13
-
14
- namespace SimpleBLE {
15
-
16
- class AdapterBase;
17
-
18
- /**
19
- * Bluetooth Adapter.
20
- *
21
- * A default-constructed Adapter object is not initialized. Calling any method
22
- * other than `initialized()` on an uninitialized Adapter will throw an exception
23
- * of type `SimpleBLE::NotInitialized`.
24
- *
25
- * NOTE: This class is intended to be used by the user only. Library developers
26
- * should use shared pointers to `AdapterBase` instead.
27
- */
28
- class SIMPLEBLE_EXPORT Adapter {
29
- public:
30
- Adapter() = default;
31
- virtual ~Adapter() = default;
32
-
33
- bool initialized() const;
34
-
35
- /**
36
- * Retrieve the underlying OS object/handle.
37
- *
38
- * For certain compatibility with external libraries, we sometimes need to
39
- * expose the actual OS handle to the user. This is particularly important
40
- * for MacOS right now.
41
- */
42
- void* underlying() const;
43
-
44
- std::string identifier();
45
- BluetoothAddress address();
46
-
47
- /**
48
- * Control the power state of the adapter.
49
- *
50
- * NOTE: The power on/off functionality is only supported on Windows and Linux (implementation pending).
51
- * On other platforms, this method will do nothing.
52
- * NOTE: Callbacks are currently a placeholder for future implementation.
53
- */
54
- void power_on();
55
- void power_off();
56
- bool is_powered();
57
- void set_callback_on_power_on(std::function<void()> on_power_on);
58
- void set_callback_on_power_off(std::function<void()> on_power_off);
59
-
60
- void scan_start();
61
- void scan_stop();
62
- void scan_for(int timeout_ms);
63
- bool scan_is_active();
64
- std::vector<Peripheral> scan_get_results();
65
-
66
- void set_callback_on_scan_start(std::function<void()> on_scan_start);
67
- void set_callback_on_scan_stop(std::function<void()> on_scan_stop);
68
- void set_callback_on_scan_updated(std::function<void(Peripheral)> on_scan_updated);
69
- void set_callback_on_scan_found(std::function<void(Peripheral)> on_scan_found);
70
-
71
- /**
72
- * Retrieve a list of all paired peripherals.
73
- *
74
- * NOTE:This method is currently only supported by the Linux, Windows and Android backends.
75
- */
76
- std::vector<Peripheral> get_paired_peripherals();
77
-
78
- /**
79
- * Retrieve a list of all connected peripherals.
80
- *
81
- * NOTE: This method is currently only supported by the Windows backend. (More backends coming soon.)
82
- */
83
- std::vector<Peripheral> get_connected_peripherals();
84
-
85
- static bool bluetooth_enabled();
86
-
87
- /**
88
- * Fetches a list of all available adapters from all available backends.
89
- *
90
- * This will cause backends to be instantiated/initialized and adapters
91
- * too.
92
- */
93
- static std::vector<Adapter> get_adapters();
94
-
95
- protected:
96
- AdapterBase* operator->();
97
- const AdapterBase* operator->() const;
98
-
99
- std::shared_ptr<AdapterBase> internal_;
100
- };
101
-
102
- } // namespace SimpleBLE
@@ -1,58 +0,0 @@
1
- #pragma once
2
-
3
- #include <simpleble/export.h>
4
-
5
- #include <simpleble/Adapter.h>
6
- #include <simpleble/PeripheralSafe.h>
7
- #include <memory>
8
- #include <optional>
9
- #include <vector>
10
-
11
- namespace SimpleBLE {
12
-
13
- namespace Safe {
14
-
15
- /**
16
- * Wrapper around the Adapter class that provides a noexcept interface.
17
- *
18
- * We use instances of this class directly and not through shared_ptr because
19
- * this is just a wrapper around the Adapter class, which is already managed by
20
- * shared_ptr.
21
- */
22
- class SIMPLEBLE_EXPORT Adapter {
23
- public:
24
- Adapter(SimpleBLE::Adapter& adapter);
25
- Adapter(SimpleBLE::Adapter&& adapter);
26
- virtual ~Adapter() = default;
27
-
28
- std::optional<std::string> identifier() noexcept;
29
- std::optional<BluetoothAddress> address() noexcept;
30
-
31
- bool scan_start() noexcept;
32
- bool scan_stop() noexcept;
33
- bool scan_for(int timeout_ms) noexcept;
34
- std::optional<bool> scan_is_active() noexcept;
35
- std::optional<std::vector<SimpleBLE::Safe::Peripheral>> scan_get_results() noexcept;
36
-
37
- bool set_callback_on_scan_start(std::function<void()> on_scan_start) noexcept;
38
- bool set_callback_on_scan_stop(std::function<void()> on_scan_stop) noexcept;
39
- bool set_callback_on_scan_updated(std::function<void(SimpleBLE::Safe::Peripheral)> on_scan_updated) noexcept;
40
- bool set_callback_on_scan_found(std::function<void(SimpleBLE::Safe::Peripheral)> on_scan_found) noexcept;
41
-
42
- std::optional<std::vector<SimpleBLE::Safe::Peripheral>> get_paired_peripherals() noexcept;
43
-
44
- static std::optional<bool> bluetooth_enabled() noexcept;
45
- static std::optional<std::vector<SimpleBLE::Safe::Adapter>> get_adapters() noexcept;
46
-
47
- /**
48
- * Cast to the underlying adapter object.
49
- */
50
- operator SimpleBLE::Adapter() const noexcept;
51
-
52
- protected:
53
- SimpleBLE::Adapter internal_;
54
- };
55
-
56
- } // namespace Safe
57
-
58
- } // namespace SimpleBLE
@@ -1,50 +0,0 @@
1
- #pragma once
2
-
3
- #include <simpleble/export.h>
4
-
5
- #if __APPLE__
6
- #include "TargetConditionals.h"
7
- #endif
8
-
9
- /**
10
- * Advanced Features
11
- *
12
- * The functions presented in this namespace are OS-specific backdoors that are
13
- * not part of the standard SimpleBLE API, which allow the user to access
14
- * low-level details of the implementation for advanced use cases.
15
- *
16
- * These functions should be used with caution.
17
- */
18
-
19
- #if defined(_WIN32)
20
- namespace SimpleBLE::Advanced::Windows {}
21
-
22
- #endif
23
-
24
- #if TARGET_OS_OSX
25
- namespace SimpleBLE::Advanced::MacOS {}
26
-
27
- #endif
28
-
29
- #if TARGET_OS_IOS
30
- namespace SimpleBLE::Advanced::iOS {}
31
-
32
- #endif
33
-
34
- #if defined(__ANDROID__)
35
-
36
- #include <jni.h>
37
-
38
- namespace SimpleBLE::Advanced::Android {
39
-
40
- JavaVM* SIMPLEBLE_EXPORT get_jvm();
41
- void SIMPLEBLE_EXPORT set_jvm(JavaVM* jvm);
42
-
43
- } // namespace SimpleBLE::Advanced::Android
44
-
45
- #endif
46
-
47
- #if defined(__linux__) && !defined(__ANDROID__)
48
- namespace SimpleBLE::Advanced::Linux {}
49
-
50
- #endif
@@ -1,39 +0,0 @@
1
- #pragma once
2
-
3
- #include <memory>
4
-
5
- #include <simpleble/export.h>
6
-
7
- #include <simpleble/Descriptor.h>
8
- #include <simpleble/Exceptions.h>
9
- #include <simpleble/Types.h>
10
-
11
- namespace SimpleBLE {
12
-
13
- class CharacteristicBase;
14
-
15
- class SIMPLEBLE_EXPORT Characteristic {
16
- public:
17
- Characteristic() = default;
18
- virtual ~Characteristic() = default;
19
-
20
- bool initialized() const;
21
-
22
- BluetoothUUID uuid();
23
- std::vector<Descriptor> descriptors();
24
- std::vector<std::string> capabilities();
25
-
26
- bool can_read();
27
- bool can_write_request();
28
- bool can_write_command();
29
- bool can_notify();
30
- bool can_indicate();
31
-
32
- protected:
33
- CharacteristicBase* operator->();
34
- const CharacteristicBase* operator->() const;
35
-
36
- std::shared_ptr<CharacteristicBase> internal_;
37
- };
38
-
39
- } // namespace SimpleBLE
@@ -1,64 +0,0 @@
1
- #pragma once
2
- #include <chrono>
3
-
4
- namespace SimpleBLE {
5
- namespace Config {
6
- namespace SimpleBluez {
7
- extern bool use_legacy_bluez_backend;
8
- extern std::chrono::steady_clock::duration connection_timeout;
9
- extern std::chrono::steady_clock::duration disconnection_timeout;
10
-
11
- static void reset() {
12
- use_legacy_bluez_backend = true;
13
- connection_timeout = std::chrono::seconds(2);
14
- disconnection_timeout = std::chrono::seconds(1);
15
- }
16
- }
17
-
18
- namespace WinRT {
19
- extern bool experimental_use_own_mta_apartment;
20
- extern bool experimental_reinitialize_winrt_apartment_on_main_thread;
21
-
22
- static void reset() {
23
- experimental_use_own_mta_apartment = true;
24
- experimental_reinitialize_winrt_apartment_on_main_thread = false;
25
- }
26
- }
27
-
28
- namespace CoreBluetooth {
29
- static void reset() {}
30
- }
31
-
32
- namespace Android {
33
- enum class ConnectionPriorityRequest {
34
- DISABLED = -1,
35
- BALANCED = 0,
36
- HIGH = 1,
37
- LOW_POWER = 2,
38
- DCK = 3
39
- };
40
-
41
- extern ConnectionPriorityRequest connection_priority_request;
42
-
43
- static void reset() {
44
- connection_priority_request = ConnectionPriorityRequest::DISABLED;
45
- }
46
- }
47
-
48
- namespace Dongl {
49
- extern bool use_dongl_backend;
50
- static void reset() {
51
- use_dongl_backend = false;
52
- }
53
- }
54
-
55
- namespace Base {
56
- static void reset_all() {
57
- SimpleBluez::reset();
58
- WinRT::reset();
59
- CoreBluetooth::reset();
60
- Android::reset();
61
- }
62
- }
63
- } // namespace Config
64
- } // namespace SimpleBLE