Blame view

HDFwear/ReadMe.txt 6.64 KB
f13858d1   daifengyi   feat:read me
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  接口说明:
  
  接口实现
  BluetoothManager+Function
  
  发送数据类
  1. 通用应答
      func response(frameNumber: [UInt8], messageId: [UInt8], success: Bool, completion: ((_ error: Int?) -> ())? = nil)
  
  2. 查询设备信息
      func queryDeviceInfo(queryItems: [UInt8], completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 16, 0, 1, 0, 3, 2, 2, 3, 169, 70]
      接收: [237, 126, 0, 1, 128, 1, 0, 37, 0, 5, 0, 1, 0, 16, 0, 129, 5]
      
  3. 设置时间
      func newSetTime(completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 9, 0, 1, 0, 6, 23, 7, 1, 17, 3, 38, 32, 36]
      接收: [237, 126, 0, 1, 128, 1, 0, 14, 0, 5, 0, 1, 0, 9, 0, 149, 41]
      
  4. 设置时间格式
      func newSetTimeFormat(format: TimeFormat, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 16, 0, 1, 0, 1, 1, 162, 3]
      接收: [237, 126, 0, 1, 128, 1, 0, 29, 0, 5, 0, 1, 0, 16, 0, 217, 3]
      
  5. 设置温度单位
      func newSetTemperatureUnit(unit: TemperatureUnit, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 17, 0, 1, 0, 1, 1, 231, 163]
      接收: [237, 126, 0, 1, 128, 1, 0, 31, 0, 5, 0, 1, 0, 17, 0, 101, 148]
      
  6. 设置公英制
      func newSetDistanceUnit(unit: DistanceUnit, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 18, 0, 1, 0, 1, 1, 41, 67]
      接收: [237, 126, 0, 1, 128, 1, 0, 30, 0, 5, 0, 1, 0, 18, 0, 119, 20]
      
  7. 设置抬腕唤醒
      func newSetWristSense(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 19, 0, 1, 0, 1, 0, 124, 194]
      接收: [237, 126, 0, 1, 128, 1, 0, 32, 0, 5, 0, 1, 0, 19, 0, 156, 232]
  
  8. 设置触摸唤醒
      func newSetTouchSense(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 20, 0, 1, 0, 1, 1, 164, 162]
  
  9. 设置低电提醒
      func newSetLowPowerRemind(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 21, 0, 1, 0, 1, 1, 225, 2]
      
  10. 设置语言
      func newSetLanguage(lan: UInt8, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 22, 0, 1, 0, 1, 0, 63, 195]
      
  11. 设置恢复出厂设置
      func newSetRestore(completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 23, 0, 1, 0, 0, 19, 107]
      
  12. 设置心率过高提醒
      func newSetHeartRateHighRemind(maxHr: UInt8, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 24, 0, 1, 0, 1, 120, 64, 255]
      接收: [237, 126, 0, 1, 128, 1, 0, 33, 0, 5, 0, 1, 0, 24, 0, 7, 193]
      
  13. 设置心率过低提醒
      func newSetHeartRateLowRemind(minHr: UInt8, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 25, 0, 1, 0, 1, 120, 5, 95]
      
  14. 设置查找手表
      func newSetFindWatch(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 32, 0, 1, 0, 1, 1, 141, 143]
      接收: [237, 126, 0, 1, 128, 1, 0, 38, 0, 5, 0, 1, 0, 32, 0, 76, 229]
      
  15. 设置压力自动检测
      func newSetPressureAutoDetect(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 36, 0, 1, 0, 1, 1, 139, 46]
      接收: [237, 126, 0, 1, 128, 1, 0, 34, 0, 5, 0, 1, 0, 36, 0, 143, 76]
      
  16. 设置血氧自动检测
      func newSetBloodOxygenAutoDetect(bool: Bool, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 37, 0, 1, 0, 1, 1, 206, 142]
      接收: [237, 126, 0, 1, 128, 1, 0, 35, 0, 5, 0, 1, 0, 37, 0, 251, 174]
      
  17. 设置用户信息
      func newSetUserInfo(_ user: UserInfoModel, completion: ((_ error: Int?) -> ())? = nil)
      发送: [237, 126, 0, 1, 0, 38, 0, 1, 0, 5, 0, 65, 0, 175, 1, 41, 211]
  
  18. 设置勿扰模式
      func newSetNotDisturb(remind: RemindModel, weekflag:[WeekFlag], isRepeat:Bool, completion: @escaping(_ error: Int?) -> ())
      发送: [237, 126, 0, 1, 0, 39, 0, 1, 0, 7, 0, 1, 33, 22, 0, 22, 0, 159, 5]
      
  19. 拉取睡眠数据
b150ccd0   daifengyi   fix:fetch api param
89
      func getSleepHistoryData(closure: SleepClosure? = nil)
f13858d1   daifengyi   feat:read me
90
91
92
      发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 6, 240, 42]
      
  20. 拉取血氧数据
b150ccd0   daifengyi   fix:fetch api param
93
      func getBloodOxygenHistoryData(closure: BloodOxygenClosure? = nil)
f13858d1   daifengyi   feat:read me
94
95
96
      发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 2, 176, 174]
      
  21. 拉取心跳数据
b150ccd0   daifengyi   fix:fetch api param
97
      func getHeartRateHistoryData(closure: HeartRateClosure? = nil)
f13858d1   daifengyi   feat:read me
98
99
100
      发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 1, 128, 205]
      
  22. 拉取计步数据
b150ccd0   daifengyi   fix:fetch api param
101
      func getStepHistoryData(closure: StepClosure? = nil)
f13858d1   daifengyi   feat:read me
102
103
104
      发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 3, 160, 143]
      
  23. 拉取训练数据
b150ccd0   daifengyi   fix:fetch api param
105
      func getTrainHistoryData(closure: TrainClosure? = nil)
f13858d1   daifengyi   feat:read me
106
107
108
      发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 7, 224, 11]
      
  24. 拉取压力数据
b150ccd0   daifengyi   fix:fetch api param
109
      func getPressureHistoryData(closure: PressureClosure? = nil)
f13858d1   daifengyi   feat:read me
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
      发送: [237, 126, 0, 1, 0, 40, 0, 1, 0, 1, 5, 192, 73]
      
  接受数据类
  1. 通用返回数据
      private func parseDefaultResponseData(_ bytes: [UInt8])
      接收: [237, 126, 0, 1, 128, 1, 0, 14, 0, 5, 0, 1, 0, 9, 0, 149, 41]
      
  2. 设备信息数据
      private func parseDeviceInfoData (_ content:[UInt8])
      
  3. 心跳数据
      func parseHeartRateData (_ content: [UInt8])
      接收: [237, 126, 0, 1, 128, 22, 0, 7, 0, 200, 100, 157, 163, 180, 112, 100, 157, 170, 188, 247, 100, 157, 177, 196, 6, 100, 157, 184, 204, 0, 100, 157, 191, 212, 22, 100, 157, 198, 220, 249, 100, 157, 205, 228, 6, 100, 157, 212, 236, 0, 100, 157, 219, 244, 0, 100, 157, 226, 252, 251, 100, 157, 234, 4, 6, 100, 157, 241, 12, 0, 100, 157, 248, 20, 229, 100, 157, 255, 28, 253, 100, 158, 6, 36, 6, 100, 158, 13, 44, 0, 100, 158, 20, 52, 197, 100, 158, 27, 60, 255, 100, 158, 34, 68, 6, 100, 158, 41, 76, 0, 100, 158, 48, 84, 180, 100, 158, 55, 92, 1, 100, 158, 62, 100, 7, 100, 158, 69, 108, 0, 100, 158, 76, 116, 158, 100, 158, 83, 124, 2, 100, 158, 90, 132, 7, 100, 158, 97, 140, 0, 100, 158, 104, 148, 131, 100, 158, 111, 156, 4, 100, 158, 118, 164, 7, 100, 158, 125, 172, 0, 100, 158, 132, 180, 114, 100, 158, 139, 188, 6, 100, 158, 146, 196, 7, 100, 158, 153, 204, 0, 100, 158, 160, 212, 87, 100, 158, 167, 220, 8, 100, 158, 174, 228, 7, 100, 158, 181, 236, 20, 23, 62]
      
  4. 血氧数据
      func parseBlooodOxygenData (_ content: [UInt8])
      
  5. 体温数据
      func parseTemperaturData (_ content: [UInt8])
      
  6. 压力数据
      func parsePressureData (_ content: [UInt8])
      
  7. 计步数据
      func parseStepData (_ content: [UInt8])
      
  8. 睡眠数据
      func parseSleepData (_ content: [UInt8])
      
  9. 电量变化自动上报
      0x8010
  
  10. 电话挂断
      0x8014
  
  11. 找手机
      0x8015
      
  12. 遥控拍照
      0x8022
      
      
  
  底层指令组包
  BleMessage+Function
  匹配上面的发送的数据与接受的数据