Commit 1b6b24016cdbc4ba26144a27291be389fca12944

Authored by jason
1 parent 0a6a1505

feat:api timeFormat distanceUnit wristSense

HDFwear/20240110ReadMe.md
... ... @@ -5,4 +5,17 @@ some APIs have been done before, go through and check them, update some API refe
5 5 接口实现
6 6 BluetoothManager+Function
7 7  
8   -
  8 +设置时间格式
  9 + func newSetTimeFormat(format: TimeFormat, completion: ((_ error: Int?) -> ())? = nil)
  10 + 发送: [237, 126, 0, 1, 0, 16, 0, 1, 0, 1, 1, 162, 3]
  11 + 接收: [237, 126, 0, 1, 128, 1, 0, 29, 0, 5, 0, 1, 0, 16, 0, 217, 3]
  12 +
  13 +设置公英制
  14 + func newSetDistanceUnit(unit: DistanceUnit, completion: ((_ error: Int?) -> ())? = nil)
  15 + 发送: [237, 126, 0, 1, 0, 18, 0, 1, 0, 1, 1, 41, 67]
  16 + 接收: [237, 126, 0, 1, 128, 1, 0, 30, 0, 5, 0, 1, 0, 18, 0, 119, 20]
  17 +
  18 +设置抬腕唤醒
  19 + func newSetWristSense(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
  20 + 发送: [237, 126, 0, 1, 0, 19, 0, 1, 0, 1, 0, 124, 194]
  21 + 接收: [237, 126, 0, 1, 128, 1, 0, 32, 0, 5, 0, 1, 0, 19, 0, 156, 232]
... ...
HDFwear/ReadMe.txt
... ... @@ -17,25 +17,10 @@ BluetoothManager+Function
17 17 发送: [237, 126, 0, 1, 0, 9, 0, 1, 0, 6, 23, 7, 1, 17, 3, 38, 32, 36]
18 18 接收: [237, 126, 0, 1, 128, 1, 0, 14, 0, 5, 0, 1, 0, 9, 0, 149, 41]
19 19  
20   -4. 设置时间格式
21   - func newSetTimeFormat(format: TimeFormat, completion: ((_ error: Int?) -> ())? = nil)
22   - 发送: [237, 126, 0, 1, 0, 16, 0, 1, 0, 1, 1, 162, 3]
23   - 接收: [237, 126, 0, 1, 128, 1, 0, 29, 0, 5, 0, 1, 0, 16, 0, 217, 3]
24   -
25 20 5. 设置温度单位
26 21 func newSetTemperatureUnit(unit: TemperatureUnit, completion: ((_ error: Int?) -> ())? = nil)
27 22 发送: [237, 126, 0, 1, 0, 17, 0, 1, 0, 1, 1, 231, 163]
28 23 接收: [237, 126, 0, 1, 128, 1, 0, 31, 0, 5, 0, 1, 0, 17, 0, 101, 148]
29   -
30   -6. 设置公英制
31   - func newSetDistanceUnit(unit: DistanceUnit, completion: ((_ error: Int?) -> ())? = nil)
32   - 发送: [237, 126, 0, 1, 0, 18, 0, 1, 0, 1, 1, 41, 67]
33   - 接收: [237, 126, 0, 1, 128, 1, 0, 30, 0, 5, 0, 1, 0, 18, 0, 119, 20]
34   -
35   -7. 设置抬腕唤醒
36   - func newSetWristSense(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
37   - 发送: [237, 126, 0, 1, 0, 19, 0, 1, 0, 1, 0, 124, 194]
38   - 接收: [237, 126, 0, 1, 128, 1, 0, 32, 0, 5, 0, 1, 0, 19, 0, 156, 232]
39 24  
40 25 8. 设置触摸唤醒
41 26 func newSetTouchSense(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
... ...
HDFwear/Tools/Bluetooth+Types.swift
... ... @@ -55,16 +55,16 @@ public struct BLEConfig {
55 55  
56 56  
57 57 enum DistanceUnit: UInt8 {
58   - case foot = 1
59   - case meter = 0
  58 + case meter = 1
  59 + case foot = 0
60 60 }
61 61 enum TemperatureUnit: UInt8 {
62 62 case celsius = 0
63 63 case fahrenheit = 1
64 64 }
65 65 enum TimeFormat: UInt8 {
66   - case hour_24 = 0
67   - case hour_12 = 1
  66 + case hour_12 = 0
  67 + case hour_24 = 1
68 68 }
69 69  
70 70 enum BleCmd: UInt8 {
... ...