Commit dd1edac258ee97ad9ffb66d9f71401d128c5e2df
1 parent
357b7f27
feat:call off
Showing
2 changed files
with
7 additions
and
0 deletions
HDFwear/Tools/BluetoothManager+Function.swift
... | ... | @@ -301,6 +301,11 @@ extension BluetoothManager { |
301 | 301 | } |
302 | 302 | case 0x8014:// 电话挂断 |
303 | 303 | print("电话挂断") |
304 | + if bytes[10] == 0x02 { | |
305 | + for delegate in syncDelegateList { | |
306 | + delegate.didReceiveCallOff() | |
307 | + } | |
308 | + } | |
304 | 309 | case 0x8015:// 找手机 |
305 | 310 | print("找手机") |
306 | 311 | let ring = Int(bytes[10]) | ... | ... |
HDFwear/Tools/BluetoothManager.swift
... | ... | @@ -39,6 +39,7 @@ protocol BluetoothSyncDelegate { |
39 | 39 | // adapted |
40 | 40 | func didReceiveBattery(value: Int) |
41 | 41 | func didReceiveFindPhoneCommand(value: Int) |
42 | + func didReceiveCallOff() | |
42 | 43 | } |
43 | 44 | extension BluetoothSyncDelegate { |
44 | 45 | func didReceiveFindCommand(status: Bool) { } |
... | ... | @@ -53,6 +54,7 @@ extension BluetoothSyncDelegate { |
53 | 54 | // adapted |
54 | 55 | func didReceiveBattery(value: Int) { } |
55 | 56 | func didReceiveFindPhoneCommand(value: Int) { } |
57 | + func didReceiveCallOff(){ } | |
56 | 58 | } |
57 | 59 | |
58 | 60 | ... | ... |