@moshenguo/ms-data-sdk 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,132 +1,125 @@
1
+ /**
2
+ * Week information
3
+ */
4
+ export interface MyWeeksV4 {
5
+ /** Whether Sunday is enabled */
6
+ sunday: boolean;
7
+ /** Whether Monday is enabled */
8
+ monday: boolean;
9
+ /** Whether Tuesday is enabled */
10
+ tuesday: boolean;
11
+ /** Whether Wednesday is enabled */
12
+ wednesday: boolean;
13
+ /** Whether Thursday is enabled */
14
+ thursday: boolean;
15
+ /** Whether Friday is enabled */
16
+ friday: boolean;
17
+ /** Whether Saturday is enabled */
18
+ saturday: boolean;
19
+ }
20
+ /**
21
+ * Personal information
22
+ */
1
23
  export interface MyPersonalInfo {
24
+ /** Gender, 0 = female, 1 = male */
2
25
  sex: number;
26
+ /** Age in years */
3
27
  age: number;
28
+ /** Height in centimeters */
4
29
  height: number;
30
+ /** Weight in kilograms */
5
31
  weight: number;
32
+ /** Step length (optional), in centimeters */
6
33
  stepLength?: number;
7
34
  }
35
+ /**
36
+ * Device details
37
+ */
8
38
  export interface MyDeviceInfo {
9
- DistanceUnit: boolean;
39
+ /** Distance unit, true = kilometers, false = miles */
40
+ distanceUnit: boolean;
41
+ /** Whether using 12-hour format, true = 12-hour, false = 24-hour */
10
42
  is12Hour: boolean;
11
- Hand_up_light_screen_switch: boolean;
12
- Fahrenheit: boolean;
13
- Nightmode: boolean;
14
- baseheart: number;
43
+ /** Hand-up screen light switch, true = on, false = off */
44
+ handUpLightScreenSwitch: boolean;
45
+ /** Temperature unit, true = Fahrenheit, false = Celsius */
46
+ fahrenheit: boolean;
47
+ /** Night mode, true = on, false = off */
48
+ nightMode: boolean;
49
+ /** Base heart rate */
50
+ baseHeart: number;
51
+ /** Screen brightness (0-100) */
15
52
  screenBrightness: number;
53
+ /** Dial index */
16
54
  indexDial: number;
55
+ /** Language setting, e.g., 0 = Chinese, 1 = English */
17
56
  languages: number;
18
57
  }
19
58
  /**
20
- * 自动心率监测配置
59
+ * Automatic heart rate monitoring configuration
21
60
  *
22
- * 用于定义用户在一周内自动心率监测的时间段、周期和类型。
61
+ * Defines the time periods, cycles, and types for automatic heart rate monitoring in a week.
23
62
  */
24
63
  export interface MyAutomaticHRMonitoring {
25
64
  /**
26
- * 是否开启监测
27
- * - 0 = 关闭
28
- * - 1 = 开启
65
+ * Whether monitoring is enabled
66
+ * - 0 = off
67
+ * - 1 = on
29
68
  */
30
69
  open: number;
31
- /**
32
- * 开始监测的小时数(0-23)
33
- */
70
+ /** Start hour of monitoring (0-23) */
34
71
  startHour: number;
35
- /**
36
- * 开始监测的分钟数(0-59)
37
- */
72
+ /** Start minute of monitoring (0-59) */
38
73
  startMinute: number;
39
- /**
40
- * 结束监测的小时数(0-23)
41
- */
74
+ /** End hour of monitoring (0-23) */
42
75
  endHour: number;
43
- /**
44
- * 结束监测的分钟数(0-59)
45
- */
76
+ /** End minute of monitoring (0-59) */
46
77
  endMinute: number;
47
78
  /**
48
- * 星期设置(按位表示)
49
- * - 1 = 周一
50
- * - 2 = 周二
51
- * - 4 = 周三
52
- * - 8 = 周四
53
- * - 16 = 周五
54
- * - 32 = 周六
55
- * - 64 = 周日
79
+ * Week configuration (bitmask)
80
+ * - 1 = Monday
81
+ * - 2 = Tuesday
82
+ * - 4 = Wednesday
83
+ * - 8 = Thursday
84
+ * - 16 = Friday
85
+ * - 32 = Saturday
86
+ * - 64 = Sunday
56
87
  *
57
- * 可组合,例如:`1 + 2 + 4 = 7` 表示周一到周三
88
+ * Can be combined, e.g., `1 + 2 + 4 = 7` means Monday to Wednesday
58
89
  */
59
90
  week: number;
60
- /**
61
- * 采样时间间隔(秒)
62
- */
91
+ /** Sampling interval in seconds */
63
92
  time: number;
64
- /**
65
- * 1、设置心率 2、设置血氧 4、设置HRV
66
- */
93
+ /** 1 = heart rate, 2 = SpO2, 4 = HRV */
67
94
  type: number;
68
95
  }
69
- export interface MyWeeksV4 {
70
- sunday: boolean;
71
- monday: boolean;
72
- Tuesday: boolean;
73
- Wednesday: boolean;
74
- Thursday: boolean;
75
- Friday: boolean;
76
- Saturday: boolean;
77
- }
78
96
  /**
79
- * 久坐提醒配置(V4
97
+ * Sedentary reminder configuration (V4)
80
98
  *
81
- * 用于定义用户在一天内的久坐提醒时间段、周期和规则。
99
+ * Defines the time periods, cycles, and rules for sedentary reminders in a day.
82
100
  */
83
101
  export interface MySedentaryReminderV4 {
84
- /**
85
- * 开始提醒的小时数(0–23)
86
- */
102
+ /** Start hour of reminder (0–23) */
87
103
  startTime_Hour: number;
88
- /**
89
- * 开始提醒的分钟数(0–59)
90
- */
104
+ /** Start minute of reminder (0–59) */
91
105
  startTime_Minutes: number;
92
- /**
93
- * 结束提醒的小时数(0–23)
94
- */
106
+ /** End hour of reminder (0–23) */
95
107
  endTime_Hour: number;
96
- /**
97
- * 结束提醒的分钟数(0–59)
98
- */
108
+ /** End minute of reminder (0–59) */
99
109
  endTime_Minutes: number;
100
- /**
101
- * 一周中的提醒天数配置
102
- *
103
- */
110
+ /** Weekdays configuration for reminders */
104
111
  weeks: MyWeeksV4;
105
- /**
106
- * 提醒间隔时间(分钟)
107
- */
112
+ /** Reminder interval time in minutes */
108
113
  intervalTime: number;
109
- /**
110
- * 最低步数门槛
111
- *
112
- * 如果在间隔时间内步数少于此值,则触发久坐提醒。
114
+ /** Minimum step threshold
115
+ * If steps within the interval are below this value, the sedentary reminder is triggered.
113
116
  */
114
117
  leastSteps: number;
115
118
  /**
116
- * 提醒模式
117
- * - 0 = 震动
118
- * - 1 = 声音
119
- * - 2 = 混合提醒
119
+ * Reminder mode
120
+ * - 0 = vibration
121
+ * - 1 = sound
122
+ * - 2 = mixed
120
123
  */
121
124
  mode: number;
122
125
  }
123
- export interface MyAlarmClockV4 {
124
- openOrClose: number;
125
- clockType: number;
126
- endTime_Hour: number;
127
- endTime_Minutes: number;
128
- weeks: number;
129
- intervalTime: number;
130
- leastSteps: number;
131
- mode: number;
132
- }
@@ -1,30 +1,120 @@
1
+ /**
2
+ * Byte operation utility class Data parsing class.
3
+ * Takes Bluetooth data as input and returns it as a dictionary object.
4
+ */
1
5
  export declare class ResolveUtil {
2
- static crcValue(value: number[]): void;
3
6
  private static hexByte2Int;
4
7
  private static bcd2String;
5
8
  static intList2String(bytes: number[]): string;
6
9
  static intList3String(bytes: number[]): string;
10
+ /**
11
+ * Device time parser
12
+ * @param value - The raw value from the device
13
+ * @returns The parsed device time
14
+ */
7
15
  static setMacSuccessful(): {
8
16
  [key: string]: any;
9
17
  };
10
18
  private static intBitToDouble;
19
+ /**
20
+ * Get device time
21
+ * @param value - The raw value from the device
22
+ * @returns The parsed device time
23
+ */
11
24
  static getDeviceTime(value: number[]): any;
12
25
  private static int2Ascll;
26
+ /**
27
+ * Parse GPS time
28
+ * @param value - The raw GPS data
29
+ * @returns The parsed GPS time
30
+ */
13
31
  static getGpsTime(value: number[]): string;
32
+ /**
33
+ * Parse user information
34
+ * @param value - The raw user data
35
+ * @returns The parsed user information
36
+ */
14
37
  static getUserInfo(value: number[]): any;
38
+ /**
39
+ * Parse device information
40
+ * @param value - Raw data from the device
41
+ * @returns Parsed device information
42
+ */
15
43
  static getDeviceInfo(value: number[]): any;
44
+ /**
45
+ * Parse real-time step information
46
+ * @param value - Raw data from the device
47
+ * @returns Parsed real-time step data
48
+ */
16
49
  static getActivityData(value: number[]): any;
50
+ /**
51
+ * Parse step goal information
52
+ * @param value - Raw data from the device
53
+ * @returns Parsed step goal data
54
+ */
17
55
  static getGoal(value: number[]): any;
56
+ /**
57
+ * Device Power Analysis
58
+ * @param value
59
+ * @returns
60
+ */
18
61
  static getDeviceBattery(value: number[]): any;
62
+ /**
63
+ * Device MAC Address Resolution
64
+ * @param value
65
+ * @returns
66
+ */
19
67
  static getDeviceAddress(value: number[]): any;
68
+ /**
69
+ * Device Version Number Parsing
70
+ * @param value
71
+ * @returns
72
+ */
20
73
  static getDeviceVersion(value: number[]): any;
21
- static Reset(): any;
22
- static MCUReset(): any;
23
- static Notify(): any;
74
+ /**
75
+ * Restore factory settings
76
+ * @returns
77
+ */
78
+ static reset(): any;
79
+ /**
80
+ * MCU Software Reset Instruction
81
+ * @returns
82
+ */
83
+ static mcuReset(): any;
84
+ /**
85
+ * Third-Party Reminder Command
86
+ * @returns
87
+ */
88
+ static notify(): any;
89
+ /**
90
+ * Device Name Resolution
91
+ * @param value
92
+ * @returns
93
+ */
24
94
  static getDeviceName(value: number[]): any;
95
+ /**
96
+ * Analysis of Automatic Heart Rate Measurement Time Intervals
97
+ * @param value
98
+ * @returns
99
+ */
25
100
  static getAutoHeart(value: number[]): any;
101
+ /**
102
+ * Weekly Analysis Tool
103
+ * @param ar
104
+ * @returns Byte data
105
+ */
26
106
  static getWeekInt(ar: number[]): number;
107
+ /**
108
+ * Byte to string
109
+ * @param b
110
+ * @returns
111
+ */
27
112
  static getByteString(b: number): string;
113
+ /**
114
+ * Byte Array Parsing
115
+ * @param b
116
+ * @returns
117
+ */
28
118
  static getByteArray(b: number): string;
29
119
  /**
30
120
  * 字节转整数(对应原 _hexByte2Int)
@@ -38,75 +128,276 @@ export declare class ResolveUtil {
38
128
  */
39
129
  private static _bcd2String;
40
130
  /**
41
- * 久坐提醒
131
+ * Sedentary Reminder
132
+ * @param value
133
+ * @returns
42
134
  */
43
- static getActivityAlarm(value: number[]): object;
135
+ static getActivityAlarm(value: number[]): any;
44
136
  /**
45
- * 总运动数据解析
137
+ * Analysis of Overall Movement Data
138
+ * @param value
139
+ * @returns
46
140
  */
47
141
  static getTotalStepData(value: number[]): object;
48
142
  /**
49
- * 详细运动数据解析
143
+ * Detailed Analysis of Sports Data
144
+ * @param value
145
+ * @returns
50
146
  */
51
- static getDetailData(value: number[]): object;
147
+ static getDetailData(value: number[]): any;
52
148
  /**
53
- * 睡眠数据解析
149
+ * Sleep Data Analysis
150
+ * @param value
151
+ * @returns
54
152
  */
55
- static getSleepData(value: number[]): object;
153
+ static getSleepData(value: number[]): any;
56
154
  /**
57
- * 自动血氧数据解析
155
+ * Automated Blood Oxygen Data Analysis
156
+ * @param value
157
+ * @returns
58
158
  */
59
- static getAutoBloodOxygen(value: number[]): object;
159
+ static getAutoBloodOxygen(value: number[]): any;
60
160
  /**
61
- * 历史血氧数据解析(与自动血氧逻辑一致,复用代码)
161
+ * Historical Blood Oxygen Data Analysis (Consistent with automatic blood oxygen logic, reusing code)
162
+ * @param value
163
+ * @returns
62
164
  */
63
- static getBloodoxygen(value: number[]): object;
165
+ static getBloodoxygen(value: number[]): any;
64
166
  /**
65
- * 历史心率数据解析
167
+ * Historical Heart Rate Data Analysis
168
+ * @param value
169
+ * @returns
66
170
  */
67
- static getHeartData(value: number[]): object;
171
+ static getHeartData(value: number[]): any;
68
172
  /**
69
- * 单次历史心率数据解析
173
+ * Single-Session Historical Heart Rate Data Analysis
174
+ * @param value
175
+ * @returns
176
+ */
177
+ static getOnceHeartData(value: number[]): any;
178
+ /**
179
+ * HRV Test Data Analysis HRV Test Data Analysis
180
+ * @param value
181
+ * @returns
70
182
  */
71
- static getOnceHeartData(value: number[]): object;
72
183
  static getHrvTestData(value: number[]): any;
184
+ /**
185
+ * Alarm Clock Data Analysis
186
+ * @param value
187
+ * @returns
188
+ */
73
189
  static getClockData(value: number[]): any;
190
+ /**
191
+ * Analysis of Axillary Temperature Data
192
+ * @param value
193
+ * @returns
194
+ */
74
195
  static getTempDataer(value: number[]): any;
196
+ /**
197
+ * QR Code-Related Functions
198
+ * @param value
199
+ * @param flag
200
+ * @returns
201
+ */
75
202
  static getQrCode(value: number[], flag: boolean): any;
203
+ /**
204
+ * Analysis of Historical Temperature Data
205
+ * @param value
206
+ * @returns
207
+ */
76
208
  static getTempData(value: number[]): any;
209
+ /**
210
+ * Analysis of Sports Mode Data
211
+ * @param value
212
+ * @returns
213
+ */
77
214
  static getExerciseData(value: number[]): any;
215
+ /**
216
+ * Activity and Exercise Data Analysis
217
+ * @param value
218
+ * @returns
219
+ */
78
220
  static getActivityExerciseData(value: number[]): any;
221
+ /**
222
+ * Time setting successful response
223
+ * @param value
224
+ * @returns
225
+ */
79
226
  static setTimeSuccessful(value: number[]): any;
227
+ /**
228
+ * 辅助方法:获取数据块
229
+ * @param length
230
+ * @param start
231
+ * @param value
232
+ * @returns
233
+ */
80
234
  private static getData;
81
235
  private static getFloat;
82
236
  private static getInt;
237
+ /**
238
+ * Setup successful response
239
+ * @param dataType
240
+ * @returns
241
+ */
83
242
  static setMethodSuccessful(dataType: string): any;
243
+ /**
244
+ * ECG Data Analysis
245
+ * @param value
246
+ * @returns
247
+ */
84
248
  static getEcgHistoryData(value: number[]): any;
85
249
  private static getEcgDataString;
250
+ /**
251
+ * ECG Data Analysis
252
+ * @param value
253
+ * @returns
254
+ */
86
255
  static ecgData(value: number[]): any;
256
+ /**
257
+ * PPG Data Analysis
258
+ * @param value
259
+ * @returns
260
+ */
87
261
  static ppgData(value: number[]): any;
262
+ /**
263
+ * ECG Interpretation ECG Interpretation
264
+ * @param value
265
+ * @returns
266
+ */
88
267
  static ecgResult(value: number[]): any;
268
+ /**
269
+ * Enter ECG mode
270
+ * @param value
271
+ * @returns
272
+ */
89
273
  static enterEcg(value: number[]): any;
274
+ /**
275
+ * Measurement type handling
276
+ * @param flag Enable measurement. true: real-time blood glucose measurement returns
277
+ * @param value Data returned by the firmware
278
+ * @returns
279
+ */
90
280
  static measurementWithType(flag: boolean, value: number[]): any;
281
+ /**
282
+ * Smartband watch face settings
283
+ * @param isRunning
284
+ * @param value
285
+ * @returns
286
+ */
91
287
  static braceletdial(isruning: boolean, value: number[]): any;
288
+ /**
289
+ * Get Exercise Mode
290
+ * @param value
291
+ * @returns
292
+ */
92
293
  static getSportMode(value: number[]): any;
294
+ /**
295
+ * GPS Control Command Parsing
296
+ * @param value
297
+ * @returns
298
+ */
93
299
  static gPSControlCommand(value: number[]): any;
300
+ /**
301
+ * Set social distancing
302
+ * @param value
303
+ * @returns
304
+ */
94
305
  static setSocial(value: number[]): any;
95
- static eCGQuality(value: number[]): any;
306
+ /**
307
+ * ECG Quality Data
308
+ * @param value
309
+ * @returns
310
+ */
311
+ static ecgQuality(value: number[]): any;
312
+ /**
313
+ * Enter Photo Mode Return
314
+ * @param value
315
+ * @returns
316
+ */
96
317
  static enterPhotoModeback(value: number[]): any;
318
+ /**
319
+ * Set up new device information
320
+ * @param value
321
+ * @returns
322
+ */
97
323
  static setNewDeviceInfo(value: number[]): any;
324
+ /**
325
+ * Retrieve new device information
326
+ * @param value
327
+ * @returns
328
+ */
98
329
  static getNewDeviceInfo(value: number[]): any;
330
+ /**
331
+ * Alarm updated successfully
332
+ * @param value
333
+ * @returns
334
+ */
99
335
  static updateClockSuccessful(value: number[]): any;
336
+ /**
337
+ * Set Blood Glucose Status
338
+ * @param value
339
+ * @returns
340
+ */
100
341
  static setBoolSugarStatus(value: number[]): any;
342
+ /**
343
+ * Set blood glucose level Set blood glucose levels
344
+ * @param value
345
+ * @returns
346
+ */
101
347
  static setBoolSugarValue(value: number[]): any;
348
+ /**
349
+ * Incorrect setup method
350
+ * @param dataType
351
+ * @returns
352
+ */
102
353
  static setMethodError(dataType: string): any;
354
+ /**
355
+ * Read pregnancy cycle data
356
+ * @param value
357
+ * @returns
358
+ */
103
359
  static readPregnancyCycle(value: number[]): any;
360
+ /**
361
+ * Analysis of Women's Health Data
362
+ * @param value
363
+ * @returns
364
+ */
104
365
  static readWomenHealth(value: number[]): any;
366
+ /**
367
+ *Analysis of Temperature Correction Values
368
+ * @param value
369
+ * @returns
370
+ */
105
371
  static getTemperatureCorrectionValue(value: number[]): any;
106
372
  private static byteArrayToInt;
373
+ /**
374
+ * Retrieve historical GPS data
375
+ * @param value
376
+ * @returns
377
+ */
107
378
  static getHistoryGpsData(value: number[]): any;
379
+ /**
380
+ * PPI Test Data Analysis
381
+ * @param value
382
+ * @returns
383
+ */
108
384
  static getPPITestData(value: number[]): any;
385
+ /**
386
+ * Acquire HRV measurement time data
387
+ * @param value
388
+ * @returns
389
+ */
109
390
  static getHrvTimeData(value: number[]): any;
391
+ /**
392
+ * Disconnect Bluetooth
393
+ * @param value
394
+ * @returns
395
+ */
110
396
  static closeDevices(value: number[]): any;
397
+ /**
398
+ * Detach Detection Status Reporting
399
+ * @param value
400
+ * @returns
401
+ */
111
402
  static getOffCheckStatus(value: number[]): any;
112
403
  }