From dd1edac258ee97ad9ffb66d9f71401d128c5e2df Mon Sep 17 00:00:00 2001 From: daifengyi Date: Fri, 30 Jun 2023 15:33:18 +0800 Subject: [PATCH] feat:call off --- HDFwear/Tools/BluetoothManager+Function.swift | 5 +++++ HDFwear/Tools/BluetoothManager.swift | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/HDFwear/Tools/BluetoothManager+Function.swift b/HDFwear/Tools/BluetoothManager+Function.swift index 046530a..a96e9d9 100644 --- a/HDFwear/Tools/BluetoothManager+Function.swift +++ b/HDFwear/Tools/BluetoothManager+Function.swift @@ -301,6 +301,11 @@ extension BluetoothManager { } case 0x8014:// 电话挂断 print("电话挂断") + if bytes[10] == 0x02 { + for delegate in syncDelegateList { + delegate.didReceiveCallOff() + } + } case 0x8015:// 找手机 print("找手机") let ring = Int(bytes[10]) diff --git a/HDFwear/Tools/BluetoothManager.swift b/HDFwear/Tools/BluetoothManager.swift index e4126d3..1fc5cbd 100644 --- a/HDFwear/Tools/BluetoothManager.swift +++ b/HDFwear/Tools/BluetoothManager.swift @@ -39,6 +39,7 @@ protocol BluetoothSyncDelegate { // adapted func didReceiveBattery(value: Int) func didReceiveFindPhoneCommand(value: Int) + func didReceiveCallOff() } extension BluetoothSyncDelegate { func didReceiveFindCommand(status: Bool) { } @@ -53,6 +54,7 @@ extension BluetoothSyncDelegate { // adapted func didReceiveBattery(value: Int) { } func didReceiveFindPhoneCommand(value: Int) { } + func didReceiveCallOff(){ } } -- libgit2 0.21.4