Commit 357b7f273b28ca2a9c93d4ea84d271af862fe78e

Authored by daifengyi
1 parent d1f02dfe

feat:find phone

HDFwear/Tools/BluetoothManager+Function.swift
... ... @@ -303,6 +303,10 @@ extension BluetoothManager {
303 303 print("电话挂断")
304 304 case 0x8015:// 找手机
305 305 print("找手机")
  306 + let ring = Int(bytes[10])
  307 + for delegate in syncDelegateList {
  308 + delegate.didReceiveFindPhoneCommand(value: ring)
  309 + }
306 310 case 0x8016:// 历史心率数据上报
307 311 print("历史心率数据上报")
308 312 case 0x8017:// 历史血氧数据上报
... ...
HDFwear/Tools/BluetoothManager.swift
... ... @@ -29,7 +29,6 @@ protocol BluetoothManagerDelegate: NSObjectProtocol {
29 29 protocol BluetoothSyncDelegate {
30 30 func didReceiveFindCommand(status: Bool)
31 31 func didReceiveCameraCommand(status: SetCmd)
32   - func didReceiveFindPhoneCommand()
33 32 func didReceiveHeartRate(value: Int)
34 33 func didReceiveBloodOxygen()
35 34 func didReceiveBloodPressure()
... ... @@ -39,11 +38,11 @@ protocol BluetoothSyncDelegate {
39 38 func syncBug()
40 39 // adapted
41 40 func didReceiveBattery(value: Int)
  41 + func didReceiveFindPhoneCommand(value: Int)
42 42 }
43 43 extension BluetoothSyncDelegate {
44 44 func didReceiveFindCommand(status: Bool) { }
45 45 func didReceiveCameraCommand(status: SetCmd) { }
46   - func didReceiveFindPhoneCommand() { }
47 46 func didReceiveHeartRate(value: Int) { }
48 47 func didReceiveBloodOxygen() { }
49 48 func didReceiveBloodPressure() { }
... ... @@ -53,6 +52,7 @@ extension BluetoothSyncDelegate {
53 52 func syncBug() {}
54 53 // adapted
55 54 func didReceiveBattery(value: Int) { }
  55 + func didReceiveFindPhoneCommand(value: Int) { }
56 56 }
57 57  
58 58  
... ... @@ -1139,7 +1139,7 @@ class BluetoothManager: NSObject {
1139 1139 AudioServicesDisposeSystemSoundID(kSystemSoundID_Vibrate)
1140 1140 case .find_device:
1141 1141 for delegate in syncDelegateList {
1142   - delegate.didReceiveFindPhoneCommand()
  1142 + delegate.didReceiveFindPhoneCommand(value: 1)
1143 1143 }
1144 1144 case .sync:
1145 1145 print("同步")
... ...