simplejsble 0.0.49 → 0.0.51

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.
@@ -10,16 +10,15 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>macos-arm64_x86_64</string>
13
+ <string>ios-arm64</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libsimpleble.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
- <string>x86_64</string>
20
19
  </array>
21
20
  <key>SupportedPlatform</key>
22
- <string>macos</string>
21
+ <string>ios</string>
23
22
  </dict>
24
23
  <dict>
25
24
  <key>BinaryPath</key>
@@ -27,7 +26,7 @@
27
26
  <key>HeadersPath</key>
28
27
  <string>Headers</string>
29
28
  <key>LibraryIdentifier</key>
30
- <string>ios-arm64</string>
29
+ <string>ios-arm64-simulator</string>
31
30
  <key>LibraryPath</key>
32
31
  <string>libsimpleble.a</string>
33
32
  <key>SupportedArchitectures</key>
@@ -36,6 +35,8 @@
36
35
  </array>
37
36
  <key>SupportedPlatform</key>
38
37
  <string>ios</string>
38
+ <key>SupportedPlatformVariant</key>
39
+ <string>simulator</string>
39
40
  </dict>
40
41
  <dict>
41
42
  <key>BinaryPath</key>
@@ -43,17 +44,16 @@
43
44
  <key>HeadersPath</key>
44
45
  <string>Headers</string>
45
46
  <key>LibraryIdentifier</key>
46
- <string>ios-arm64-simulator</string>
47
+ <string>macos-arm64_x86_64</string>
47
48
  <key>LibraryPath</key>
48
49
  <string>libsimpleble.a</string>
49
50
  <key>SupportedArchitectures</key>
50
51
  <array>
51
52
  <string>arm64</string>
53
+ <string>x86_64</string>
52
54
  </array>
53
55
  <key>SupportedPlatform</key>
54
- <string>ios</string>
55
- <key>SupportedPlatformVariant</key>
56
- <string>simulator</string>
56
+ <string>macos</string>
57
57
  </dict>
58
58
  </array>
59
59
  <key>CFBundlePackageType</key>
@@ -93,12 +93,12 @@ std::vector<std::shared_ptr<HybridServiceSpec>> HybridPeripheral::services() {
93
93
  return hybrid_services;
94
94
  }
95
95
 
96
- std::unordered_map<double, std::shared_ptr<ArrayBuffer>> HybridPeripheral::manufacturer_data() {
96
+ std::unordered_map<int, std::shared_ptr<ArrayBuffer>> HybridPeripheral::manufacturer_data() {
97
97
  std::map<uint16_t, SimpleBLE::ByteArray> peripheral_manufacturer_data = _peripheral.manufacturer_data();
98
- std::unordered_map<double, std::shared_ptr<ArrayBuffer>> manufacturer_array_buffer_map;
98
+ std::unordered_map<int, std::shared_ptr<ArrayBuffer>> manufacturer_array_buffer_map;
99
99
 
100
100
  for (const auto& pair : peripheral_manufacturer_data) {
101
- manufacturer_array_buffer_map[static_cast<double>(pair.first)] = toArrayBuffer(pair.second);
101
+ manufacturer_array_buffer_map[static_cast<int>(pair.first)] = toArrayBuffer(pair.second);
102
102
  }
103
103
 
104
104
  return manufacturer_array_buffer_map;
@@ -165,7 +165,7 @@ void HybridPeripheral::write_descriptor(const std::string& service, const std::s
165
165
 
166
166
  // Helper methods to cast between SimpleBLE::ByteArray and ArrayBuffer (NitroModules native type)
167
167
  std::shared_ptr<ArrayBuffer> HybridPeripheral::toArrayBuffer(const SimpleBLE::ByteArray& data) {
168
- return std::make_shared<ArrayBuffer>(reinterpret_cast<const uint8_t*>(data.data()), data.size());
168
+ return ArrayBuffer::copy(reinterpret_cast<const uint8_t*>(data.data()), data.size());
169
169
  }
170
170
 
171
171
  SimpleBLE::ByteArray HybridPeripheral::fromArrayBuffer(const std::shared_ptr<ArrayBuffer>& buffer) {
@@ -38,7 +38,7 @@ class HybridPeripheral : public HybridPeripheralSpec {
38
38
  void set_callback_on_disconnected(const std::function<void()>& callback) override;
39
39
 
40
40
  std::vector<std::shared_ptr<HybridServiceSpec>> services() override;
41
- std::unordered_map<double, std::shared_ptr<ArrayBuffer>> manufacturer_data() override;
41
+ std::unordered_map<int, std::shared_ptr<ArrayBuffer>> manufacturer_data() override;
42
42
 
43
43
  std::shared_ptr<ArrayBuffer> read(const std::string& service, const std::string& characteristic) override;
44
44
  void write_request(const std::string& service, const std::string& characteristic, const std::shared_ptr<ArrayBuffer>& data) override;
@@ -13,7 +13,7 @@ std::string HybridService::uuid() {
13
13
 
14
14
  std::shared_ptr<ArrayBuffer> HybridService::data() {
15
15
  SimpleBLE::ByteArray bytes = _service.data();
16
- return std::make_shared<ArrayBuffer>(reinterpret_cast<const uint8_t*>(bytes.data()), bytes.size());
16
+ return ArrayBuffer::copy(reinterpret_cast<const uint8_t*>(bytes.data()), bytes.size());
17
17
  }
18
18
 
19
19
  std::vector<std::shared_ptr<HybridCharacteristicSpec>> HybridService::characteristics() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simplejsble",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "description": "React Native Bluetooth Low Energy library using SimpleBLE with Nitro Modules",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",