Commit 1605ea7d7cbc23b7522e91b82c579db9bc5438ba
1 parent
079b41b8
feat:camera
Showing
4 changed files
with
13 additions
and
7 deletions
HDFwear/Setting/CameraViewController.swift
... | ... | @@ -275,11 +275,13 @@ class CameraViewController: UIViewController, BluetoothSyncDelegate, UIImagePick |
275 | 275 | } |
276 | 276 | |
277 | 277 | |
278 | - func didReceiveCameraCommand(status: SetCmd) { | |
278 | + func didReceiveCameraCommand(status: UInt8) { | |
279 | 279 | switch status { |
280 | - case .takePicture: | |
280 | + case 0x00://进入拍照 | |
281 | 281 | countDown() |
282 | - case .exitCamera: | |
282 | + case 0x01:// 拍照 | |
283 | + print("拍照") | |
284 | + case 0x02:// 关闭 | |
283 | 285 | back(1) |
284 | 286 | default: |
285 | 287 | break | ... | ... |
HDFwear/Tools/Bluetooth+Types.swift
... | ... | @@ -137,8 +137,8 @@ enum NewCmd: UInt8 { |
137 | 137 | case setbloodOxygenAutoDetect = 0x0025 |
138 | 138 | case setUserInfo = 0x0026 |
139 | 139 | case setNoDisturb = 0x0027 |
140 | - //jtd! | |
141 | 140 | case setSynWatch = 0x0028 |
141 | + //jtd! | |
142 | 142 | // case setBeiDouContact = 0x0029 |
143 | 143 | // case setBeiDouQuickAnswer = 0x0030 |
144 | 144 | ... | ... |
HDFwear/Tools/BluetoothManager+Function.swift
... | ... | @@ -346,6 +346,10 @@ extension BluetoothManager { |
346 | 346 | print("分时段计步数据上报") |
347 | 347 | case 0x8022:// 遥控拍照 |
348 | 348 | print("遥控拍照") |
349 | + let stauts = bytes[10] | |
350 | + for delegate in syncDelegateList { | |
351 | + delegate.didReceiveCameraCommand(status: stauts) | |
352 | + } | |
349 | 353 | default: |
350 | 354 | break |
351 | 355 | } | ... | ... |
HDFwear/Tools/BluetoothManager.swift
... | ... | @@ -28,7 +28,6 @@ protocol BluetoothManagerDelegate: NSObjectProtocol { |
28 | 28 | |
29 | 29 | protocol BluetoothSyncDelegate { |
30 | 30 | func didReceiveFindCommand(status: Bool) |
31 | - func didReceiveCameraCommand(status: SetCmd) | |
32 | 31 | func didReceiveHeartRate(value: Int) |
33 | 32 | func didReceiveBloodOxygen() |
34 | 33 | func didReceiveBloodPressure() |
... | ... | @@ -40,10 +39,10 @@ protocol BluetoothSyncDelegate { |
40 | 39 | func didReceiveBattery(value: Int) |
41 | 40 | func didReceiveFindPhoneCommand(value: Int) |
42 | 41 | func didReceiveCallOff() |
42 | + func didReceiveCameraCommand(status: UInt8)// 0x00 进入拍照 0x01 拍照 0x02 关闭 | |
43 | 43 | } |
44 | 44 | extension BluetoothSyncDelegate { |
45 | 45 | func didReceiveFindCommand(status: Bool) { } |
46 | - func didReceiveCameraCommand(status: SetCmd) { } | |
47 | 46 | func didReceiveHeartRate(value: Int) { } |
48 | 47 | func didReceiveBloodOxygen() { } |
49 | 48 | func didReceiveBloodPressure() { } |
... | ... | @@ -55,6 +54,7 @@ extension BluetoothSyncDelegate { |
55 | 54 | func didReceiveBattery(value: Int) { } |
56 | 55 | func didReceiveFindPhoneCommand(value: Int) { } |
57 | 56 | func didReceiveCallOff(){ } |
57 | + func didReceiveCameraCommand(status: UInt8) { } | |
58 | 58 | } |
59 | 59 | |
60 | 60 | |
... | ... | @@ -1076,7 +1076,7 @@ class BluetoothManager: NSObject { |
1076 | 1076 | } |
1077 | 1077 | case .takePicture, .exitCamera: |
1078 | 1078 | for delegate in syncDelegateList { |
1079 | - delegate.didReceiveCameraCommand(status: key!) | |
1079 | + delegate.didReceiveCameraCommand(status: 0x01) | |
1080 | 1080 | } |
1081 | 1081 | case .openCamera: |
1082 | 1082 | // print("收到打开箱机") | ... | ... |