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.
Files changed (116) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +476 -74
  3. package/android/gradle.properties +2 -2
  4. package/android/src/main/AndroidManifest.xml +3 -1
  5. package/android/src/main/cpp/cpp-adapter.cpp +4 -1
  6. package/android/src/main/java/com/munimbluetooth/BluetoothPermissionUtils.kt +40 -0
  7. package/android/src/main/java/com/munimbluetooth/HybridMunimBluetooth.kt +2116 -217
  8. package/android/src/main/java/com/munimbluetooth/MunimBluetoothBackgroundService.kt +591 -56
  9. package/app.plugin.js +155 -0
  10. package/ios/HybridMunimBluetooth.swift +2123 -298
  11. package/ios/MunimBluetoothEventEmitter.swift +68 -8
  12. package/lib/commonjs/index.js +272 -11
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/module/index.js +243 -11
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/typescript/src/index.d.ts +310 -7
  17. package/lib/typescript/src/index.d.ts.map +1 -1
  18. package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts +219 -5
  19. package/lib/typescript/src/specs/munim-bluetooth.nitro.d.ts.map +1 -1
  20. package/nitro.json +9 -3
  21. package/nitrogen/generated/android/c++/JAdvertisingDataTypes.hpp +96 -96
  22. package/nitrogen/generated/android/c++/JAdvertisingOptions.hpp +8 -8
  23. package/nitrogen/generated/android/c++/JBackgroundSessionOptions.hpp +8 -8
  24. package/nitrogen/generated/android/c++/JBluetoothCapabilities.hpp +105 -0
  25. package/nitrogen/generated/android/c++/JBluetoothPhy.hpp +61 -0
  26. package/nitrogen/generated/android/c++/JBluetoothPhyOption.hpp +61 -0
  27. package/nitrogen/generated/android/c++/JBondState.hpp +64 -0
  28. package/nitrogen/generated/android/c++/JDescriptorValue.hpp +69 -0
  29. package/nitrogen/generated/android/c++/JExtendedAdvertisingOptions.hpp +131 -0
  30. package/nitrogen/generated/android/c++/JGATTCharacteristic.hpp +35 -11
  31. package/nitrogen/generated/android/c++/JGATTDescriptor.hpp +85 -0
  32. package/nitrogen/generated/android/c++/JGATTService.hpp +33 -9
  33. package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.cpp +422 -12
  34. package/nitrogen/generated/android/c++/JHybridMunimBluetoothSpec.hpp +29 -0
  35. package/nitrogen/generated/android/c++/JL2CAPChannel.hpp +66 -0
  36. package/nitrogen/generated/android/c++/JMultipeerDiscoveryInfoEntry.hpp +61 -0
  37. package/nitrogen/generated/android/c++/JMultipeerEncryptionPreference.hpp +61 -0
  38. package/nitrogen/generated/android/c++/JMultipeerPeer.hpp +93 -0
  39. package/nitrogen/generated/android/c++/JMultipeerPeerState.hpp +61 -0
  40. package/nitrogen/generated/android/c++/JMultipeerSessionOptions.hpp +105 -0
  41. package/nitrogen/generated/android/c++/JPhyStatus.hpp +62 -0
  42. package/nitrogen/generated/android/c++/JScanOptions.hpp +8 -8
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingDataTypes.kt +47 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/AdvertisingOptions.kt +19 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BackgroundSessionOptions.kt +27 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothCapabilities.kt +111 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhy.kt +24 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BluetoothPhyOption.kt +24 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/BondState.kt +25 -0
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/CharacteristicValue.kt +17 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/DescriptorValue.kt +66 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ExtendedAdvertisingOptions.kt +111 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTCharacteristic.kt +25 -3
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTDescriptor.kt +61 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/GATTService.kt +23 -3
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/HybridMunimBluetoothSpec.kt +138 -22
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/L2CAPChannel.kt +61 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerDiscoveryInfoEntry.kt +56 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerEncryptionPreference.kt +24 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerPeer.kt +66 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerPeerState.kt +24 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/MultipeerSessionOptions.kt +81 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/PhyStatus.kt +56 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ScanOptions.kt +17 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/munimbluetooth/ServiceDataEntry.kt +15 -0
  66. package/nitrogen/generated/ios/MunimBluetooth+autolinking.rb +2 -0
  67. package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.cpp +61 -5
  68. package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Bridge.hpp +494 -49
  69. package/nitrogen/generated/ios/MunimBluetooth-Swift-Cxx-Umbrella.hpp +42 -0
  70. package/nitrogen/generated/ios/c++/HybridMunimBluetoothSpecSwift.hpp +254 -0
  71. package/nitrogen/generated/ios/swift/BluetoothCapabilities.swift +89 -0
  72. package/nitrogen/generated/ios/swift/BluetoothPhy.swift +44 -0
  73. package/nitrogen/generated/ios/swift/BluetoothPhyOption.swift +44 -0
  74. package/nitrogen/generated/ios/swift/BondState.swift +48 -0
  75. package/nitrogen/generated/ios/swift/DescriptorValue.swift +44 -0
  76. package/nitrogen/generated/ios/swift/ExtendedAdvertisingOptions.swift +243 -0
  77. package/nitrogen/generated/ios/swift/Func_void_BluetoothCapabilities.swift +46 -0
  78. package/nitrogen/generated/ios/swift/Func_void_BondState.swift +46 -0
  79. package/nitrogen/generated/ios/swift/Func_void_DescriptorValue.swift +46 -0
  80. package/nitrogen/generated/ios/swift/Func_void_L2CAPChannel.swift +46 -0
  81. package/nitrogen/generated/ios/swift/Func_void_PhyStatus.swift +46 -0
  82. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  83. package/nitrogen/generated/ios/swift/Func_void_std__vector_MultipeerPeer_.swift +46 -0
  84. package/nitrogen/generated/ios/swift/GATTCharacteristic.swift +25 -1
  85. package/nitrogen/generated/ios/swift/GATTDescriptor.swift +71 -0
  86. package/nitrogen/generated/ios/swift/GATTService.swift +25 -1
  87. package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec.swift +29 -0
  88. package/nitrogen/generated/ios/swift/HybridMunimBluetoothSpec_cxx.swift +556 -23
  89. package/nitrogen/generated/ios/swift/L2CAPChannel.swift +52 -0
  90. package/nitrogen/generated/ios/swift/MultipeerDiscoveryInfoEntry.swift +34 -0
  91. package/nitrogen/generated/ios/swift/MultipeerEncryptionPreference.swift +44 -0
  92. package/nitrogen/generated/ios/swift/MultipeerPeer.swift +63 -0
  93. package/nitrogen/generated/ios/swift/MultipeerPeerState.swift +44 -0
  94. package/nitrogen/generated/ios/swift/MultipeerSessionOptions.swift +136 -0
  95. package/nitrogen/generated/ios/swift/PhyStatus.swift +34 -0
  96. package/nitrogen/generated/shared/c++/BluetoothCapabilities.hpp +131 -0
  97. package/nitrogen/generated/shared/c++/BluetoothPhy.hpp +80 -0
  98. package/nitrogen/generated/shared/c++/BluetoothPhyOption.hpp +80 -0
  99. package/nitrogen/generated/shared/c++/BondState.hpp +84 -0
  100. package/nitrogen/generated/shared/c++/DescriptorValue.hpp +95 -0
  101. package/nitrogen/generated/shared/c++/ExtendedAdvertisingOptions.hpp +138 -0
  102. package/nitrogen/generated/shared/c++/GATTCharacteristic.hpp +9 -3
  103. package/nitrogen/generated/shared/c++/GATTDescriptor.hpp +93 -0
  104. package/nitrogen/generated/shared/c++/GATTService.hpp +7 -2
  105. package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.cpp +29 -0
  106. package/nitrogen/generated/shared/c++/HybridMunimBluetoothSpec.hpp +61 -2
  107. package/nitrogen/generated/shared/c++/L2CAPChannel.hpp +92 -0
  108. package/nitrogen/generated/shared/c++/MultipeerDiscoveryInfoEntry.hpp +87 -0
  109. package/nitrogen/generated/shared/c++/MultipeerEncryptionPreference.hpp +80 -0
  110. package/nitrogen/generated/shared/c++/MultipeerPeer.hpp +102 -0
  111. package/nitrogen/generated/shared/c++/MultipeerPeerState.hpp +80 -0
  112. package/nitrogen/generated/shared/c++/MultipeerSessionOptions.hpp +114 -0
  113. package/nitrogen/generated/shared/c++/PhyStatus.hpp +88 -0
  114. package/package.json +22 -11
  115. package/src/index.ts +416 -31
  116. package/src/specs/munim-bluetooth.nitro.ts +298 -14
@@ -26,93 +26,209 @@ import com.margelo.nitro.core.HybridObject
26
26
  )
27
27
  abstract class HybridMunimBluetoothSpec: HybridObject() {
28
28
  // Properties
29
-
29
+
30
30
 
31
31
  // Methods
32
32
  @DoNotStrip
33
33
  @Keep
34
34
  abstract fun startAdvertising(options: AdvertisingOptions): Unit
35
-
35
+
36
36
  @DoNotStrip
37
37
  @Keep
38
38
  abstract fun updateAdvertisingData(advertisingData: AdvertisingDataTypes): Unit
39
-
39
+
40
40
  @DoNotStrip
41
41
  @Keep
42
42
  abstract fun getAdvertisingData(): Promise<AdvertisingDataTypes>
43
-
43
+
44
44
  @DoNotStrip
45
45
  @Keep
46
46
  abstract fun stopAdvertising(): Unit
47
-
47
+
48
48
  @DoNotStrip
49
49
  @Keep
50
50
  abstract fun setServices(services: Array<GATTService>): Unit
51
-
51
+
52
+ @DoNotStrip
53
+ @Keep
54
+ abstract fun updateCharacteristicValue(serviceUUID: String, characteristicUUID: String, value: String, notify: Boolean?): Promise<Unit>
55
+
52
56
  @DoNotStrip
53
57
  @Keep
54
58
  abstract fun isBluetoothEnabled(): Promise<Boolean>
55
-
59
+
56
60
  @DoNotStrip
57
61
  @Keep
58
62
  abstract fun requestBluetoothPermission(): Promise<Boolean>
59
-
63
+
64
+ @DoNotStrip
65
+ @Keep
66
+ abstract fun getCapabilities(): Promise<BluetoothCapabilities>
67
+
60
68
  @DoNotStrip
61
69
  @Keep
62
70
  abstract fun startScan(options: ScanOptions?): Unit
63
-
71
+
64
72
  @DoNotStrip
65
73
  @Keep
66
74
  abstract fun stopScan(): Unit
67
-
75
+
68
76
  @DoNotStrip
69
77
  @Keep
70
78
  abstract fun connect(deviceId: String): Promise<Unit>
71
-
79
+
72
80
  @DoNotStrip
73
81
  @Keep
74
82
  abstract fun disconnect(deviceId: String): Unit
75
-
83
+
76
84
  @DoNotStrip
77
85
  @Keep
78
86
  abstract fun discoverServices(deviceId: String): Promise<Array<GATTService>>
79
-
87
+
80
88
  @DoNotStrip
81
89
  @Keep
82
90
  abstract fun readCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String): Promise<CharacteristicValue>
83
-
91
+
92
+ @DoNotStrip
93
+ @Keep
94
+ abstract fun readDescriptor(deviceId: String, serviceUUID: String, characteristicUUID: String, descriptorUUID: String): Promise<DescriptorValue>
95
+
84
96
  @DoNotStrip
85
97
  @Keep
86
98
  abstract fun writeCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String, value: String, writeType: WriteType?): Promise<Unit>
87
-
99
+
100
+ @DoNotStrip
101
+ @Keep
102
+ abstract fun writeDescriptor(deviceId: String, serviceUUID: String, characteristicUUID: String, descriptorUUID: String, value: String): Promise<Unit>
103
+
88
104
  @DoNotStrip
89
105
  @Keep
90
106
  abstract fun subscribeToCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String): Unit
91
-
107
+
92
108
  @DoNotStrip
93
109
  @Keep
94
110
  abstract fun unsubscribeFromCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String): Unit
95
-
111
+
96
112
  @DoNotStrip
97
113
  @Keep
98
114
  abstract fun getConnectedDevices(): Promise<Array<String>>
99
-
115
+
100
116
  @DoNotStrip
101
117
  @Keep
102
118
  abstract fun readRSSI(deviceId: String): Promise<Double>
103
-
119
+
120
+ @DoNotStrip
121
+ @Keep
122
+ abstract fun requestMTU(deviceId: String, mtu: Double): Promise<Double>
123
+
124
+ @DoNotStrip
125
+ @Keep
126
+ abstract fun setPreferredPhy(deviceId: String, txPhy: BluetoothPhy, rxPhy: BluetoothPhy, phyOption: BluetoothPhyOption?): Promise<Unit>
127
+
128
+ @DoNotStrip
129
+ @Keep
130
+ abstract fun readPhy(deviceId: String): Promise<PhyStatus>
131
+
132
+ @DoNotStrip
133
+ @Keep
134
+ abstract fun getBondState(deviceId: String): Promise<BondState>
135
+
136
+ @DoNotStrip
137
+ @Keep
138
+ abstract fun createBond(deviceId: String): Promise<BondState>
139
+
140
+ @DoNotStrip
141
+ @Keep
142
+ abstract fun removeBond(deviceId: String): Promise<BondState>
143
+
144
+ @DoNotStrip
145
+ @Keep
146
+ abstract fun startExtendedAdvertising(options: ExtendedAdvertisingOptions): Promise<String>
147
+
148
+ @DoNotStrip
149
+ @Keep
150
+ abstract fun stopExtendedAdvertising(advertisingId: String): Unit
151
+
152
+ @DoNotStrip
153
+ @Keep
154
+ abstract fun publishL2CAPChannel(encryptionRequired: Boolean?): Promise<L2CAPChannel>
155
+
156
+ @DoNotStrip
157
+ @Keep
158
+ abstract fun unpublishL2CAPChannel(psm: Double): Unit
159
+
160
+ @DoNotStrip
161
+ @Keep
162
+ abstract fun openL2CAPChannel(deviceId: String, psm: Double): Promise<L2CAPChannel>
163
+
164
+ @DoNotStrip
165
+ @Keep
166
+ abstract fun closeL2CAPChannel(channelId: String): Unit
167
+
168
+ @DoNotStrip
169
+ @Keep
170
+ abstract fun sendL2CAPData(channelId: String, value: String): Promise<Unit>
171
+
172
+ @DoNotStrip
173
+ @Keep
174
+ abstract fun startClassicScan(): Unit
175
+
176
+ @DoNotStrip
177
+ @Keep
178
+ abstract fun stopClassicScan(): Unit
179
+
180
+ @DoNotStrip
181
+ @Keep
182
+ abstract fun connectClassic(deviceId: String, serviceUUID: String?): Promise<Unit>
183
+
184
+ @DoNotStrip
185
+ @Keep
186
+ abstract fun startClassicServer(serviceUUID: String?, serviceName: String?): Promise<Unit>
187
+
188
+ @DoNotStrip
189
+ @Keep
190
+ abstract fun stopClassicServer(serviceUUID: String?): Unit
191
+
192
+ @DoNotStrip
193
+ @Keep
194
+ abstract fun disconnectClassic(deviceId: String): Unit
195
+
196
+ @DoNotStrip
197
+ @Keep
198
+ abstract fun writeClassic(deviceId: String, value: String): Promise<Unit>
199
+
104
200
  @DoNotStrip
105
201
  @Keep
106
202
  abstract fun startBackgroundSession(options: BackgroundSessionOptions): Unit
107
-
203
+
108
204
  @DoNotStrip
109
205
  @Keep
110
206
  abstract fun stopBackgroundSession(): Unit
111
-
207
+
208
+ @DoNotStrip
209
+ @Keep
210
+ abstract fun startMultipeerSession(options: MultipeerSessionOptions): Unit
211
+
212
+ @DoNotStrip
213
+ @Keep
214
+ abstract fun stopMultipeerSession(): Unit
215
+
216
+ @DoNotStrip
217
+ @Keep
218
+ abstract fun inviteMultipeerPeer(peerId: String): Unit
219
+
220
+ @DoNotStrip
221
+ @Keep
222
+ abstract fun getMultipeerPeers(): Promise<Array<MultipeerPeer>>
223
+
224
+ @DoNotStrip
225
+ @Keep
226
+ abstract fun sendMultipeerMessage(value: String, peerIds: Array<String>?, reliable: Boolean?): Promise<Unit>
227
+
112
228
  @DoNotStrip
113
229
  @Keep
114
230
  abstract fun addListener(eventName: String): Unit
115
-
231
+
116
232
  @DoNotStrip
117
233
  @Keep
118
234
  abstract fun removeListeners(count: Double): Unit
@@ -0,0 +1,61 @@
1
+ ///
2
+ /// L2CAPChannel.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 "L2CAPChannel".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class L2CAPChannel(
21
+ @DoNotStrip
22
+ @Keep
23
+ val id: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val psm: Double,
27
+ @DoNotStrip
28
+ @Keep
29
+ val deviceId: String?
30
+ ) {
31
+ /* primary constructor */
32
+
33
+ override fun equals(other: Any?): Boolean {
34
+ if (this === other) return true
35
+ if (other !is L2CAPChannel) return false
36
+ return Objects.deepEquals(this.id, other.id)
37
+ && Objects.deepEquals(this.psm, other.psm)
38
+ && Objects.deepEquals(this.deviceId, other.deviceId)
39
+ }
40
+
41
+ override fun hashCode(): Int {
42
+ return arrayOf(
43
+ id,
44
+ psm,
45
+ deviceId
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(id: String, psm: Double, deviceId: String?): L2CAPChannel {
58
+ return L2CAPChannel(id, psm, deviceId)
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,56 @@
1
+ ///
2
+ /// MultipeerDiscoveryInfoEntry.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 "MultipeerDiscoveryInfoEntry".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class MultipeerDiscoveryInfoEntry(
21
+ @DoNotStrip
22
+ @Keep
23
+ val key: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val value: String
27
+ ) {
28
+ /* primary constructor */
29
+
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is MultipeerDiscoveryInfoEntry) return false
33
+ return Objects.deepEquals(this.key, other.key)
34
+ && Objects.deepEquals(this.value, other.value)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf(
39
+ key,
40
+ value
41
+ ).contentDeepHashCode()
42
+ }
43
+
44
+ companion object {
45
+ /**
46
+ * Constructor called from C++
47
+ */
48
+ @DoNotStrip
49
+ @Keep
50
+ @Suppress("unused")
51
+ @JvmStatic
52
+ private fun fromCpp(key: String, value: String): MultipeerDiscoveryInfoEntry {
53
+ return MultipeerDiscoveryInfoEntry(key, value)
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,24 @@
1
+ ///
2
+ /// MultipeerEncryptionPreference.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 "MultipeerEncryptionPreference".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class MultipeerEncryptionPreference(@DoNotStrip @Keep val value: Int) {
19
+ NONE(0),
20
+ OPTIONAL(1),
21
+ REQUIRED(2);
22
+
23
+ companion object
24
+ }
@@ -0,0 +1,66 @@
1
+ ///
2
+ /// MultipeerPeer.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 "MultipeerPeer".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class MultipeerPeer(
21
+ @DoNotStrip
22
+ @Keep
23
+ val id: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val displayName: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val state: MultipeerPeerState,
30
+ @DoNotStrip
31
+ @Keep
32
+ val discoveryInfo: Array<MultipeerDiscoveryInfoEntry>?
33
+ ) {
34
+ /* primary constructor */
35
+
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is MultipeerPeer) return false
39
+ return Objects.deepEquals(this.id, other.id)
40
+ && Objects.deepEquals(this.displayName, other.displayName)
41
+ && Objects.deepEquals(this.state, other.state)
42
+ && Objects.deepEquals(this.discoveryInfo, other.discoveryInfo)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf(
47
+ id,
48
+ displayName,
49
+ state,
50
+ discoveryInfo
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(id: String, displayName: String, state: MultipeerPeerState, discoveryInfo: Array<MultipeerDiscoveryInfoEntry>?): MultipeerPeer {
63
+ return MultipeerPeer(id, displayName, state, discoveryInfo)
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,24 @@
1
+ ///
2
+ /// MultipeerPeerState.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 "MultipeerPeerState".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class MultipeerPeerState(@DoNotStrip @Keep val value: Int) {
19
+ NOTCONNECTED(0),
20
+ CONNECTING(1),
21
+ CONNECTED(2);
22
+
23
+ companion object
24
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// MultipeerSessionOptions.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 "MultipeerSessionOptions".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class MultipeerSessionOptions(
21
+ @DoNotStrip
22
+ @Keep
23
+ val serviceType: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val displayName: String?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val discoveryInfo: Array<MultipeerDiscoveryInfoEntry>?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val autoInvite: Boolean?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val autoAcceptInvitations: Boolean?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val inviteTimeout: Double?,
39
+ @DoNotStrip
40
+ @Keep
41
+ val encryptionPreference: MultipeerEncryptionPreference?
42
+ ) {
43
+ /* primary constructor */
44
+
45
+ override fun equals(other: Any?): Boolean {
46
+ if (this === other) return true
47
+ if (other !is MultipeerSessionOptions) return false
48
+ return Objects.deepEquals(this.serviceType, other.serviceType)
49
+ && Objects.deepEquals(this.displayName, other.displayName)
50
+ && Objects.deepEquals(this.discoveryInfo, other.discoveryInfo)
51
+ && Objects.deepEquals(this.autoInvite, other.autoInvite)
52
+ && Objects.deepEquals(this.autoAcceptInvitations, other.autoAcceptInvitations)
53
+ && Objects.deepEquals(this.inviteTimeout, other.inviteTimeout)
54
+ && Objects.deepEquals(this.encryptionPreference, other.encryptionPreference)
55
+ }
56
+
57
+ override fun hashCode(): Int {
58
+ return arrayOf(
59
+ serviceType,
60
+ displayName,
61
+ discoveryInfo,
62
+ autoInvite,
63
+ autoAcceptInvitations,
64
+ inviteTimeout,
65
+ encryptionPreference
66
+ ).contentDeepHashCode()
67
+ }
68
+
69
+ companion object {
70
+ /**
71
+ * Constructor called from C++
72
+ */
73
+ @DoNotStrip
74
+ @Keep
75
+ @Suppress("unused")
76
+ @JvmStatic
77
+ private fun fromCpp(serviceType: String, displayName: String?, discoveryInfo: Array<MultipeerDiscoveryInfoEntry>?, autoInvite: Boolean?, autoAcceptInvitations: Boolean?, inviteTimeout: Double?, encryptionPreference: MultipeerEncryptionPreference?): MultipeerSessionOptions {
78
+ return MultipeerSessionOptions(serviceType, displayName, discoveryInfo, autoInvite, autoAcceptInvitations, inviteTimeout, encryptionPreference)
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,56 @@
1
+ ///
2
+ /// PhyStatus.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 "PhyStatus".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class PhyStatus(
21
+ @DoNotStrip
22
+ @Keep
23
+ val txPhy: BluetoothPhy,
24
+ @DoNotStrip
25
+ @Keep
26
+ val rxPhy: BluetoothPhy
27
+ ) {
28
+ /* primary constructor */
29
+
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is PhyStatus) return false
33
+ return Objects.deepEquals(this.txPhy, other.txPhy)
34
+ && Objects.deepEquals(this.rxPhy, other.rxPhy)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf(
39
+ txPhy,
40
+ rxPhy
41
+ ).contentDeepHashCode()
42
+ }
43
+
44
+ companion object {
45
+ /**
46
+ * Constructor called from C++
47
+ */
48
+ @DoNotStrip
49
+ @Keep
50
+ @Suppress("unused")
51
+ @JvmStatic
52
+ private fun fromCpp(txPhy: BluetoothPhy, rxPhy: BluetoothPhy): PhyStatus {
53
+ return PhyStatus(txPhy, rxPhy)
54
+ }
55
+ }
56
+ }
@@ -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 ScanOptions(
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 ScanOptions) return false
36
+ return Objects.deepEquals(this.serviceUUIDs, other.serviceUUIDs)
37
+ && Objects.deepEquals(this.allowDuplicates, other.allowDuplicates)
38
+ && Objects.deepEquals(this.scanMode, other.scanMode)
39
+ }
40
+
41
+ override fun hashCode(): Int {
42
+ return arrayOf(
43
+ serviceUUIDs,
44
+ allowDuplicates,
45
+ scanMode
46
+ ).contentDeepHashCode()
47
+ }
48
+
32
49
  companion object {
33
50
  /**
34
51
  * Constructor called from C++
@@ -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
  /**
@@ -26,6 +27,20 @@ data class ServiceDataEntry(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is ServiceDataEntry) return false
33
+ return Objects.deepEquals(this.uuid, other.uuid)
34
+ && Objects.deepEquals(this.data, other.data)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf(
39
+ uuid,
40
+ data
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -56,5 +56,7 @@ def add_nitrogen_files(spec)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
59
+ # Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
60
+ "SWIFT_INSTALL_OBJC_HEADER" => "NO",
59
61
  })
60
62
  end