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,6 +301,11 @@ extension BluetoothManager { | ||
301 | } | 301 | } |
302 | case 0x8014:// 电话挂断 | 302 | case 0x8014:// 电话挂断 |
303 | print("电话挂断") | 303 | print("电话挂断") |
304 | + if bytes[10] == 0x02 { | ||
305 | + for delegate in syncDelegateList { | ||
306 | + delegate.didReceiveCallOff() | ||
307 | + } | ||
308 | + } | ||
304 | case 0x8015:// 找手机 | 309 | case 0x8015:// 找手机 |
305 | print("找手机") | 310 | print("找手机") |
306 | let ring = Int(bytes[10]) | 311 | let ring = Int(bytes[10]) |
HDFwear/Tools/BluetoothManager.swift
@@ -39,6 +39,7 @@ protocol BluetoothSyncDelegate { | @@ -39,6 +39,7 @@ protocol BluetoothSyncDelegate { | ||
39 | // adapted | 39 | // adapted |
40 | func didReceiveBattery(value: Int) | 40 | func didReceiveBattery(value: Int) |
41 | func didReceiveFindPhoneCommand(value: Int) | 41 | func didReceiveFindPhoneCommand(value: Int) |
42 | + func didReceiveCallOff() | ||
42 | } | 43 | } |
43 | extension BluetoothSyncDelegate { | 44 | extension BluetoothSyncDelegate { |
44 | func didReceiveFindCommand(status: Bool) { } | 45 | func didReceiveFindCommand(status: Bool) { } |
@@ -53,6 +54,7 @@ extension BluetoothSyncDelegate { | @@ -53,6 +54,7 @@ extension BluetoothSyncDelegate { | ||
53 | // adapted | 54 | // adapted |
54 | func didReceiveBattery(value: Int) { } | 55 | func didReceiveBattery(value: Int) { } |
55 | func didReceiveFindPhoneCommand(value: Int) { } | 56 | func didReceiveFindPhoneCommand(value: Int) { } |
57 | + func didReceiveCallOff(){ } | ||
56 | } | 58 | } |
57 | 59 | ||
58 | 60 |