kard-network-ble-mesh 1.1.1 → 1.1.2

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 (2) hide show
  1. package/ios/BleMesh.swift +13 -5
  2. package/package.json +1 -1
package/ios/BleMesh.swift CHANGED
@@ -776,7 +776,7 @@ extension BleMesh: CBCentralManagerDelegate {
776
776
  if central.state == .poweredOn && isRunning {
777
777
  central.scanForPeripherals(
778
778
  withServices: [BleMesh.serviceUUID],
779
- options: [CBCentralManagerScanOptionAllowDuplicatesKey: false]
779
+ options: [CBCentralManagerScanOptionAllowDuplicatesKey: true]
780
780
  )
781
781
  }
782
782
 
@@ -799,7 +799,11 @@ extension BleMesh: CBCentralManagerDelegate {
799
799
  if peripherals[uuid] == nil {
800
800
  peripherals[uuid] = peripheral
801
801
  peripheral.delegate = self
802
- central.connect(peripheral, options: nil)
802
+ // Use connection options for faster connection
803
+ central.connect(peripheral, options: [
804
+ CBConnectPeripheralOptionNotifyOnConnectionKey: true,
805
+ CBConnectPeripheralOptionNotifyOnDisconnectionKey: true
806
+ ])
803
807
  }
804
808
  }
805
809
 
@@ -818,9 +822,12 @@ extension BleMesh: CBCentralManagerDelegate {
818
822
  notifyPeerListUpdated()
819
823
  }
820
824
 
821
- // Reconnect
825
+ // Reconnect with optimized options
822
826
  if isRunning {
823
- central.connect(peripheral, options: nil)
827
+ central.connect(peripheral, options: [
828
+ CBConnectPeripheralOptionNotifyOnConnectionKey: true,
829
+ CBConnectPeripheralOptionNotifyOnDisconnectionKey: true
830
+ ])
824
831
  }
825
832
  }
826
833
  }
@@ -877,7 +884,8 @@ extension BleMesh: CBPeripheralManagerDelegate {
877
884
  characteristic = char
878
885
 
879
886
  peripheralManager?.startAdvertising([
880
- CBAdvertisementDataServiceUUIDsKey: [BleMesh.serviceUUID]
887
+ CBAdvertisementDataServiceUUIDsKey: [BleMesh.serviceUUID],
888
+ CBAdvertisementDataLocalNameKey: "Kard-\(myPeerID.prefix(4))"
881
889
  ])
882
890
  }
883
891
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kard-network-ble-mesh",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Kard Network BLE Mesh networking library for React Native with seamless permissions",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",