munim-bluetooth 0.3.26 → 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/BluetoothPermissionUtils.kt +40 -0
- package/android/src/main/java/com/munimbluetooth/HybridMunimBluetooth.kt +2116 -217
- package/android/src/main/java/com/munimbluetooth/MunimBluetoothBackgroundService.kt +591 -56
- 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
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.munimbluetooth
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -44,6 +45,32 @@ data class BackgroundSessionOptions(
|
|
|
44
45
|
) {
|
|
45
46
|
/* primary constructor */
|
|
46
47
|
|
|
48
|
+
override fun equals(other: Any?): Boolean {
|
|
49
|
+
if (this === other) return true
|
|
50
|
+
if (other !is BackgroundSessionOptions) return false
|
|
51
|
+
return Objects.deepEquals(this.serviceUUIDs, other.serviceUUIDs)
|
|
52
|
+
&& Objects.deepEquals(this.localName, other.localName)
|
|
53
|
+
&& Objects.deepEquals(this.allowDuplicates, other.allowDuplicates)
|
|
54
|
+
&& Objects.deepEquals(this.scanMode, other.scanMode)
|
|
55
|
+
&& Objects.deepEquals(this.androidNotificationChannelId, other.androidNotificationChannelId)
|
|
56
|
+
&& Objects.deepEquals(this.androidNotificationChannelName, other.androidNotificationChannelName)
|
|
57
|
+
&& Objects.deepEquals(this.androidNotificationTitle, other.androidNotificationTitle)
|
|
58
|
+
&& Objects.deepEquals(this.androidNotificationText, other.androidNotificationText)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
override fun hashCode(): Int {
|
|
62
|
+
return arrayOf(
|
|
63
|
+
serviceUUIDs,
|
|
64
|
+
localName,
|
|
65
|
+
allowDuplicates,
|
|
66
|
+
scanMode,
|
|
67
|
+
androidNotificationChannelId,
|
|
68
|
+
androidNotificationChannelName,
|
|
69
|
+
androidNotificationTitle,
|
|
70
|
+
androidNotificationText
|
|
71
|
+
).contentDeepHashCode()
|
|
72
|
+
}
|
|
73
|
+
|
|
47
74
|
companion object {
|
|
48
75
|
/**
|
|
49
76
|
* Constructor called from C++
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothCapabilities.kt
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BluetoothCapabilities.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "BluetoothCapabilities".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class BluetoothCapabilities(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val platform: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val supportsBleCentral: Boolean,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val supportsBlePeripheral: Boolean,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val supportsDescriptors: Boolean,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val supportsIncludedServices: Boolean,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val supportsMtu: Boolean,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
val supportsPhy: Boolean,
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
val supportsBonding: Boolean,
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
val supportsExtendedAdvertising: Boolean,
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
val supportsL2cap: Boolean,
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
val supportsClassicBluetooth: Boolean,
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
@Keep
|
|
56
|
+
val supportsBackgroundBle: Boolean,
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
val supportsMultipeerConnectivity: Boolean
|
|
60
|
+
) {
|
|
61
|
+
/* primary constructor */
|
|
62
|
+
|
|
63
|
+
override fun equals(other: Any?): Boolean {
|
|
64
|
+
if (this === other) return true
|
|
65
|
+
if (other !is BluetoothCapabilities) return false
|
|
66
|
+
return Objects.deepEquals(this.platform, other.platform)
|
|
67
|
+
&& Objects.deepEquals(this.supportsBleCentral, other.supportsBleCentral)
|
|
68
|
+
&& Objects.deepEquals(this.supportsBlePeripheral, other.supportsBlePeripheral)
|
|
69
|
+
&& Objects.deepEquals(this.supportsDescriptors, other.supportsDescriptors)
|
|
70
|
+
&& Objects.deepEquals(this.supportsIncludedServices, other.supportsIncludedServices)
|
|
71
|
+
&& Objects.deepEquals(this.supportsMtu, other.supportsMtu)
|
|
72
|
+
&& Objects.deepEquals(this.supportsPhy, other.supportsPhy)
|
|
73
|
+
&& Objects.deepEquals(this.supportsBonding, other.supportsBonding)
|
|
74
|
+
&& Objects.deepEquals(this.supportsExtendedAdvertising, other.supportsExtendedAdvertising)
|
|
75
|
+
&& Objects.deepEquals(this.supportsL2cap, other.supportsL2cap)
|
|
76
|
+
&& Objects.deepEquals(this.supportsClassicBluetooth, other.supportsClassicBluetooth)
|
|
77
|
+
&& Objects.deepEquals(this.supportsBackgroundBle, other.supportsBackgroundBle)
|
|
78
|
+
&& Objects.deepEquals(this.supportsMultipeerConnectivity, other.supportsMultipeerConnectivity)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override fun hashCode(): Int {
|
|
82
|
+
return arrayOf(
|
|
83
|
+
platform,
|
|
84
|
+
supportsBleCentral,
|
|
85
|
+
supportsBlePeripheral,
|
|
86
|
+
supportsDescriptors,
|
|
87
|
+
supportsIncludedServices,
|
|
88
|
+
supportsMtu,
|
|
89
|
+
supportsPhy,
|
|
90
|
+
supportsBonding,
|
|
91
|
+
supportsExtendedAdvertising,
|
|
92
|
+
supportsL2cap,
|
|
93
|
+
supportsClassicBluetooth,
|
|
94
|
+
supportsBackgroundBle,
|
|
95
|
+
supportsMultipeerConnectivity
|
|
96
|
+
).contentDeepHashCode()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
companion object {
|
|
100
|
+
/**
|
|
101
|
+
* Constructor called from C++
|
|
102
|
+
*/
|
|
103
|
+
@DoNotStrip
|
|
104
|
+
@Keep
|
|
105
|
+
@Suppress("unused")
|
|
106
|
+
@JvmStatic
|
|
107
|
+
private fun fromCpp(platform: String, supportsBleCentral: Boolean, supportsBlePeripheral: Boolean, supportsDescriptors: Boolean, supportsIncludedServices: Boolean, supportsMtu: Boolean, supportsPhy: Boolean, supportsBonding: Boolean, supportsExtendedAdvertising: Boolean, supportsL2cap: Boolean, supportsClassicBluetooth: Boolean, supportsBackgroundBle: Boolean, supportsMultipeerConnectivity: Boolean): BluetoothCapabilities {
|
|
108
|
+
return BluetoothCapabilities(platform, supportsBleCentral, supportsBlePeripheral, supportsDescriptors, supportsIncludedServices, supportsMtu, supportsPhy, supportsBonding, supportsExtendedAdvertising, supportsL2cap, supportsClassicBluetooth, supportsBackgroundBle, supportsMultipeerConnectivity)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BluetoothPhy.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "BluetoothPhy".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class BluetoothPhy(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
LE1M(0),
|
|
20
|
+
LE2M(1),
|
|
21
|
+
LECODED(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhyOption.kt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BluetoothPhyOption.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "BluetoothPhyOption".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class BluetoothPhyOption(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NONE(0),
|
|
20
|
+
S2(1),
|
|
21
|
+
S8(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BondState.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "BondState".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class BondState(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NONE(0),
|
|
20
|
+
BONDING(1),
|
|
21
|
+
BONDED(2),
|
|
22
|
+
UNSUPPORTED(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/CharacteristicValue.kt
CHANGED
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.munimbluetooth
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -29,6 +30,22 @@ data class CharacteristicValue(
|
|
|
29
30
|
) {
|
|
30
31
|
/* primary constructor */
|
|
31
32
|
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is CharacteristicValue) return false
|
|
36
|
+
return Objects.deepEquals(this.value, other.value)
|
|
37
|
+
&& Objects.deepEquals(this.serviceUUID, other.serviceUUID)
|
|
38
|
+
&& Objects.deepEquals(this.characteristicUUID, other.characteristicUUID)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf(
|
|
43
|
+
value,
|
|
44
|
+
serviceUUID,
|
|
45
|
+
characteristicUUID
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
companion object {
|
|
33
50
|
/**
|
|
34
51
|
* Constructor called from C++
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// DescriptorValue.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "DescriptorValue".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class DescriptorValue(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val value: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val serviceUUID: String,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val characteristicUUID: String,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val descriptorUUID: String
|
|
33
|
+
) {
|
|
34
|
+
/* primary constructor */
|
|
35
|
+
|
|
36
|
+
override fun equals(other: Any?): Boolean {
|
|
37
|
+
if (this === other) return true
|
|
38
|
+
if (other !is DescriptorValue) return false
|
|
39
|
+
return Objects.deepEquals(this.value, other.value)
|
|
40
|
+
&& Objects.deepEquals(this.serviceUUID, other.serviceUUID)
|
|
41
|
+
&& Objects.deepEquals(this.characteristicUUID, other.characteristicUUID)
|
|
42
|
+
&& Objects.deepEquals(this.descriptorUUID, other.descriptorUUID)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun hashCode(): Int {
|
|
46
|
+
return arrayOf(
|
|
47
|
+
value,
|
|
48
|
+
serviceUUID,
|
|
49
|
+
characteristicUUID,
|
|
50
|
+
descriptorUUID
|
|
51
|
+
).contentDeepHashCode()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
companion object {
|
|
55
|
+
/**
|
|
56
|
+
* Constructor called from C++
|
|
57
|
+
*/
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
@Suppress("unused")
|
|
61
|
+
@JvmStatic
|
|
62
|
+
private fun fromCpp(value: String, serviceUUID: String, characteristicUUID: String, descriptorUUID: String): DescriptorValue {
|
|
63
|
+
return DescriptorValue(value, serviceUUID, characteristicUUID, descriptorUUID)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ExtendedAdvertisingOptions.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "ExtendedAdvertisingOptions".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class ExtendedAdvertisingOptions(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val serviceUUIDs: Array<String>?,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val localName: String?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val manufacturerData: String?,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val advertisingData: AdvertisingDataTypes?,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val connectable: Boolean?,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val scannable: Boolean?,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
val legacyMode: Boolean?,
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
val anonymous: Boolean?,
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
val includeTxPower: Boolean?,
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
val interval: Double?,
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
val txPowerLevel: Double?,
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
@Keep
|
|
56
|
+
val primaryPhy: BluetoothPhy?,
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
val secondaryPhy: BluetoothPhy?
|
|
60
|
+
) {
|
|
61
|
+
/* primary constructor */
|
|
62
|
+
|
|
63
|
+
override fun equals(other: Any?): Boolean {
|
|
64
|
+
if (this === other) return true
|
|
65
|
+
if (other !is ExtendedAdvertisingOptions) return false
|
|
66
|
+
return Objects.deepEquals(this.serviceUUIDs, other.serviceUUIDs)
|
|
67
|
+
&& Objects.deepEquals(this.localName, other.localName)
|
|
68
|
+
&& Objects.deepEquals(this.manufacturerData, other.manufacturerData)
|
|
69
|
+
&& Objects.deepEquals(this.advertisingData, other.advertisingData)
|
|
70
|
+
&& Objects.deepEquals(this.connectable, other.connectable)
|
|
71
|
+
&& Objects.deepEquals(this.scannable, other.scannable)
|
|
72
|
+
&& Objects.deepEquals(this.legacyMode, other.legacyMode)
|
|
73
|
+
&& Objects.deepEquals(this.anonymous, other.anonymous)
|
|
74
|
+
&& Objects.deepEquals(this.includeTxPower, other.includeTxPower)
|
|
75
|
+
&& Objects.deepEquals(this.interval, other.interval)
|
|
76
|
+
&& Objects.deepEquals(this.txPowerLevel, other.txPowerLevel)
|
|
77
|
+
&& Objects.deepEquals(this.primaryPhy, other.primaryPhy)
|
|
78
|
+
&& Objects.deepEquals(this.secondaryPhy, other.secondaryPhy)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override fun hashCode(): Int {
|
|
82
|
+
return arrayOf(
|
|
83
|
+
serviceUUIDs,
|
|
84
|
+
localName,
|
|
85
|
+
manufacturerData,
|
|
86
|
+
advertisingData,
|
|
87
|
+
connectable,
|
|
88
|
+
scannable,
|
|
89
|
+
legacyMode,
|
|
90
|
+
anonymous,
|
|
91
|
+
includeTxPower,
|
|
92
|
+
interval,
|
|
93
|
+
txPowerLevel,
|
|
94
|
+
primaryPhy,
|
|
95
|
+
secondaryPhy
|
|
96
|
+
).contentDeepHashCode()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
companion object {
|
|
100
|
+
/**
|
|
101
|
+
* Constructor called from C++
|
|
102
|
+
*/
|
|
103
|
+
@DoNotStrip
|
|
104
|
+
@Keep
|
|
105
|
+
@Suppress("unused")
|
|
106
|
+
@JvmStatic
|
|
107
|
+
private fun fromCpp(serviceUUIDs: Array<String>?, localName: String?, manufacturerData: String?, advertisingData: AdvertisingDataTypes?, connectable: Boolean?, scannable: Boolean?, legacyMode: Boolean?, anonymous: Boolean?, includeTxPower: Boolean?, interval: Double?, txPowerLevel: Double?, primaryPhy: BluetoothPhy?, secondaryPhy: BluetoothPhy?): ExtendedAdvertisingOptions {
|
|
108
|
+
return ExtendedAdvertisingOptions(serviceUUIDs, localName, manufacturerData, advertisingData, connectable, scannable, legacyMode, anonymous, includeTxPower, interval, txPowerLevel, primaryPhy, secondaryPhy)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTCharacteristic.kt
CHANGED
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.munimbluetooth
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -25,10 +26,31 @@ data class GATTCharacteristic(
|
|
|
25
26
|
val properties: Array<String>,
|
|
26
27
|
@DoNotStrip
|
|
27
28
|
@Keep
|
|
28
|
-
val value: String
|
|
29
|
+
val value: String?,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val descriptors: Array<GATTDescriptor>?
|
|
29
33
|
) {
|
|
30
34
|
/* primary constructor */
|
|
31
35
|
|
|
36
|
+
override fun equals(other: Any?): Boolean {
|
|
37
|
+
if (this === other) return true
|
|
38
|
+
if (other !is GATTCharacteristic) return false
|
|
39
|
+
return Objects.deepEquals(this.uuid, other.uuid)
|
|
40
|
+
&& Objects.deepEquals(this.properties, other.properties)
|
|
41
|
+
&& Objects.deepEquals(this.value, other.value)
|
|
42
|
+
&& Objects.deepEquals(this.descriptors, other.descriptors)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun hashCode(): Int {
|
|
46
|
+
return arrayOf(
|
|
47
|
+
uuid,
|
|
48
|
+
properties,
|
|
49
|
+
value,
|
|
50
|
+
descriptors
|
|
51
|
+
).contentDeepHashCode()
|
|
52
|
+
}
|
|
53
|
+
|
|
32
54
|
companion object {
|
|
33
55
|
/**
|
|
34
56
|
* Constructor called from C++
|
|
@@ -37,8 +59,8 @@ data class GATTCharacteristic(
|
|
|
37
59
|
@Keep
|
|
38
60
|
@Suppress("unused")
|
|
39
61
|
@JvmStatic
|
|
40
|
-
private fun fromCpp(uuid: String, properties: Array<String>, value: String
|
|
41
|
-
return GATTCharacteristic(uuid, properties, value)
|
|
62
|
+
private fun fromCpp(uuid: String, properties: Array<String>, value: String?, descriptors: Array<GATTDescriptor>?): GATTCharacteristic {
|
|
63
|
+
return GATTCharacteristic(uuid, properties, value, descriptors)
|
|
42
64
|
}
|
|
43
65
|
}
|
|
44
66
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GATTDescriptor.kt
|
|
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
|
+
package com.margelo.nitro.munimbluetooth
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "GATTDescriptor".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class GATTDescriptor(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val uuid: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val value: String?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val permissions: Array<String>?
|
|
30
|
+
) {
|
|
31
|
+
/* primary constructor */
|
|
32
|
+
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is GATTDescriptor) return false
|
|
36
|
+
return Objects.deepEquals(this.uuid, other.uuid)
|
|
37
|
+
&& Objects.deepEquals(this.value, other.value)
|
|
38
|
+
&& Objects.deepEquals(this.permissions, other.permissions)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf(
|
|
43
|
+
uuid,
|
|
44
|
+
value,
|
|
45
|
+
permissions
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
companion object {
|
|
50
|
+
/**
|
|
51
|
+
* Constructor called from C++
|
|
52
|
+
*/
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
@Suppress("unused")
|
|
56
|
+
@JvmStatic
|
|
57
|
+
private fun fromCpp(uuid: String, value: String?, permissions: Array<String>?): GATTDescriptor {
|
|
58
|
+
return GATTDescriptor(uuid, value, permissions)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -9,6 +9,7 @@ package com.margelo.nitro.munimbluetooth
|
|
|
9
9
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -22,10 +23,29 @@ data class GATTService(
|
|
|
22
23
|
val uuid: String,
|
|
23
24
|
@DoNotStrip
|
|
24
25
|
@Keep
|
|
25
|
-
val characteristics: Array<GATTCharacteristic
|
|
26
|
+
val characteristics: Array<GATTCharacteristic>,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val includedServices: Array<String>?
|
|
26
30
|
) {
|
|
27
31
|
/* primary constructor */
|
|
28
32
|
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is GATTService) return false
|
|
36
|
+
return Objects.deepEquals(this.uuid, other.uuid)
|
|
37
|
+
&& Objects.deepEquals(this.characteristics, other.characteristics)
|
|
38
|
+
&& Objects.deepEquals(this.includedServices, other.includedServices)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun hashCode(): Int {
|
|
42
|
+
return arrayOf(
|
|
43
|
+
uuid,
|
|
44
|
+
characteristics,
|
|
45
|
+
includedServices
|
|
46
|
+
).contentDeepHashCode()
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
companion object {
|
|
30
50
|
/**
|
|
31
51
|
* Constructor called from C++
|
|
@@ -34,8 +54,8 @@ data class GATTService(
|
|
|
34
54
|
@Keep
|
|
35
55
|
@Suppress("unused")
|
|
36
56
|
@JvmStatic
|
|
37
|
-
private fun fromCpp(uuid: String, characteristics: Array<GATTCharacteristic
|
|
38
|
-
return GATTService(uuid, characteristics)
|
|
57
|
+
private fun fromCpp(uuid: String, characteristics: Array<GATTCharacteristic>, includedServices: Array<String>?): GATTService {
|
|
58
|
+
return GATTService(uuid, characteristics, includedServices)
|
|
39
59
|
}
|
|
40
60
|
}
|
|
41
61
|
}
|