munim-bluetooth 0.3.5 → 0.3.6
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,7 +10,7 @@ import CoreBluetooth
|
|
|
10
10
|
import NitroModules
|
|
11
11
|
import React
|
|
12
12
|
|
|
13
|
-
class HybridMunimBluetooth: NSObject, HybridMunimBluetoothSpec {
|
|
13
|
+
class HybridMunimBluetooth: NSObject, HybridMunimBluetoothSpec, CBPeripheralManagerDelegate, CBCentralManagerDelegate, CBPeripheralDelegate {
|
|
14
14
|
// Peripheral Manager
|
|
15
15
|
private var peripheralManager: CBPeripheralManager?
|
|
16
16
|
private var peripheralServices: [CBMutableService] = []
|
|
@@ -305,8 +305,8 @@ class HybridMunimBluetooth: NSObject, HybridMunimBluetoothSpec {
|
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
// MARK: - CBPeripheralManagerDelegate
|
|
309
|
-
extension HybridMunimBluetooth
|
|
308
|
+
// MARK: - CBPeripheralManagerDelegate Implementation
|
|
309
|
+
extension HybridMunimBluetooth {
|
|
310
310
|
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) {
|
|
311
311
|
// Handle state updates
|
|
312
312
|
}
|
|
@@ -328,8 +328,8 @@ extension HybridMunimBluetooth: CBPeripheralManagerDelegate {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
// MARK: - CBCentralManagerDelegate
|
|
332
|
-
extension HybridMunimBluetooth
|
|
331
|
+
// MARK: - CBCentralManagerDelegate Implementation
|
|
332
|
+
extension HybridMunimBluetooth {
|
|
333
333
|
func centralManagerDidUpdateState(_ central: CBCentralManager) {
|
|
334
334
|
let state = central.state
|
|
335
335
|
eventEmitter?.emit("bluetoothStateChanged", ["state": state.rawValue])
|
|
@@ -371,8 +371,8 @@ extension HybridMunimBluetooth: CBCentralManagerDelegate {
|
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
// MARK: - CBPeripheralDelegate
|
|
375
|
-
extension HybridMunimBluetooth
|
|
374
|
+
// MARK: - CBPeripheralDelegate Implementation
|
|
375
|
+
extension HybridMunimBluetooth {
|
|
376
376
|
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
|
|
377
377
|
let deviceId = peripheral.identifier.uuidString
|
|
378
378
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "munim-bluetooth",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "A comprehensive React Native library for all your Bluetooth Low Energy (BLE) needs, supporting both peripheral and central roles with Expo support",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|