munim-bluetooth 0.3.27 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +476 -74
- package/android/gradle.properties +2 -2
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/cpp/cpp-adapter.cpp +4 -1
- package/android/src/main/java/com/munimbluetooth/HybridMunimBluetooth.kt +2006 -209
- package/android/src/main/java/com/munimbluetooth/MunimBluetoothBackgroundService.kt +561 -53
- package/app.plugin.js +155 -0
- package/ios/HybridMunimBluetooth.swift +2123 -298
- package/ios/MunimBluetoothEventEmitter.swift +68 -8
- package/lib/commonjs/index.js +272 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +243 -11
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +310 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts +219 -5
- package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts.map +1 -1
- package/nitro.json +9 -3
- package/nitrogen/generated/android/c++/JAdvertisingDataTypes.hpp +96 -96
- package/nitrogen/generated/android/c++/JAdvertisingOptions.hpp +8 -8
- package/nitrogen/generated/android/c++/JBackgroundSessionOptions.hpp +8 -8
- package/nitrogen/generated/android/c++/JBluetoothCapabilities.hpp +105 -0
- package/nitrogen/generated/android/c++/JBluetoothPhy.hpp +61 -0
- package/nitrogen/generated/android/c++/JBluetoothPhyOption.hpp +61 -0
- package/nitrogen/generated/android/c++/JBondState.hpp +64 -0
- package/nitrogen/generated/android/c++/JDescriptorValue.hpp +69 -0
- package/nitrogen/generated/android/c++/JExtendedAdvertisingOptions.hpp +131 -0
- package/nitrogen/generated/android/c++/JGATTCharacteristic.hpp +35 -11
- package/nitrogen/generated/android/c++/JGATTDescriptor.hpp +85 -0
- package/nitrogen/generated/android/c++/JGATTService.hpp +33 -9
- package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.cpp +422 -12
- package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.hpp +29 -0
- package/nitrogen/generated/android/c++/JL2CAPChannel.hpp +66 -0
- package/nitrogen/generated/android/c++/JMultipeerDiscoveryInfoEntry.hpp +61 -0
- package/nitrogen/generated/android/c++/JMultipeerEncryptionPreference.hpp +61 -0
- package/nitrogen/generated/android/c++/JMultipeerPeer.hpp +93 -0
- package/nitrogen/generated/android/c++/JMultipeerPeerState.hpp +61 -0
- package/nitrogen/generated/android/c++/JMultipeerSessionOptions.hpp +105 -0
- package/nitrogen/generated/android/c++/JPhyStatus.hpp +62 -0
- package/nitrogen/generated/android/c++/JScanOptions.hpp +8 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingDataTypes.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingOptions.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BackgroundSessionOptions.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothCapabilities.kt +111 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhy.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhyOption.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BondState.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/CharacteristicValue.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/DescriptorValue.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ExtendedAdvertisingOptions.kt +111 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTCharacteristic.kt +25 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTDescriptor.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTService.kt +23 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/HybridMunimBluetoothSpec.kt +138 -22
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/L2CAPChannel.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerDiscoveryInfoEntry.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerEncryptionPreference.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerPeer.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerPeerState.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerSessionOptions.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/PhyStatus.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ScanOptions.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ServiceDataEntry.kt +15 -0
- package/nitrogen/generated/ios/MunimBluetooth+autolinking.rb +2 -0
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.cpp +61 -5
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.hpp +494 -49
- package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Umbrella.hpp +42 -0
- package/nitrogen/generated/ios/c++/HybridMunimBluetoothSpecSwift.hpp +254 -0
- package/nitrogen/generated/ios/swift/BluetoothCapabilities.swift +89 -0
- package/nitrogen/generated/ios/swift/BluetoothPhy.swift +44 -0
- package/nitrogen/generated/ios/swift/BluetoothPhyOption.swift +44 -0
- package/nitrogen/generated/ios/swift/BondState.swift +48 -0
- package/nitrogen/generated/ios/swift/DescriptorValue.swift +44 -0
- package/nitrogen/generated/ios/swift/ExtendedAdvertisingOptions.swift +243 -0
- package/nitrogen/generated/ios/swift/Func_void_BluetoothCapabilities.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BondState.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_DescriptorValue.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_L2CAPChannel.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PhyStatus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MultipeerPeer_.swift +46 -0
- package/nitrogen/generated/ios/swift/GATTCharacteristic.swift +25 -1
- package/nitrogen/generated/ios/swift/GATTDescriptor.swift +71 -0
- package/nitrogen/generated/ios/swift/GATTService.swift +25 -1
- package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec.swift +29 -0
- package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec_cxx.swift +556 -23
- package/nitrogen/generated/ios/swift/L2CAPChannel.swift +52 -0
- package/nitrogen/generated/ios/swift/MultipeerDiscoveryInfoEntry.swift +34 -0
- package/nitrogen/generated/ios/swift/MultipeerEncryptionPreference.swift +44 -0
- package/nitrogen/generated/ios/swift/MultipeerPeer.swift +63 -0
- package/nitrogen/generated/ios/swift/MultipeerPeerState.swift +44 -0
- package/nitrogen/generated/ios/swift/MultipeerSessionOptions.swift +136 -0
- package/nitrogen/generated/ios/swift/PhyStatus.swift +34 -0
- package/nitrogen/generated/shared/c++/BluetoothCapabilities.hpp +131 -0
- package/nitrogen/generated/shared/c++/BluetoothPhy.hpp +80 -0
- package/nitrogen/generated/shared/c++/BluetoothPhyOption.hpp +80 -0
- package/nitrogen/generated/shared/c++/BondState.hpp +84 -0
- package/nitrogen/generated/shared/c++/DescriptorValue.hpp +95 -0
- package/nitrogen/generated/shared/c++/ExtendedAdvertisingOptions.hpp +138 -0
- package/nitrogen/generated/shared/c++/GATTCharacteristic.hpp +9 -3
- package/nitrogen/generated/shared/c++/GATTDescriptor.hpp +93 -0
- package/nitrogen/generated/shared/c++/GATTService.hpp +7 -2
- package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.hpp +61 -2
- package/nitrogen/generated/shared/c++/L2CAPChannel.hpp +92 -0
- package/nitrogen/generated/shared/c++/MultipeerDiscoveryInfoEntry.hpp +87 -0
- package/nitrogen/generated/shared/c++/MultipeerEncryptionPreference.hpp +80 -0
- package/nitrogen/generated/shared/c++/MultipeerPeer.hpp +102 -0
- package/nitrogen/generated/shared/c++/MultipeerPeerState.hpp +80 -0
- package/nitrogen/generated/shared/c++/MultipeerSessionOptions.hpp +114 -0
- package/nitrogen/generated/shared/c++/PhyStatus.hpp +88 -0
- package/package.json +22 -11
- package/src/index.ts +416 -31
- package/src/specs/munim-bluetooth.nitro.ts +298 -14
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MultipeerSessionOptions.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `MultipeerDiscoveryInfoEntry` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::munimbluetooth { struct MultipeerDiscoveryInfoEntry; }
|
|
33
|
+
// Forward declaration of `MultipeerEncryptionPreference` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::munimbluetooth { enum class MultipeerEncryptionPreference; }
|
|
35
|
+
|
|
36
|
+
#include <string>
|
|
37
|
+
#include <optional>
|
|
38
|
+
#include "MultipeerDiscoveryInfoEntry.hpp"
|
|
39
|
+
#include <vector>
|
|
40
|
+
#include "MultipeerEncryptionPreference.hpp"
|
|
41
|
+
|
|
42
|
+
namespace margelo::nitro::munimbluetooth {
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A struct which can be represented as a JavaScript object (MultipeerSessionOptions).
|
|
46
|
+
*/
|
|
47
|
+
struct MultipeerSessionOptions final {
|
|
48
|
+
public:
|
|
49
|
+
std::string serviceType SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> displayName SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::vector<MultipeerDiscoveryInfoEntry>> discoveryInfo SWIFT_PRIVATE;
|
|
52
|
+
std::optional<bool> autoInvite SWIFT_PRIVATE;
|
|
53
|
+
std::optional<bool> autoAcceptInvitations SWIFT_PRIVATE;
|
|
54
|
+
std::optional<double> inviteTimeout SWIFT_PRIVATE;
|
|
55
|
+
std::optional<MultipeerEncryptionPreference> encryptionPreference SWIFT_PRIVATE;
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
MultipeerSessionOptions() = default;
|
|
59
|
+
explicit MultipeerSessionOptions(std::string serviceType, std::optional<std::string> displayName, std::optional<std::vector<MultipeerDiscoveryInfoEntry>> discoveryInfo, std::optional<bool> autoInvite, std::optional<bool> autoAcceptInvitations, std::optional<double> inviteTimeout, std::optional<MultipeerEncryptionPreference> encryptionPreference): serviceType(serviceType), displayName(displayName), discoveryInfo(discoveryInfo), autoInvite(autoInvite), autoAcceptInvitations(autoAcceptInvitations), inviteTimeout(inviteTimeout), encryptionPreference(encryptionPreference) {}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
friend bool operator==(const MultipeerSessionOptions& lhs, const MultipeerSessionOptions& rhs) = default;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
66
|
+
|
|
67
|
+
namespace margelo::nitro {
|
|
68
|
+
|
|
69
|
+
// C++ MultipeerSessionOptions <> JS MultipeerSessionOptions (object)
|
|
70
|
+
template <>
|
|
71
|
+
struct JSIConverter<margelo::nitro::munimbluetooth::MultipeerSessionOptions> final {
|
|
72
|
+
static inline margelo::nitro::munimbluetooth::MultipeerSessionOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
73
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
74
|
+
return margelo::nitro::munimbluetooth::MultipeerSessionOptions(
|
|
75
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceType"))),
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "displayName"))),
|
|
77
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::munimbluetooth::MultipeerDiscoveryInfoEntry>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "discoveryInfo"))),
|
|
78
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoInvite"))),
|
|
79
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoAcceptInvitations"))),
|
|
80
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "inviteTimeout"))),
|
|
81
|
+
JSIConverter<std::optional<margelo::nitro::munimbluetooth::MultipeerEncryptionPreference>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encryptionPreference")))
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::munimbluetooth::MultipeerSessionOptions& arg) {
|
|
85
|
+
jsi::Object obj(runtime);
|
|
86
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "serviceType"), JSIConverter<std::string>::toJSI(runtime, arg.serviceType));
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "displayName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.displayName));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "discoveryInfo"), JSIConverter<std::optional<std::vector<margelo::nitro::munimbluetooth::MultipeerDiscoveryInfoEntry>>>::toJSI(runtime, arg.discoveryInfo));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoInvite"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.autoInvite));
|
|
90
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoAcceptInvitations"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.autoAcceptInvitations));
|
|
91
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "inviteTimeout"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.inviteTimeout));
|
|
92
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "encryptionPreference"), JSIConverter<std::optional<margelo::nitro::munimbluetooth::MultipeerEncryptionPreference>>::toJSI(runtime, arg.encryptionPreference));
|
|
93
|
+
return obj;
|
|
94
|
+
}
|
|
95
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
96
|
+
if (!value.isObject()) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
jsi::Object obj = value.getObject(runtime);
|
|
100
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serviceType")))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "displayName")))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::munimbluetooth::MultipeerDiscoveryInfoEntry>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "discoveryInfo")))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoInvite")))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoAcceptInvitations")))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "inviteTimeout")))) return false;
|
|
109
|
+
if (!JSIConverter<std::optional<margelo::nitro::munimbluetooth::MultipeerEncryptionPreference>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encryptionPreference")))) return false;
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PhyStatus.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `BluetoothPhy` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::munimbluetooth { enum class BluetoothPhy; }
|
|
33
|
+
|
|
34
|
+
#include "BluetoothPhy.hpp"
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::munimbluetooth {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (PhyStatus).
|
|
40
|
+
*/
|
|
41
|
+
struct PhyStatus final {
|
|
42
|
+
public:
|
|
43
|
+
BluetoothPhy txPhy SWIFT_PRIVATE;
|
|
44
|
+
BluetoothPhy rxPhy SWIFT_PRIVATE;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
PhyStatus() = default;
|
|
48
|
+
explicit PhyStatus(BluetoothPhy txPhy, BluetoothPhy rxPhy): txPhy(txPhy), rxPhy(rxPhy) {}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
friend bool operator==(const PhyStatus& lhs, const PhyStatus& rhs) = default;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
} // namespace margelo::nitro::munimbluetooth
|
|
55
|
+
|
|
56
|
+
namespace margelo::nitro {
|
|
57
|
+
|
|
58
|
+
// C++ PhyStatus <> JS PhyStatus (object)
|
|
59
|
+
template <>
|
|
60
|
+
struct JSIConverter<margelo::nitro::munimbluetooth::PhyStatus> final {
|
|
61
|
+
static inline margelo::nitro::munimbluetooth::PhyStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
62
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
63
|
+
return margelo::nitro::munimbluetooth::PhyStatus(
|
|
64
|
+
JSIConverter<margelo::nitro::munimbluetooth::BluetoothPhy>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "txPhy"))),
|
|
65
|
+
JSIConverter<margelo::nitro::munimbluetooth::BluetoothPhy>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rxPhy")))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::munimbluetooth::PhyStatus& arg) {
|
|
69
|
+
jsi::Object obj(runtime);
|
|
70
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "txPhy"), JSIConverter<margelo::nitro::munimbluetooth::BluetoothPhy>::toJSI(runtime, arg.txPhy));
|
|
71
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "rxPhy"), JSIConverter<margelo::nitro::munimbluetooth::BluetoothPhy>::toJSI(runtime, arg.rxPhy));
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
75
|
+
if (!value.isObject()) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
jsi::Object obj = value.getObject(runtime);
|
|
79
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (!JSIConverter<margelo::nitro::munimbluetooth::BluetoothPhy>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "txPhy")))) return false;
|
|
83
|
+
if (!JSIConverter<margelo::nitro::munimbluetooth::BluetoothPhy>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rxPhy")))) return false;
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "munim-bluetooth",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A comprehensive React Native library for
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "A comprehensive React Native Bluetooth library for BLE central/peripheral, Android Classic Bluetooth, LE L2CAP, Apple Multipeer Connectivity, and Expo support",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
"peripheral",
|
|
23
23
|
"central",
|
|
24
24
|
"gatt",
|
|
25
|
+
"l2cap",
|
|
26
|
+
"mesh",
|
|
27
|
+
"multipeer-connectivity",
|
|
28
|
+
"classic-bluetooth",
|
|
29
|
+
"rfcomm",
|
|
25
30
|
"bluetooth-low-energy",
|
|
26
31
|
"ios",
|
|
27
32
|
"android",
|
|
@@ -48,14 +53,15 @@
|
|
|
48
53
|
"ios/**/*.swift",
|
|
49
54
|
"app.plugin.js",
|
|
50
55
|
"*.podspec",
|
|
51
|
-
"README.md"
|
|
56
|
+
"README.md",
|
|
57
|
+
"CHANGELOG.md"
|
|
52
58
|
],
|
|
53
59
|
"workspaces": [
|
|
54
60
|
"example"
|
|
55
61
|
],
|
|
56
62
|
"repository": {
|
|
57
63
|
"type": "git",
|
|
58
|
-
"url": "https://github.com/munimtechnologies/munim-bluetooth.git"
|
|
64
|
+
"url": "git+https://github.com/munimtechnologies/munim-bluetooth.git"
|
|
59
65
|
},
|
|
60
66
|
"author": "sheehanmunim <support@munimtech.com> (https://github.com/sheehanmunim)",
|
|
61
67
|
"license": "MIT",
|
|
@@ -80,18 +86,18 @@
|
|
|
80
86
|
}
|
|
81
87
|
},
|
|
82
88
|
"devDependencies": {
|
|
83
|
-
"@
|
|
89
|
+
"@react-native/gradle-plugin": "^0.83.9",
|
|
84
90
|
"@semantic-release/changelog": "^6.0.3",
|
|
85
91
|
"@semantic-release/git": "^10.0.1",
|
|
86
92
|
"@types/jest": "^29.5.14",
|
|
87
|
-
"@types/react": "19.2.
|
|
88
|
-
"conventional-changelog-conventionalcommits": "^9.1
|
|
89
|
-
"nitrogen": "^0.35.
|
|
93
|
+
"@types/react": "^19.2.14",
|
|
94
|
+
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
95
|
+
"nitrogen": "^0.35.6",
|
|
90
96
|
"react": "19.2.3",
|
|
91
97
|
"react-native": "0.83.1",
|
|
92
|
-
"react-native-builder-bob": "^0.40.
|
|
93
|
-
"react-native-nitro-modules": "^0.35.
|
|
94
|
-
"semantic-release": "^25.0.
|
|
98
|
+
"react-native-builder-bob": "^0.40.18",
|
|
99
|
+
"react-native-nitro-modules": "^0.35.6",
|
|
100
|
+
"semantic-release": "^25.0.3",
|
|
95
101
|
"typescript": "^5.8.3"
|
|
96
102
|
},
|
|
97
103
|
"peerDependencies": {
|
|
@@ -99,6 +105,11 @@
|
|
|
99
105
|
"react-native": "*",
|
|
100
106
|
"react-native-nitro-modules": "*"
|
|
101
107
|
},
|
|
108
|
+
"overrides": {
|
|
109
|
+
"minimatch@3.1.5": {
|
|
110
|
+
"brace-expansion": "1.1.14"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
102
113
|
"eslintConfig": {
|
|
103
114
|
"root": true,
|
|
104
115
|
"extends": [
|