Commit 6bc077c7097d5ac7f8084e6a4004f1e1192fe70a
1 parent
c3e21960
feat:didSetupServiceCharacteristics delegate
Showing
3 changed files
with
13 additions
and
0 deletions
HDFwear/Home/HomeViewController.swift
... | ... | @@ -513,6 +513,10 @@ extension HomeViewController: BluetoothManagerDelegate { |
513 | 513 | scanView?.updateUI(.PairSuccess) |
514 | 514 | } |
515 | 515 | |
516 | + func didSetupServiceCharacteristics(_ peripheral: CBPeripheral) { | |
517 | + | |
518 | + } | |
519 | + | |
516 | 520 | private func pairingFail() { |
517 | 521 | if !DeviceIsConnected { |
518 | 522 | BluetoothManager.shared.pairFail() | ... | ... |
HDFwear/Setting/SettingViewController.swift
HDFwear/Tools/BluetoothManager.swift
... | ... | @@ -17,6 +17,7 @@ import Alamofire |
17 | 17 | protocol BluetoothManagerDelegate: NSObjectProtocol { |
18 | 18 | func didDiscover(devices: [ScanDevice]) |
19 | 19 | func didConnect(_ peripheral: CBPeripheral, _ mac: String) |
20 | + func didSetupServiceCharacteristics(_ peripheral: CBPeripheral) | |
20 | 21 | func centralManagerDidUpdateState(_ state: Int) |
21 | 22 | func didDisconnected() |
22 | 23 | } |
... | ... | @@ -1848,6 +1849,10 @@ extension BluetoothManager: CBPeripheralDelegate { |
1848 | 1849 | // } |
1849 | 1850 | if BLEConfig.ReadUUID .contains(uuid) { |
1850 | 1851 | peripheral.setNotifyValue(true, for: char) |
1852 | + for delegate in delegateList { | |
1853 | + delegate.didSetupServiceCharacteristics(peripheral) | |
1854 | + } | |
1855 | + BluetoothManager.shared.newSetTime() | |
1851 | 1856 | } |
1852 | 1857 | } |
1853 | 1858 | } | ... | ... |