diff --git a/HDFwear/Setting/CameraViewController.swift b/HDFwear/Setting/CameraViewController.swift index 903378c..fc269c3 100644 --- a/HDFwear/Setting/CameraViewController.swift +++ b/HDFwear/Setting/CameraViewController.swift @@ -275,11 +275,13 @@ class CameraViewController: UIViewController, BluetoothSyncDelegate, UIImagePick } - func didReceiveCameraCommand(status: SetCmd) { + func didReceiveCameraCommand(status: UInt8) { switch status { - case .takePicture: + case 0x00://进入拍照 countDown() - case .exitCamera: + case 0x01:// 拍照 + print("拍照") + case 0x02:// 关闭 back(1) default: break diff --git a/HDFwear/Tools/Bluetooth+Types.swift b/HDFwear/Tools/Bluetooth+Types.swift index 8eec953..3221ccd 100644 --- a/HDFwear/Tools/Bluetooth+Types.swift +++ b/HDFwear/Tools/Bluetooth+Types.swift @@ -137,8 +137,8 @@ enum NewCmd: UInt8 { case setbloodOxygenAutoDetect = 0x0025 case setUserInfo = 0x0026 case setNoDisturb = 0x0027 - //jtd! case setSynWatch = 0x0028 + //jtd! // case setBeiDouContact = 0x0029 // case setBeiDouQuickAnswer = 0x0030 diff --git a/HDFwear/Tools/BluetoothManager+Function.swift b/HDFwear/Tools/BluetoothManager+Function.swift index 63f0e70..83d871f 100644 --- a/HDFwear/Tools/BluetoothManager+Function.swift +++ b/HDFwear/Tools/BluetoothManager+Function.swift @@ -346,6 +346,10 @@ extension BluetoothManager { print("分时段计步数据上报") case 0x8022:// 遥控拍照 print("遥控拍照") + let stauts = bytes[10] + for delegate in syncDelegateList { + delegate.didReceiveCameraCommand(status: stauts) + } default: break } diff --git a/HDFwear/Tools/BluetoothManager.swift b/HDFwear/Tools/BluetoothManager.swift index 1fc5cbd..3b1f395 100644 --- a/HDFwear/Tools/BluetoothManager.swift +++ b/HDFwear/Tools/BluetoothManager.swift @@ -28,7 +28,6 @@ protocol BluetoothManagerDelegate: NSObjectProtocol { protocol BluetoothSyncDelegate { func didReceiveFindCommand(status: Bool) - func didReceiveCameraCommand(status: SetCmd) func didReceiveHeartRate(value: Int) func didReceiveBloodOxygen() func didReceiveBloodPressure() @@ -40,10 +39,10 @@ protocol BluetoothSyncDelegate { func didReceiveBattery(value: Int) func didReceiveFindPhoneCommand(value: Int) func didReceiveCallOff() + func didReceiveCameraCommand(status: UInt8)// 0x00 进入拍照 0x01 拍照 0x02 关闭 } extension BluetoothSyncDelegate { func didReceiveFindCommand(status: Bool) { } - func didReceiveCameraCommand(status: SetCmd) { } func didReceiveHeartRate(value: Int) { } func didReceiveBloodOxygen() { } func didReceiveBloodPressure() { } @@ -55,6 +54,7 @@ extension BluetoothSyncDelegate { func didReceiveBattery(value: Int) { } func didReceiveFindPhoneCommand(value: Int) { } func didReceiveCallOff(){ } + func didReceiveCameraCommand(status: UInt8) { } } @@ -1076,7 +1076,7 @@ class BluetoothManager: NSObject { } case .takePicture, .exitCamera: for delegate in syncDelegateList { - delegate.didReceiveCameraCommand(status: key!) + delegate.didReceiveCameraCommand(status: 0x01) } case .openCamera: // print("收到打开箱机")