react-native-ble-nitro 1.1.0 → 1.3.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.
Files changed (71) hide show
  1. package/README.md +87 -20
  2. package/android/CMakeLists.txt +32 -0
  3. package/android/build.gradle +140 -0
  4. package/android/fix-prefab.gradle +51 -0
  5. package/android/gradle.properties +5 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  8. package/android/src/main/java/com/margelo/nitro/co/zyke/ble/BleNitroBleManager.kt +899 -0
  9. package/android/src/main/java/com/margelo/nitro/co/zyke/ble/BleNitroPackage.kt +38 -0
  10. package/ios/BleNitroBleManager.swift +56 -17
  11. package/ios/BlePeripheralDelegate.swift +36 -8
  12. package/lib/commonjs/index.d.ts +22 -9
  13. package/lib/commonjs/index.d.ts.map +1 -1
  14. package/lib/commonjs/index.js +63 -12
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/specs/NativeBleNitro.nitro.d.ts +14 -5
  17. package/lib/commonjs/specs/NativeBleNitro.nitro.d.ts.map +1 -1
  18. package/lib/commonjs/specs/NativeBleNitro.nitro.js +8 -1
  19. package/lib/commonjs/specs/NativeBleNitro.nitro.js.map +1 -1
  20. package/lib/index.d.ts +22 -9
  21. package/lib/index.js +61 -10
  22. package/lib/specs/NativeBleNitro.nitro.d.ts +14 -5
  23. package/lib/specs/NativeBleNitro.nitro.js +7 -0
  24. package/nitrogen/generated/android/BleNitroOnLoad.cpp +6 -6
  25. package/nitrogen/generated/android/c++/JAndroidScanMode.hpp +65 -0
  26. package/nitrogen/generated/android/c++/JBLEDevice.hpp +3 -0
  27. package/nitrogen/generated/android/c++/JFunc_void_bool_std__shared_ptr_ArrayBuffer__std__string.hpp +78 -0
  28. package/nitrogen/generated/android/c++/JFunc_void_std__optional_BLEDevice__std__optional_std__string_.hpp +86 -0
  29. package/nitrogen/generated/android/c++/JFunc_void_std__string_std__shared_ptr_ArrayBuffer_.hpp +78 -0
  30. package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.cpp +29 -20
  31. package/nitrogen/generated/android/c++/JHybridNativeBleNitroSpec.hpp +5 -4
  32. package/nitrogen/generated/android/c++/JManufacturerData.hpp +3 -0
  33. package/nitrogen/generated/android/c++/JManufacturerDataEntry.hpp +7 -15
  34. package/nitrogen/generated/android/c++/JScanFilter.hpp +8 -2
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/AndroidScanMode.kt +23 -0
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_bool_std__vector_double__std__string.kt → Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.kt} +12 -12
  37. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_BLEDevice.kt → Func_void_std__optional_BLEDevice__std__optional_std__string_.kt} +14 -14
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/{Func_void_std__string_std__vector_double_.kt → Func_void_std__string_std__shared_ptr_ArrayBuffer_.kt} +12 -12
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/HybridNativeBleNitroSpec.kt +12 -8
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ManufacturerDataEntry.kt +1 -1
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/co/zyke/ble/ScanFilter.kt +4 -1
  42. package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.cpp +15 -15
  43. package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Bridge.hpp +69 -56
  44. package/nitrogen/generated/ios/BleNitro-Swift-Cxx-Umbrella.hpp +6 -0
  45. package/nitrogen/generated/ios/c++/HybridNativeBleNitroSpecSwift.hpp +23 -6
  46. package/nitrogen/generated/ios/swift/AndroidScanMode.swift +48 -0
  47. package/nitrogen/generated/ios/swift/{Func_void_bool_std__vector_double__std__string.swift → Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.swift} +11 -11
  48. package/nitrogen/generated/ios/swift/Func_void_std__optional_BLEDevice__std__optional_std__string_.swift +59 -0
  49. package/nitrogen/generated/ios/swift/{Func_void_std__string_std__vector_double_.swift → Func_void_std__string_std__shared_ptr_ArrayBuffer_.swift} +11 -11
  50. package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec.swift +5 -4
  51. package/nitrogen/generated/ios/swift/HybridNativeBleNitroSpec_cxx.swift +41 -29
  52. package/nitrogen/generated/ios/swift/ManufacturerDataEntry.swift +5 -17
  53. package/nitrogen/generated/ios/swift/ScanFilter.swift +13 -2
  54. package/nitrogen/generated/shared/c++/AndroidScanMode.hpp +64 -0
  55. package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.cpp +1 -0
  56. package/nitrogen/generated/shared/c++/HybridNativeBleNitroSpec.hpp +10 -6
  57. package/nitrogen/generated/shared/c++/ManufacturerDataEntry.hpp +8 -7
  58. package/nitrogen/generated/shared/c++/ScanFilter.hpp +9 -3
  59. package/package.json +1 -1
  60. package/plugin/build/index.d.ts +2 -0
  61. package/plugin/build/index.js +2 -0
  62. package/plugin/build/withBleNitro.d.ts +5 -1
  63. package/plugin/build/withBleNitro.js +18 -7
  64. package/react-native.config.js +10 -2
  65. package/src/__tests__/index.test.ts +48 -13
  66. package/src/index.ts +74 -16
  67. package/src/specs/NativeBleNitro.nitro.ts +17 -5
  68. package/nitrogen/generated/android/c++/JFunc_void_BLEDevice.hpp +0 -82
  69. package/nitrogen/generated/android/c++/JFunc_void_bool_std__vector_double__std__string.hpp +0 -86
  70. package/nitrogen/generated/android/c++/JFunc_void_std__string_std__vector_double_.hpp +0 -86
  71. package/nitrogen/generated/ios/swift/Func_void_BLEDevice.swift +0 -47
@@ -13,12 +13,16 @@ namespace margelo::nitro::co::zyke::ble { struct BLEDevice; }
13
13
  namespace margelo::nitro::co::zyke::ble { struct ManufacturerData; }
14
14
  // Forward declaration of `ManufacturerDataEntry` to properly resolve imports.
15
15
  namespace margelo::nitro::co::zyke::ble { struct ManufacturerDataEntry; }
16
+ // Forward declaration of `ArrayBuffer` to properly resolve imports.
17
+ namespace NitroModules { class ArrayBuffer; }
16
18
  // Forward declaration of `BLEState` to properly resolve imports.
17
19
  namespace margelo::nitro::co::zyke::ble { enum class BLEState; }
18
20
  // Forward declaration of `OperationResult` to properly resolve imports.
19
21
  namespace margelo::nitro::co::zyke::ble { struct OperationResult; }
20
22
  // Forward declaration of `ScanFilter` to properly resolve imports.
21
23
  namespace margelo::nitro::co::zyke::ble { struct ScanFilter; }
24
+ // Forward declaration of `AndroidScanMode` to properly resolve imports.
25
+ namespace margelo::nitro::co::zyke::ble { enum class AndroidScanMode; }
22
26
 
23
27
  #include "BLEDevice.hpp"
24
28
  #include <vector>
@@ -28,6 +32,9 @@ namespace margelo::nitro::co::zyke::ble { struct ScanFilter; }
28
32
  #include "JManufacturerData.hpp"
29
33
  #include "ManufacturerDataEntry.hpp"
30
34
  #include "JManufacturerDataEntry.hpp"
35
+ #include <NitroModules/ArrayBuffer.hpp>
36
+ #include <NitroModules/JArrayBuffer.hpp>
37
+ #include <NitroModules/JUnit.hpp>
31
38
  #include "BLEState.hpp"
32
39
  #include "JBLEState.hpp"
33
40
  #include "OperationResult.hpp"
@@ -37,13 +44,15 @@ namespace margelo::nitro::co::zyke::ble { struct ScanFilter; }
37
44
  #include <NitroModules/JPromise.hpp>
38
45
  #include "ScanFilter.hpp"
39
46
  #include "JScanFilter.hpp"
47
+ #include "AndroidScanMode.hpp"
48
+ #include "JAndroidScanMode.hpp"
40
49
  #include <functional>
41
- #include "JFunc_void_BLEDevice.hpp"
50
+ #include "JFunc_void_std__optional_BLEDevice__std__optional_std__string_.hpp"
42
51
  #include "JFunc_void_bool_std__string_std__string.hpp"
43
52
  #include "JFunc_void_std__string_bool_std__string.hpp"
44
53
  #include "JFunc_void_bool_std__string.hpp"
45
- #include "JFunc_void_bool_std__vector_double__std__string.hpp"
46
- #include "JFunc_void_std__string_std__vector_double_.hpp"
54
+ #include "JFunc_void_bool_std__shared_ptr_ArrayBuffer__std__string.hpp"
55
+ #include "JFunc_void_std__string_std__shared_ptr_ArrayBuffer_.hpp"
47
56
  #include "JFunc_void_BLEState.hpp"
48
57
 
49
58
  namespace margelo::nitro::co::zyke::ble {
@@ -72,9 +81,9 @@ namespace margelo::nitro::co::zyke::ble {
72
81
 
73
82
 
74
83
  // Methods
75
- void JHybridNativeBleNitroSpec::startScan(const ScanFilter& filter, const std::function<void(const BLEDevice& /* device */)>& callback) {
76
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JScanFilter> /* filter */, jni::alias_ref<JFunc_void_BLEDevice::javaobject> /* callback */)>("startScan_cxx");
77
- method(_javaPart, JScanFilter::fromCpp(filter), JFunc_void_BLEDevice_cxx::fromCpp(callback));
84
+ void JHybridNativeBleNitroSpec::startScan(const ScanFilter& filter, const std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>& callback) {
85
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JScanFilter> /* filter */, jni::alias_ref<JFunc_void_std__optional_BLEDevice__std__optional_std__string_::javaobject> /* callback */)>("startScan_cxx");
86
+ method(_javaPart, JScanFilter::fromCpp(filter), JFunc_void_std__optional_BLEDevice__std__optional_std__string__cxx::fromCpp(callback));
78
87
  }
79
88
  bool JHybridNativeBleNitroSpec::stopScan() {
80
89
  static const auto method = javaClassStatic()->getMethod<jboolean()>("stopScan");
@@ -121,6 +130,11 @@ namespace margelo::nitro::co::zyke::ble {
121
130
  auto __result = method(_javaPart, jni::make_jstring(deviceId));
122
131
  return static_cast<bool>(__result);
123
132
  }
133
+ double JHybridNativeBleNitroSpec::requestMTU(const std::string& deviceId, double mtu) {
134
+ static const auto method = javaClassStatic()->getMethod<double(jni::alias_ref<jni::JString> /* deviceId */, double /* mtu */)>("requestMTU");
135
+ auto __result = method(_javaPart, jni::make_jstring(deviceId), mtu);
136
+ return __result;
137
+ }
124
138
  void JHybridNativeBleNitroSpec::discoverServices(const std::string& deviceId, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) {
125
139
  static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<JFunc_void_bool_std__string::javaobject> /* callback */)>("discoverServices_cxx");
126
140
  method(_javaPart, jni::make_jstring(deviceId), JFunc_void_bool_std__string_cxx::fromCpp(callback));
@@ -153,22 +167,17 @@ namespace margelo::nitro::co::zyke::ble {
153
167
  return __vector;
154
168
  }();
155
169
  }
156
- void JHybridNativeBleNitroSpec::readCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(bool /* success */, const std::vector<double>& /* data */, const std::string& /* error */)>& callback) {
157
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<JFunc_void_bool_std__vector_double__std__string::javaobject> /* callback */)>("readCharacteristic_cxx");
158
- method(_javaPart, jni::make_jstring(deviceId), jni::make_jstring(serviceId), jni::make_jstring(characteristicId), JFunc_void_bool_std__vector_double__std__string_cxx::fromCpp(callback));
170
+ void JHybridNativeBleNitroSpec::readCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>& callback) {
171
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<JFunc_void_bool_std__shared_ptr_ArrayBuffer__std__string::javaobject> /* callback */)>("readCharacteristic_cxx");
172
+ method(_javaPart, jni::make_jstring(deviceId), jni::make_jstring(serviceId), jni::make_jstring(characteristicId), JFunc_void_bool_std__shared_ptr_ArrayBuffer__std__string_cxx::fromCpp(callback));
159
173
  }
160
- void JHybridNativeBleNitroSpec::writeCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::vector<double>& data, bool withResponse, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) {
161
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<jni::JArrayDouble> /* data */, jboolean /* withResponse */, jni::alias_ref<JFunc_void_bool_std__string::javaobject> /* callback */)>("writeCharacteristic_cxx");
162
- method(_javaPart, jni::make_jstring(deviceId), jni::make_jstring(serviceId), jni::make_jstring(characteristicId), [&]() {
163
- size_t __size = data.size();
164
- jni::local_ref<jni::JArrayDouble> __array = jni::JArrayDouble::newArray(__size);
165
- __array->setRegion(0, __size, data.data());
166
- return __array;
167
- }(), withResponse, JFunc_void_bool_std__string_cxx::fromCpp(callback));
174
+ void JHybridNativeBleNitroSpec::writeCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::shared_ptr<ArrayBuffer>& data, bool withResponse, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) {
175
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<JArrayBuffer::javaobject> /* data */, jboolean /* withResponse */, jni::alias_ref<JFunc_void_bool_std__string::javaobject> /* callback */)>("writeCharacteristic_cxx");
176
+ method(_javaPart, jni::make_jstring(deviceId), jni::make_jstring(serviceId), jni::make_jstring(characteristicId), JArrayBuffer::wrap(data), withResponse, JFunc_void_bool_std__string_cxx::fromCpp(callback));
168
177
  }
169
- void JHybridNativeBleNitroSpec::subscribeToCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(const std::string& /* characteristicId */, const std::vector<double>& /* data */)>& updateCallback, const std::function<void(bool /* success */, const std::string& /* error */)>& resultCallback) {
170
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<JFunc_void_std__string_std__vector_double_::javaobject> /* updateCallback */, jni::alias_ref<JFunc_void_bool_std__string::javaobject> /* resultCallback */)>("subscribeToCharacteristic_cxx");
171
- method(_javaPart, jni::make_jstring(deviceId), jni::make_jstring(serviceId), jni::make_jstring(characteristicId), JFunc_void_std__string_std__vector_double__cxx::fromCpp(updateCallback), JFunc_void_bool_std__string_cxx::fromCpp(resultCallback));
178
+ void JHybridNativeBleNitroSpec::subscribeToCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>& updateCallback, const std::function<void(bool /* success */, const std::string& /* error */)>& resultCallback) {
179
+ static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<JFunc_void_std__string_std__shared_ptr_ArrayBuffer_::javaobject> /* updateCallback */, jni::alias_ref<JFunc_void_bool_std__string::javaobject> /* resultCallback */)>("subscribeToCharacteristic_cxx");
180
+ method(_javaPart, jni::make_jstring(deviceId), jni::make_jstring(serviceId), jni::make_jstring(characteristicId), JFunc_void_std__string_std__shared_ptr_ArrayBuffer__cxx::fromCpp(updateCallback), JFunc_void_bool_std__string_cxx::fromCpp(resultCallback));
172
181
  }
173
182
  void JHybridNativeBleNitroSpec::unsubscribeFromCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) {
174
183
  static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* deviceId */, jni::alias_ref<jni::JString> /* serviceId */, jni::alias_ref<jni::JString> /* characteristicId */, jni::alias_ref<JFunc_void_bool_std__string::javaobject> /* callback */)>("unsubscribeFromCharacteristic_cxx");
@@ -53,19 +53,20 @@ namespace margelo::nitro::co::zyke::ble {
53
53
 
54
54
  public:
55
55
  // Methods
56
- void startScan(const ScanFilter& filter, const std::function<void(const BLEDevice& /* device */)>& callback) override;
56
+ void startScan(const ScanFilter& filter, const std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>& callback) override;
57
57
  bool stopScan() override;
58
58
  bool isScanning() override;
59
59
  std::vector<BLEDevice> getConnectedDevices(const std::vector<std::string>& services) override;
60
60
  void connect(const std::string& deviceId, const std::function<void(bool /* success */, const std::string& /* deviceId */, const std::string& /* error */)>& callback, const std::optional<std::function<void(const std::string& /* deviceId */, bool /* interrupted */, const std::string& /* error */)>>& disconnectCallback) override;
61
61
  void disconnect(const std::string& deviceId, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) override;
62
62
  bool isConnected(const std::string& deviceId) override;
63
+ double requestMTU(const std::string& deviceId, double mtu) override;
63
64
  void discoverServices(const std::string& deviceId, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) override;
64
65
  std::vector<std::string> getServices(const std::string& deviceId) override;
65
66
  std::vector<std::string> getCharacteristics(const std::string& deviceId, const std::string& serviceId) override;
66
- void readCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(bool /* success */, const std::vector<double>& /* data */, const std::string& /* error */)>& callback) override;
67
- void writeCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::vector<double>& data, bool withResponse, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) override;
68
- void subscribeToCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(const std::string& /* characteristicId */, const std::vector<double>& /* data */)>& updateCallback, const std::function<void(bool /* success */, const std::string& /* error */)>& resultCallback) override;
67
+ void readCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>& callback) override;
68
+ void writeCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::shared_ptr<ArrayBuffer>& data, bool withResponse, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) override;
69
+ void subscribeToCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>& updateCallback, const std::function<void(bool /* success */, const std::string& /* error */)>& resultCallback) override;
69
70
  void unsubscribeFromCharacteristic(const std::string& deviceId, const std::string& serviceId, const std::string& characteristicId, const std::function<void(bool /* success */, const std::string& /* error */)>& callback) override;
70
71
  void requestBluetoothEnable(const std::function<void(bool /* success */, const std::string& /* error */)>& callback) override;
71
72
  BLEState state() override;
@@ -12,6 +12,9 @@
12
12
 
13
13
  #include "JManufacturerDataEntry.hpp"
14
14
  #include "ManufacturerDataEntry.hpp"
15
+ #include <NitroModules/ArrayBuffer.hpp>
16
+ #include <NitroModules/JArrayBuffer.hpp>
17
+ #include <NitroModules/JUnit.hpp>
15
18
  #include <string>
16
19
  #include <vector>
17
20
 
@@ -10,8 +10,10 @@
10
10
  #include <fbjni/fbjni.h>
11
11
  #include "ManufacturerDataEntry.hpp"
12
12
 
13
+ #include <NitroModules/ArrayBuffer.hpp>
14
+ #include <NitroModules/JArrayBuffer.hpp>
15
+ #include <NitroModules/JUnit.hpp>
13
16
  #include <string>
14
- #include <vector>
15
17
 
16
18
  namespace margelo::nitro::co::zyke::ble {
17
19
 
@@ -34,16 +36,11 @@ namespace margelo::nitro::co::zyke::ble {
34
36
  static const auto clazz = javaClassStatic();
35
37
  static const auto fieldId = clazz->getField<jni::JString>("id");
36
38
  jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
37
- static const auto fieldData = clazz->getField<jni::JArrayDouble>("data");
38
- jni::local_ref<jni::JArrayDouble> data = this->getFieldValue(fieldData);
39
+ static const auto fieldData = clazz->getField<JArrayBuffer::javaobject>("data");
40
+ jni::local_ref<JArrayBuffer::javaobject> data = this->getFieldValue(fieldData);
39
41
  return ManufacturerDataEntry(
40
42
  id->toStdString(),
41
- [&]() {
42
- size_t __size = data->size();
43
- std::vector<double> __vector(__size);
44
- data->getRegion(0, __size, __vector.data());
45
- return __vector;
46
- }()
43
+ data->cthis()->getArrayBuffer()
47
44
  );
48
45
  }
49
46
 
@@ -55,12 +52,7 @@ namespace margelo::nitro::co::zyke::ble {
55
52
  static jni::local_ref<JManufacturerDataEntry::javaobject> fromCpp(const ManufacturerDataEntry& value) {
56
53
  return newInstance(
57
54
  jni::make_jstring(value.id),
58
- [&]() {
59
- size_t __size = value.data.size();
60
- jni::local_ref<jni::JArrayDouble> __array = jni::JArrayDouble::newArray(__size);
61
- __array->setRegion(0, __size, value.data.data());
62
- return __array;
63
- }()
55
+ JArrayBuffer::wrap(value.data)
64
56
  );
65
57
  }
66
58
  };
@@ -10,6 +10,8 @@
10
10
  #include <fbjni/fbjni.h>
11
11
  #include "ScanFilter.hpp"
12
12
 
13
+ #include "AndroidScanMode.hpp"
14
+ #include "JAndroidScanMode.hpp"
13
15
  #include <string>
14
16
  #include <vector>
15
17
 
@@ -38,6 +40,8 @@ namespace margelo::nitro::co::zyke::ble {
38
40
  double rssiThreshold = this->getFieldValue(fieldRssiThreshold);
39
41
  static const auto fieldAllowDuplicates = clazz->getField<jboolean>("allowDuplicates");
40
42
  jboolean allowDuplicates = this->getFieldValue(fieldAllowDuplicates);
43
+ static const auto fieldAndroidScanMode = clazz->getField<JAndroidScanMode>("androidScanMode");
44
+ jni::local_ref<JAndroidScanMode> androidScanMode = this->getFieldValue(fieldAndroidScanMode);
41
45
  return ScanFilter(
42
46
  [&]() {
43
47
  size_t __size = serviceUUIDs->size();
@@ -50,7 +54,8 @@ namespace margelo::nitro::co::zyke::ble {
50
54
  return __vector;
51
55
  }(),
52
56
  rssiThreshold,
53
- static_cast<bool>(allowDuplicates)
57
+ static_cast<bool>(allowDuplicates),
58
+ androidScanMode->toCpp()
54
59
  );
55
60
  }
56
61
 
@@ -71,7 +76,8 @@ namespace margelo::nitro::co::zyke::ble {
71
76
  return __array;
72
77
  }(),
73
78
  value.rssiThreshold,
74
- value.allowDuplicates
79
+ value.allowDuplicates,
80
+ JAndroidScanMode::fromCpp(value.androidScanMode)
75
81
  );
76
82
  }
77
83
  };
@@ -0,0 +1,23 @@
1
+ ///
2
+ /// AndroidScanMode.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 "AndroidScanMode".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class AndroidScanMode(@DoNotStrip @Keep val value: Int) {
19
+ LOWLATENCY(0),
20
+ BALANCED(1),
21
+ LOWPOWER(2),
22
+ OPPORTUNISTIC(3);
23
+ }
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// Func_void_bool_std__vector_double__std__string.kt
2
+ /// Func_void_bool_std__shared_ptr_ArrayBuffer__std__string.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -15,25 +15,25 @@ import dalvik.annotation.optimization.FastNative
15
15
 
16
16
 
17
17
  /**
18
- * Represents the JavaScript callback `(success: boolean, data: array, error: string) => void`.
18
+ * Represents the JavaScript callback `(success: boolean, data: array-buffer, error: string) => void`.
19
19
  * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
20
  * or in Kotlin/Java (in which case it is a native callback).
21
21
  */
22
22
  @DoNotStrip
23
23
  @Keep
24
24
  @Suppress("ClassName", "RedundantUnitReturnType")
25
- fun interface Func_void_bool_std__vector_double__std__string: (Boolean, DoubleArray, String) -> Unit {
25
+ fun interface Func_void_bool_std__shared_ptr_ArrayBuffer__std__string: (Boolean, ArrayBuffer, String) -> Unit {
26
26
  /**
27
27
  * Call the given JS callback.
28
28
  * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
29
  */
30
30
  @DoNotStrip
31
31
  @Keep
32
- override fun invoke(success: Boolean, data: DoubleArray, error: String): Unit
32
+ override fun invoke(success: Boolean, data: ArrayBuffer, error: String): Unit
33
33
  }
34
34
 
35
35
  /**
36
- * Represents the JavaScript callback `(success: boolean, data: array, error: string) => void`.
36
+ * Represents the JavaScript callback `(success: boolean, data: array-buffer, error: string) => void`.
37
37
  * This is implemented in C++, via a `std::function<...>`.
38
38
  * The callback might be coming from JS.
39
39
  */
@@ -44,7 +44,7 @@ fun interface Func_void_bool_std__vector_double__std__string: (Boolean, DoubleAr
44
44
  "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
45
  "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
46
  )
47
- class Func_void_bool_std__vector_double__std__string_cxx: Func_void_bool_std__vector_double__std__string {
47
+ class Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_cxx: Func_void_bool_std__shared_ptr_ArrayBuffer__std__string {
48
48
  @DoNotStrip
49
49
  @Keep
50
50
  private val mHybridData: HybridData
@@ -57,25 +57,25 @@ class Func_void_bool_std__vector_double__std__string_cxx: Func_void_bool_std__ve
57
57
 
58
58
  @DoNotStrip
59
59
  @Keep
60
- override fun invoke(success: Boolean, data: DoubleArray, error: String): Unit
60
+ override fun invoke(success: Boolean, data: ArrayBuffer, error: String): Unit
61
61
  = invoke_cxx(success,data,error)
62
62
 
63
63
  @FastNative
64
- private external fun invoke_cxx(success: Boolean, data: DoubleArray, error: String): Unit
64
+ private external fun invoke_cxx(success: Boolean, data: ArrayBuffer, error: String): Unit
65
65
  }
66
66
 
67
67
  /**
68
- * Represents the JavaScript callback `(success: boolean, data: array, error: string) => void`.
69
- * This is implemented in Java/Kotlin, via a `(Boolean, DoubleArray, String) -> Unit`.
68
+ * Represents the JavaScript callback `(success: boolean, data: array-buffer, error: string) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(Boolean, ArrayBuffer, String) -> Unit`.
70
70
  * The callback is always coming from native.
71
71
  */
72
72
  @DoNotStrip
73
73
  @Keep
74
74
  @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
- class Func_void_bool_std__vector_double__std__string_java(private val function: (Boolean, DoubleArray, String) -> Unit): Func_void_bool_std__vector_double__std__string {
75
+ class Func_void_bool_std__shared_ptr_ArrayBuffer__std__string_java(private val function: (Boolean, ArrayBuffer, String) -> Unit): Func_void_bool_std__shared_ptr_ArrayBuffer__std__string {
76
76
  @DoNotStrip
77
77
  @Keep
78
- override fun invoke(success: Boolean, data: DoubleArray, error: String): Unit {
78
+ override fun invoke(success: Boolean, data: ArrayBuffer, error: String): Unit {
79
79
  return this.function(success, data, error)
80
80
  }
81
81
  }
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// Func_void_BLEDevice.kt
2
+ /// Func_void_std__optional_BLEDevice__std__optional_std__string_.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -15,25 +15,25 @@ import dalvik.annotation.optimization.FastNative
15
15
 
16
16
 
17
17
  /**
18
- * Represents the JavaScript callback `(device: struct) => void`.
18
+ * Represents the JavaScript callback `(device: optional, error: optional) => void`.
19
19
  * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
20
  * or in Kotlin/Java (in which case it is a native callback).
21
21
  */
22
22
  @DoNotStrip
23
23
  @Keep
24
24
  @Suppress("ClassName", "RedundantUnitReturnType")
25
- fun interface Func_void_BLEDevice: (BLEDevice) -> Unit {
25
+ fun interface Func_void_std__optional_BLEDevice__std__optional_std__string_: (BLEDevice?, String?) -> Unit {
26
26
  /**
27
27
  * Call the given JS callback.
28
28
  * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
29
  */
30
30
  @DoNotStrip
31
31
  @Keep
32
- override fun invoke(device: BLEDevice): Unit
32
+ override fun invoke(device: BLEDevice?, error: String?): Unit
33
33
  }
34
34
 
35
35
  /**
36
- * Represents the JavaScript callback `(device: struct) => void`.
36
+ * Represents the JavaScript callback `(device: optional, error: optional) => void`.
37
37
  * This is implemented in C++, via a `std::function<...>`.
38
38
  * The callback might be coming from JS.
39
39
  */
@@ -44,7 +44,7 @@ fun interface Func_void_BLEDevice: (BLEDevice) -> Unit {
44
44
  "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
45
  "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
46
  )
47
- class Func_void_BLEDevice_cxx: Func_void_BLEDevice {
47
+ class Func_void_std__optional_BLEDevice__std__optional_std__string__cxx: Func_void_std__optional_BLEDevice__std__optional_std__string_ {
48
48
  @DoNotStrip
49
49
  @Keep
50
50
  private val mHybridData: HybridData
@@ -57,25 +57,25 @@ class Func_void_BLEDevice_cxx: Func_void_BLEDevice {
57
57
 
58
58
  @DoNotStrip
59
59
  @Keep
60
- override fun invoke(device: BLEDevice): Unit
61
- = invoke_cxx(device)
60
+ override fun invoke(device: BLEDevice?, error: String?): Unit
61
+ = invoke_cxx(device,error)
62
62
 
63
63
  @FastNative
64
- private external fun invoke_cxx(device: BLEDevice): Unit
64
+ private external fun invoke_cxx(device: BLEDevice?, error: String?): Unit
65
65
  }
66
66
 
67
67
  /**
68
- * Represents the JavaScript callback `(device: struct) => void`.
69
- * This is implemented in Java/Kotlin, via a `(BLEDevice) -> Unit`.
68
+ * Represents the JavaScript callback `(device: optional, error: optional) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(BLEDevice?, String?) -> Unit`.
70
70
  * The callback is always coming from native.
71
71
  */
72
72
  @DoNotStrip
73
73
  @Keep
74
74
  @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
- class Func_void_BLEDevice_java(private val function: (BLEDevice) -> Unit): Func_void_BLEDevice {
75
+ class Func_void_std__optional_BLEDevice__std__optional_std__string__java(private val function: (BLEDevice?, String?) -> Unit): Func_void_std__optional_BLEDevice__std__optional_std__string_ {
76
76
  @DoNotStrip
77
77
  @Keep
78
- override fun invoke(device: BLEDevice): Unit {
79
- return this.function(device)
78
+ override fun invoke(device: BLEDevice?, error: String?): Unit {
79
+ return this.function(device, error)
80
80
  }
81
81
  }
@@ -1,5 +1,5 @@
1
1
  ///
2
- /// Func_void_std__string_std__vector_double_.kt
2
+ /// Func_void_std__string_std__shared_ptr_ArrayBuffer_.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
@@ -15,25 +15,25 @@ import dalvik.annotation.optimization.FastNative
15
15
 
16
16
 
17
17
  /**
18
- * Represents the JavaScript callback `(characteristicId: string, data: array) => void`.
18
+ * Represents the JavaScript callback `(characteristicId: string, data: array-buffer) => void`.
19
19
  * This can be either implemented in C++ (in which case it might be a callback coming from JS),
20
20
  * or in Kotlin/Java (in which case it is a native callback).
21
21
  */
22
22
  @DoNotStrip
23
23
  @Keep
24
24
  @Suppress("ClassName", "RedundantUnitReturnType")
25
- fun interface Func_void_std__string_std__vector_double_: (String, DoubleArray) -> Unit {
25
+ fun interface Func_void_std__string_std__shared_ptr_ArrayBuffer_: (String, ArrayBuffer) -> Unit {
26
26
  /**
27
27
  * Call the given JS callback.
28
28
  * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
29
29
  */
30
30
  @DoNotStrip
31
31
  @Keep
32
- override fun invoke(characteristicId: String, data: DoubleArray): Unit
32
+ override fun invoke(characteristicId: String, data: ArrayBuffer): Unit
33
33
  }
34
34
 
35
35
  /**
36
- * Represents the JavaScript callback `(characteristicId: string, data: array) => void`.
36
+ * Represents the JavaScript callback `(characteristicId: string, data: array-buffer) => void`.
37
37
  * This is implemented in C++, via a `std::function<...>`.
38
38
  * The callback might be coming from JS.
39
39
  */
@@ -44,7 +44,7 @@ fun interface Func_void_std__string_std__vector_double_: (String, DoubleArray) -
44
44
  "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
45
45
  "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
46
46
  )
47
- class Func_void_std__string_std__vector_double__cxx: Func_void_std__string_std__vector_double_ {
47
+ class Func_void_std__string_std__shared_ptr_ArrayBuffer__cxx: Func_void_std__string_std__shared_ptr_ArrayBuffer_ {
48
48
  @DoNotStrip
49
49
  @Keep
50
50
  private val mHybridData: HybridData
@@ -57,25 +57,25 @@ class Func_void_std__string_std__vector_double__cxx: Func_void_std__string_std__
57
57
 
58
58
  @DoNotStrip
59
59
  @Keep
60
- override fun invoke(characteristicId: String, data: DoubleArray): Unit
60
+ override fun invoke(characteristicId: String, data: ArrayBuffer): Unit
61
61
  = invoke_cxx(characteristicId,data)
62
62
 
63
63
  @FastNative
64
- private external fun invoke_cxx(characteristicId: String, data: DoubleArray): Unit
64
+ private external fun invoke_cxx(characteristicId: String, data: ArrayBuffer): Unit
65
65
  }
66
66
 
67
67
  /**
68
- * Represents the JavaScript callback `(characteristicId: string, data: array) => void`.
69
- * This is implemented in Java/Kotlin, via a `(String, DoubleArray) -> Unit`.
68
+ * Represents the JavaScript callback `(characteristicId: string, data: array-buffer) => void`.
69
+ * This is implemented in Java/Kotlin, via a `(String, ArrayBuffer) -> Unit`.
70
70
  * The callback is always coming from native.
71
71
  */
72
72
  @DoNotStrip
73
73
  @Keep
74
74
  @Suppress("ClassName", "RedundantUnitReturnType", "unused")
75
- class Func_void_std__string_std__vector_double__java(private val function: (String, DoubleArray) -> Unit): Func_void_std__string_std__vector_double_ {
75
+ class Func_void_std__string_std__shared_ptr_ArrayBuffer__java(private val function: (String, ArrayBuffer) -> Unit): Func_void_std__string_std__shared_ptr_ArrayBuffer_ {
76
76
  @DoNotStrip
77
77
  @Keep
78
- override fun invoke(characteristicId: String, data: DoubleArray): Unit {
78
+ override fun invoke(characteristicId: String, data: ArrayBuffer): Unit {
79
79
  return this.function(characteristicId, data)
80
80
  }
81
81
  }
@@ -40,11 +40,11 @@ abstract class HybridNativeBleNitroSpec: HybridObject() {
40
40
 
41
41
 
42
42
  // Methods
43
- abstract fun startScan(filter: ScanFilter, callback: (device: BLEDevice) -> Unit): Unit
43
+ abstract fun startScan(filter: ScanFilter, callback: (device: BLEDevice?, error: String?) -> Unit): Unit
44
44
 
45
45
  @DoNotStrip
46
46
  @Keep
47
- private fun startScan_cxx(filter: ScanFilter, callback: Func_void_BLEDevice): Unit {
47
+ private fun startScan_cxx(filter: ScanFilter, callback: Func_void_std__optional_BLEDevice__std__optional_std__string_): Unit {
48
48
  val __result = startScan(filter, callback)
49
49
  return __result
50
50
  }
@@ -83,6 +83,10 @@ abstract class HybridNativeBleNitroSpec: HybridObject() {
83
83
  @Keep
84
84
  abstract fun isConnected(deviceId: String): Boolean
85
85
 
86
+ @DoNotStrip
87
+ @Keep
88
+ abstract fun requestMTU(deviceId: String, mtu: Double): Double
89
+
86
90
  abstract fun discoverServices(deviceId: String, callback: (success: Boolean, error: String) -> Unit): Unit
87
91
 
88
92
  @DoNotStrip
@@ -100,29 +104,29 @@ abstract class HybridNativeBleNitroSpec: HybridObject() {
100
104
  @Keep
101
105
  abstract fun getCharacteristics(deviceId: String, serviceId: String): Array<String>
102
106
 
103
- abstract fun readCharacteristic(deviceId: String, serviceId: String, characteristicId: String, callback: (success: Boolean, data: DoubleArray, error: String) -> Unit): Unit
107
+ abstract fun readCharacteristic(deviceId: String, serviceId: String, characteristicId: String, callback: (success: Boolean, data: ArrayBuffer, error: String) -> Unit): Unit
104
108
 
105
109
  @DoNotStrip
106
110
  @Keep
107
- private fun readCharacteristic_cxx(deviceId: String, serviceId: String, characteristicId: String, callback: Func_void_bool_std__vector_double__std__string): Unit {
111
+ private fun readCharacteristic_cxx(deviceId: String, serviceId: String, characteristicId: String, callback: Func_void_bool_std__shared_ptr_ArrayBuffer__std__string): Unit {
108
112
  val __result = readCharacteristic(deviceId, serviceId, characteristicId, callback)
109
113
  return __result
110
114
  }
111
115
 
112
- abstract fun writeCharacteristic(deviceId: String, serviceId: String, characteristicId: String, data: DoubleArray, withResponse: Boolean, callback: (success: Boolean, error: String) -> Unit): Unit
116
+ abstract fun writeCharacteristic(deviceId: String, serviceId: String, characteristicId: String, data: ArrayBuffer, withResponse: Boolean, callback: (success: Boolean, error: String) -> Unit): Unit
113
117
 
114
118
  @DoNotStrip
115
119
  @Keep
116
- private fun writeCharacteristic_cxx(deviceId: String, serviceId: String, characteristicId: String, data: Array<Double>, withResponse: Boolean, callback: Func_void_bool_std__string): Unit {
120
+ private fun writeCharacteristic_cxx(deviceId: String, serviceId: String, characteristicId: String, data: ArrayBuffer, withResponse: Boolean, callback: Func_void_bool_std__string): Unit {
117
121
  val __result = writeCharacteristic(deviceId, serviceId, characteristicId, data, withResponse, callback)
118
122
  return __result
119
123
  }
120
124
 
121
- abstract fun subscribeToCharacteristic(deviceId: String, serviceId: String, characteristicId: String, updateCallback: (characteristicId: String, data: DoubleArray) -> Unit, resultCallback: (success: Boolean, error: String) -> Unit): Unit
125
+ abstract fun subscribeToCharacteristic(deviceId: String, serviceId: String, characteristicId: String, updateCallback: (characteristicId: String, data: ArrayBuffer) -> Unit, resultCallback: (success: Boolean, error: String) -> Unit): Unit
122
126
 
123
127
  @DoNotStrip
124
128
  @Keep
125
- private fun subscribeToCharacteristic_cxx(deviceId: String, serviceId: String, characteristicId: String, updateCallback: Func_void_std__string_std__vector_double_, resultCallback: Func_void_bool_std__string): Unit {
129
+ private fun subscribeToCharacteristic_cxx(deviceId: String, serviceId: String, characteristicId: String, updateCallback: Func_void_std__string_std__shared_ptr_ArrayBuffer_, resultCallback: Func_void_bool_std__string): Unit {
126
130
  val __result = subscribeToCharacteristic(deviceId, serviceId, characteristicId, updateCallback, resultCallback)
127
131
  return __result
128
132
  }
@@ -26,7 +26,7 @@ data class ManufacturerDataEntry
26
26
  val id: String,
27
27
  @DoNotStrip
28
28
  @Keep
29
- val data: Array<Double>
29
+ val data: ArrayBuffer
30
30
  ) {
31
31
  /* main constructor */
32
32
  }
@@ -29,7 +29,10 @@ data class ScanFilter
29
29
  val rssiThreshold: Double,
30
30
  @DoNotStrip
31
31
  @Keep
32
- val allowDuplicates: Boolean
32
+ val allowDuplicates: Boolean,
33
+ @DoNotStrip
34
+ @Keep
35
+ val androidScanMode: AndroidScanMode
33
36
  ) {
34
37
  /* main constructor */
35
38
  }
@@ -13,11 +13,11 @@
13
13
 
14
14
  namespace margelo::nitro::co::zyke::ble::bridge::swift {
15
15
 
16
- // pragma MARK: std::function<void(const BLEDevice& /* device */)>
17
- Func_void_BLEDevice create_Func_void_BLEDevice(void* _Nonnull swiftClosureWrapper) {
18
- auto swiftClosure = BleNitro::Func_void_BLEDevice::fromUnsafe(swiftClosureWrapper);
19
- return [swiftClosure = std::move(swiftClosure)](const BLEDevice& device) mutable -> void {
20
- swiftClosure.call(device);
16
+ // pragma MARK: std::function<void(const std::optional<BLEDevice>& /* device */, const std::optional<std::string>& /* error */)>
17
+ Func_void_std__optional_BLEDevice__std__optional_std__string_ create_Func_void_std__optional_BLEDevice__std__optional_std__string_(void* _Nonnull swiftClosureWrapper) {
18
+ auto swiftClosure = BleNitro::Func_void_std__optional_BLEDevice__std__optional_std__string_::fromUnsafe(swiftClosureWrapper);
19
+ return [swiftClosure = std::move(swiftClosure)](const std::optional<BLEDevice>& device, const std::optional<std::string>& error) mutable -> void {
20
+ swiftClosure.call(device, error);
21
21
  };
22
22
  }
23
23
 
@@ -45,19 +45,19 @@ namespace margelo::nitro::co::zyke::ble::bridge::swift {
45
45
  };
46
46
  }
47
47
 
48
- // pragma MARK: std::function<void(bool /* success */, const std::vector<double>& /* data */, const std::string& /* error */)>
49
- Func_void_bool_std__vector_double__std__string create_Func_void_bool_std__vector_double__std__string(void* _Nonnull swiftClosureWrapper) {
50
- auto swiftClosure = BleNitro::Func_void_bool_std__vector_double__std__string::fromUnsafe(swiftClosureWrapper);
51
- return [swiftClosure = std::move(swiftClosure)](bool success, const std::vector<double>& data, const std::string& error) mutable -> void {
52
- swiftClosure.call(success, data, error);
48
+ // pragma MARK: std::function<void(bool /* success */, const std::shared_ptr<ArrayBuffer>& /* data */, const std::string& /* error */)>
49
+ Func_void_bool_std__shared_ptr_ArrayBuffer__std__string create_Func_void_bool_std__shared_ptr_ArrayBuffer__std__string(void* _Nonnull swiftClosureWrapper) {
50
+ auto swiftClosure = BleNitro::Func_void_bool_std__shared_ptr_ArrayBuffer__std__string::fromUnsafe(swiftClosureWrapper);
51
+ return [swiftClosure = std::move(swiftClosure)](bool success, const std::shared_ptr<ArrayBuffer>& data, const std::string& error) mutable -> void {
52
+ swiftClosure.call(success, ArrayBufferHolder(data), error);
53
53
  };
54
54
  }
55
55
 
56
- // pragma MARK: std::function<void(const std::string& /* characteristicId */, const std::vector<double>& /* data */)>
57
- Func_void_std__string_std__vector_double_ create_Func_void_std__string_std__vector_double_(void* _Nonnull swiftClosureWrapper) {
58
- auto swiftClosure = BleNitro::Func_void_std__string_std__vector_double_::fromUnsafe(swiftClosureWrapper);
59
- return [swiftClosure = std::move(swiftClosure)](const std::string& characteristicId, const std::vector<double>& data) mutable -> void {
60
- swiftClosure.call(characteristicId, data);
56
+ // pragma MARK: std::function<void(const std::string& /* characteristicId */, const std::shared_ptr<ArrayBuffer>& /* data */)>
57
+ Func_void_std__string_std__shared_ptr_ArrayBuffer_ create_Func_void_std__string_std__shared_ptr_ArrayBuffer_(void* _Nonnull swiftClosureWrapper) {
58
+ auto swiftClosure = BleNitro::Func_void_std__string_std__shared_ptr_ArrayBuffer_::fromUnsafe(swiftClosureWrapper);
59
+ return [swiftClosure = std::move(swiftClosure)](const std::string& characteristicId, const std::shared_ptr<ArrayBuffer>& data) mutable -> void {
60
+ swiftClosure.call(characteristicId, ArrayBufferHolder(data));
61
61
  };
62
62
  }
63
63