Commit dbce22d2ea345f6b23196281df4fa58f7adc97d8
1 parent
c7f49054
feat:get battery works after firmware update
Showing
3 changed files
with
6 additions
and
6 deletions
HDFwear/20240110ReadMe.md
@@ -21,9 +21,9 @@ BluetoothManager+Function | @@ -21,9 +21,9 @@ BluetoothManager+Function | ||
21 | 接收: [237, 126, 0, 1, 128, 1, 0, 32, 0, 5, 0, 1, 0, 19, 0, 156, 232] | 21 | 接收: [237, 126, 0, 1, 128, 1, 0, 32, 0, 5, 0, 1, 0, 19, 0, 156, 232] |
22 | 22 | ||
23 | 拉取电量数据 | 23 | 拉取电量数据 |
24 | - func newGetBateryData( completion: ((_ error: Int?) -> ())? = nil) { | 24 | + func newGetBatteryData( completion: ((_ error: Int?) -> ())? = nil) { |
25 | 发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 9, 1, 197] | 25 | 发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 9, 1, 197] |
26 | - 接收: [237, 126, 0, 1, 128, 1, 0, 1, 0, 5, 0, 1, 128, 16, 98, 130, 190] | 26 | + 接收: [237, 126, 0, 1, 128, 16, 0, 1, 0, 1, 85, 19, 139] |
27 | 27 | ||
28 | 设置语言 | 28 | 设置语言 |
29 | func newSetLanguage(lan: UInt8, completion: ((_ error: Int?) -> ())? = nil) | 29 | func newSetLanguage(lan: UInt8, completion: ((_ error: Int?) -> ())? = nil) |
HDFwear/Mine/MineViewController.swift
@@ -402,12 +402,12 @@ extension MineViewController: UITableViewDataSource, UITableViewDelegate { | @@ -402,12 +402,12 @@ extension MineViewController: UITableViewDataSource, UITableViewDelegate { | ||
402 | } | 402 | } |
403 | } | 403 | } |
404 | 404 | ||
405 | - let archiveAction22 = UIAlertAction(title: "newGetBateryData", style: .default) { action in | 405 | + let archiveAction22 = UIAlertAction(title: "newGetBatteryData", style: .default) { action in |
406 | BluetoothManager.shared.newGetBateryData { error in | 406 | BluetoothManager.shared.newGetBateryData { error in |
407 | if error != nil { | 407 | if error != nil { |
408 | - print("newGetBateryData" + (error?.description ?? "")) | 408 | + print("newGetBatteryData" + (error?.description ?? "")) |
409 | }else { | 409 | }else { |
410 | - print("newGetBateryData success") | 410 | + print("newGetBatteryData success") |
411 | } | 411 | } |
412 | } | 412 | } |
413 | } | 413 | } |
HDFwear/Tools/BluetoothManager+Function.swift
@@ -196,7 +196,7 @@ extension BluetoothManager { | @@ -196,7 +196,7 @@ extension BluetoothManager { | ||
196 | } | 196 | } |
197 | 197 | ||
198 | // 拉取电量数据 | 198 | // 拉取电量数据 |
199 | - func newGetBateryData( completion: ((_ error: Int?) -> ())? = nil) { | 199 | + func newGetBatteryData( completion: ((_ error: Int?) -> ())? = nil) { |
200 | let data = BleMessage.shared.getSyncCmd(.battery) | 200 | let data = BleMessage.shared.getSyncCmd(.battery) |
201 | self.setCmdClosure = completion | 201 | self.setCmdClosure = completion |
202 | sendData(data) | 202 | sendData(data) |