@moshenguo/ms-data-sdk 0.1.2 → 0.1.4

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.
Files changed (41) hide show
  1. package/build/index.d.ts +2 -5
  2. package/build/index.d.ts.map +1 -1
  3. package/build/index.js +3 -8
  4. package/build/index.js.map +1 -1
  5. package/build/sdk/bleConst.d.ts +0 -2
  6. package/build/sdk/bleConst.d.ts.map +1 -1
  7. package/build/sdk/bleConst.js +0 -2
  8. package/build/sdk/bleConst.js.map +1 -1
  9. package/build/sdk/bleSDK.d.ts +283 -14
  10. package/build/sdk/bleSDK.d.ts.map +1 -1
  11. package/build/sdk/bleSDK.js +284 -155
  12. package/build/sdk/bleSDK.js.map +1 -1
  13. package/build/sdk/models.d.ts +75 -0
  14. package/build/sdk/models.d.ts.map +1 -1
  15. package/build/sdk/models.js.map +1 -1
  16. package/build/sdk/resolveUtil.d.ts +2 -2
  17. package/build/sdk/resolveUtil.js +2 -2
  18. package/build/sdk/resolveUtil.js.map +1 -1
  19. package/docs/.nojekyll +1 -0
  20. package/docs/assets/hierarchy.js +1 -0
  21. package/docs/assets/highlight.css +36 -0
  22. package/docs/assets/icons.js +18 -0
  23. package/docs/assets/icons.svg +1 -0
  24. package/docs/assets/main.js +60 -0
  25. package/docs/assets/navigation.js +1 -0
  26. package/docs/assets/search.js +1 -0
  27. package/docs/assets/style.css +1633 -0
  28. package/docs/classes/BleSDK.html +263 -0
  29. package/docs/classes/ResolveUtil.html +74 -0
  30. package/docs/hierarchy.html +1 -0
  31. package/docs/index.html +13 -0
  32. package/docs/interfaces/MyAlarmClockV4.html +9 -0
  33. package/docs/interfaces/MyAutomaticHRMonitoring.html +33 -0
  34. package/docs/interfaces/MyDeviceInfo.html +10 -0
  35. package/docs/interfaces/MyPersonalInfo.html +6 -0
  36. package/docs/interfaces/MySedentaryReminderV4.html +25 -0
  37. package/docs/interfaces/MyWeeksV4.html +8 -0
  38. package/docs/modules.html +1 -0
  39. package/docs/variables/BleConst.html +1 -0
  40. package/docs/variables/DeviceKey.html +1 -0
  41. package/package.json +4 -3
@@ -48,12 +48,14 @@ export class BleSDK {
48
48
  list[list.length - 1] = crcValue & 0xff;
49
49
  }
50
50
  static getBcdValue(value) {
51
- // let data = value.toString();
52
- // if (data.length > 2) data = data.substring(0, 2);
53
- // return parseInt(data, 16);
54
51
  return Math.floor(value / 10) * 16 + (value % 10);
55
52
  }
56
- static DataParsingWithData(value) {
53
+ /**
54
+ * 数据解析方法
55
+ * @param 蓝牙返回原始数据
56
+ * @returns 解析后的数据
57
+ */
58
+ static dataParsingWithData(value) {
57
59
  if (!value || value.length === 0) {
58
60
  return ResolveUtil.setMethodError('Empty data');
59
61
  }
@@ -184,18 +186,11 @@ export class BleSDK {
184
186
  case DeviceConst.CMD_GET_BLOODSUGAR_DATA:
185
187
  return ResolveUtil.setBoolSugarValue(value);
186
188
  case DeviceConst.GetEcgPpgStatus:
187
- return ResolveUtil.ECGResult(value);
189
+ return ResolveUtil.ecgResult(value);
188
190
  case DeviceConst.PregnancyCycle:
189
191
  return ResolveUtil.readPregnancyCycle(value);
190
192
  case DeviceConst.GetEcgSaveData:
191
193
  return ResolveUtil.getEcgHistoryData(value);
192
- case DeviceConst.Openecg:
193
- if (value.length >= 16) {
194
- return ResolveUtil.ecgData(value);
195
- }
196
- else {
197
- return ResolveUtil.setMethodSuccessful(BleConst.ECG);
198
- }
199
194
  case DeviceConst.WomenHealth:
200
195
  if (value[1] === 0) {
201
196
  return ResolveUtil.setMethodSuccessful(BleConst.SetWomenHealth);
@@ -203,8 +198,6 @@ export class BleSDK {
203
198
  else {
204
199
  return ResolveUtil.readWomenHealth(value);
205
200
  }
206
- case DeviceConst.Closeecg:
207
- return ResolveUtil.setMethodSuccessful(BleConst.CloseECG);
208
201
  case DeviceConst.BloodsugarWithMode:
209
202
  const ppi2 = this.hexByte2Int(value[2], 0);
210
203
  switch (ppi2) {
@@ -232,7 +225,12 @@ export class BleSDK {
232
225
  }
233
226
  return ResolveUtil.setMethodError(this.getBcdValue(value[0]).toString());
234
227
  }
235
- ///血糖
228
+ /**
229
+ * 血糖
230
+ * @param ppgMode
231
+ * @param ppgStatus
232
+ * @returns
233
+ */
236
234
  static bloodsugarWithMode(ppgMode, ppgStatus) {
237
235
  const value = this.generateInitValue();
238
236
  value[0] = DeviceConst.BloodsugarWithMode;
@@ -243,26 +241,12 @@ export class BleSDK {
243
241
  this.crcValue(value);
244
242
  return value;
245
243
  }
246
- static openECGPPG(level, time) {
247
- this.ecgopen = level !== 0;
248
- const value = this.generateInitValue();
249
- value[0] = DeviceConst.Openecg;
250
- value[1] = level;
251
- value[3] = (time) & 0xff;
252
- value[4] = (time >> 8) & 0xff;
253
- this.crcValue(value);
254
- return value;
255
- }
256
- static stopEcgPPg() {
257
- const value = this.generateInitValue();
258
- value[0] = DeviceConst.Closeecg;
259
- this.crcValue(value);
260
- return value;
261
- }
262
- ///获得睡眠详细数据
263
- ///mode : 0-读最近的睡眠详细数据 2-继续上次读的位置下一段数据 99-删除睡眠数据
264
- ///Obtain detailed sleep data
265
- ///mode : 0-Read the latest sleep detailed data 2-Continue with the next data segment at the last read location 99-Delete sleep data
244
+ /**
245
+ *
246
+ *获得睡眠详细数据
247
+ * @param {number} mode 0-读最近的睡眠详细数据 2-继续上次读的位置下一段数据 99-删除睡眠数据
248
+ * @return {*} {number[]} detailed sleep data
249
+ */
266
250
  static getDetailSleepDataWithMode(mode) {
267
251
  const value = this.generateInitValue();
268
252
  value[0] = DeviceConst.CMD_Get_SleepData;
@@ -283,10 +267,13 @@ export class BleSDK {
283
267
  list[8] = this.getBcdValue(minute);
284
268
  list[9] = this.getBcdValue(second);
285
269
  }
286
- ///获得HRV测试数据
287
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time: yyyy-MM-dd HH:mm:ss
288
- ///Get HRV test data
289
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time: yyyy-MM-dd HH:mm:ss
270
+ /**
271
+ *
272
+ *获得HRV测试数据
273
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
274
+ * @param {string} time yyyy-MM-dd HH:mm:ss
275
+ * @return {*} {number[]} 指令包,给固件发生指令
276
+ */
290
277
  static getHRVDataWithMode(mode, time) {
291
278
  const value = this.generateInitValue(); // 初始化 buffer
292
279
  value[0] = DeviceConst.CMD_Get_HrvTestData;
@@ -306,7 +293,12 @@ export class BleSDK {
306
293
  this.crcValue(value);
307
294
  return value;
308
295
  }
309
- ///获取PPI测试数据
296
+ /**
297
+ *
298
+ * ppi数据
299
+ * @param {number} mode
300
+ * @return {*} {number[]} 指令包,给固件发生指令
301
+ */
310
302
  static getPPIDDataWithMode(mode) {
311
303
  const value = this.generateInitValue(); // 初始化 buffer
312
304
  value[0] = DeviceConst.CMD_Get_PPITestData;
@@ -325,7 +317,11 @@ export class BleSDK {
325
317
  this.crcValue(value);
326
318
  return value;
327
319
  }
328
- ///获取Hrv测量时长
320
+ /**
321
+ *
322
+ * hrv测试数据
323
+ * @return {*} {number[]} 指令包,给固件发生指令
324
+ */
329
325
  static getHrvTestTime() {
330
326
  const value = this.generateInitValue();
331
327
  value[0] = DeviceConst.CMD_SETTING_HRV_TIME;
@@ -333,7 +329,12 @@ export class BleSDK {
333
329
  this.crcValue(value);
334
330
  return value;
335
331
  }
336
- /// 设置Hrv测试时长
332
+ /**
333
+ *
334
+ * 设置Hrv测试时长
335
+ * @param {number} time
336
+ * @return {*} {number[]} 指令包,给固件发生指令
337
+ */
337
338
  static setHrvTestTime(time) {
338
339
  const value = this.generateInitValue();
339
340
  value[0] = DeviceConst.CMD_SETTING_HRV_TIME;
@@ -342,15 +343,22 @@ export class BleSDK {
342
343
  this.crcValue(value);
343
344
  return value;
344
345
  }
345
- //断开蓝牙
346
+ /**
347
+ *
348
+ * 断开蓝牙
349
+ * @return {*} {number[]} 指令包,给固件发生指令
350
+ */
346
351
  static closeBlueDevice() {
347
352
  const value = this.generateInitValue();
348
353
  value[0] = DeviceConst.CMD_CLOSE_DEVICE;
349
354
  this.crcValue(value);
350
355
  return value;
351
356
  }
352
- ///血糖开始测量
353
- ///Start measuring blood sugar
357
+ /**
358
+ *
359
+ * 血糖开始测量
360
+ * @return {*} {number[]} 指令包,给固件发生指令
361
+ */
354
362
  static startBloodSugar() {
355
363
  const value = this.generateInitValue();
356
364
  value[0] = DeviceConst.CMD_GET_BLOODSUGAR;
@@ -358,8 +366,12 @@ export class BleSDK {
358
366
  this.crcValue(value);
359
367
  return value;
360
368
  }
361
- ///血糖进度设置
362
- ///Blood glucose progress setting
369
+ /**
370
+ *
371
+ * 血糖进度设置
372
+ * @param {number} progress
373
+ * @return {*} {number[]} 指令包,给固件发生指令
374
+ */
363
375
  static progressBloodSugar(progress) {
364
376
  const value = this.generateInitValue();
365
377
  value[0] = DeviceConst.CMD_GET_BLOODSUGAR;
@@ -368,8 +380,11 @@ export class BleSDK {
368
380
  this.crcValue(value);
369
381
  return value;
370
382
  }
371
- ///结束测量血糖
372
- ///End measuring blood glucose
383
+ /**
384
+ *
385
+ * 结束测量血糖
386
+ * @return {*} {number[]} 指令包,给固件发生指令
387
+ */
373
388
  static endBloodSugar() {
374
389
  const value = this.generateInitValue();
375
390
  value[0] = DeviceConst.CMD_GET_BLOODSUGAR;
@@ -377,10 +392,12 @@ export class BleSDK {
377
392
  this.crcValue(value);
378
393
  return value;
379
394
  }
380
- ///获取某天总数据
381
- ///0:表⽰是从最新的位置开始读取(最多50组数据) 2:表⽰接着读取(当数据总数⼤于50的时候) 0x99:表⽰删除所有运动数据
382
- ///Obtain total data for a certain day
383
- ///0: Table 1 starts reading from the latest position (up to 50 sets of data) 2: Table 2 continues reading (when the total number of data exceeds 50) 0x99: Table 1 deletes all motion data
395
+ /**
396
+ *
397
+ * 获取某天总数据
398
+ * @param {number} mode 表⽰是从最新的位置开始读取(最多50组数据) 2:表⽰接着读取(当数据总数⼤于50的时候) 0x99:表⽰删除所有运动数据
399
+ * @return {*} {number[]} 指令包,给固件发生指令
400
+ */
384
401
  static getTotalActivityDataWithMode(mode) {
385
402
  const value = this.generateInitValue(); // 初始化 buffer
386
403
  value[0] = DeviceConst.CMD_Get_TotalData;
@@ -399,12 +416,13 @@ export class BleSDK {
399
416
  this.crcValue(value);
400
417
  return value;
401
418
  }
402
- ///根据某个日期获取到最新的总数据
403
- ///mode: 0-表⽰是从最新的位置开始读取(最多50组数据) 2-表⽰接着读取(当数据总数⼤于50的时候) 99-表⽰删除所有运动数据
404
- ///time: yyyy-MM-dd HH:mm:ss
405
- ///Obtain the latest total data based on a certain date
406
- ///mode: 0-Table 1 starts reading from the latest position (up to 50 sets of data) 2-Table 2 continues reading (when the total number of data exceeds 50) 99-Table 1 deletes all motion data
407
- ///time: yyyy-MM-dd HH:mm:ss
419
+ /**
420
+ *
421
+ * /根据某个日期获取到最新的总数据
422
+ * @param {number} mode 0-表⽰是从最新的位置开始读取(最多50组数据) 2-表⽰接着读取(当数据总数⼤于50的时候) 99-表⽰删除所有运动数据
423
+ * @param {string} time yyyy-MM-dd HH:mm:ss
424
+ * @return {*} {number[]} 指令包,给固件发生指令
425
+ */
408
426
  static getTotalActivityDataWithModeForTime(mode, time) {
409
427
  const value = this.generateInitValue(); // 初始化 buffer
410
428
  value[0] = DeviceConst.CMD_Get_TotalData;
@@ -424,10 +442,13 @@ export class BleSDK {
424
442
  this.crcValue(value);
425
443
  return value;
426
444
  }
427
- ///获得睡眠详细数据
428
- ///mode : 0-读最近的睡眠详细数据 2-继续上次读的位置下一段数据 99-删除睡眠数据 time: yyyy-MM-dd HH:mm:ss
429
- ///Obtain detailed sleep data
430
- ///mode : 0-Read the latest sleep detailed data 2-Continue with the next data segment at the last read location 99-Delete sleep data time: yyyy-MM-dd HH:mm:ss
445
+ /**
446
+ *
447
+ * 获得睡眠详细数据
448
+ * @param {number} mode 0-读最近的睡眠详细数据 2-继续上次读的位置下一段数据 99-删除睡眠数据
449
+ * @param {string} time yyyy-MM-dd HH:mm:ss
450
+ * @return {*} {number[]} 指令包,给固件发生指令
451
+ */
431
452
  static getDetailSleepDataWithModeForTime(mode, time) {
432
453
  const value = this.generateInitValue();
433
454
  value[0] = DeviceConst.CMD_Get_SleepData;
@@ -436,10 +457,14 @@ export class BleSDK {
436
457
  this.crcValue(value);
437
458
  return value;
438
459
  }
439
- ///获得步数详细数据
440
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
441
- ///Obtain detailed step count data
442
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data
460
+ /**
461
+ *
462
+ * 获得步数详细数据
463
+
464
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
465
+ * @param {string} time yyyy-MM-dd HH:mm:ss
466
+ * @return {*} {number[]} 指令包,给固件发生指令
467
+ */
443
468
  static getDetailActivityDataWithModeForTime(mode, time) {
444
469
  const value = this.generateInitValue();
445
470
  value[0] = DeviceConst.CMD_Get_DetailData;
@@ -448,10 +473,13 @@ export class BleSDK {
448
473
  this.crcValue(value);
449
474
  return value;
450
475
  }
451
- ///自动测试温度数据
452
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time : yyyy-MM-dd HH:mm:ss
453
- ///Automatic testing of temperature data
454
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time : yyyy-MM-dd HH:mm:ss
476
+ /**
477
+ *
478
+ * 自动测试温度数据
479
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
480
+ * @param {string} time yyyy-MM-dd HH:mm:ss
481
+ * @return {*} {number[]} 指令包,给固件发生指令
482
+ */
455
483
  static getTemperature_historyDataWithMode(mode, time) {
456
484
  const value = this.generateInitValue();
457
485
  value[0] = DeviceConst.Temperature_history;
@@ -460,10 +488,13 @@ export class BleSDK {
460
488
  this.crcValue(value);
461
489
  return value;
462
490
  }
463
- ///手动测试温度数据
464
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time: yyyy-MM-dd HH:mm:ss
465
- ///Manual testing of temperature data
466
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time: yyyy-MM-dd HH:mm:ss
491
+ /**
492
+ *
493
+ * 手动测试温度数据
494
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
495
+ * @param {string} time yyyy-MM-dd HH:mm:ss
496
+ * @return {*} {number[]} 指令包,给固件发生指令
497
+ */
467
498
  static getAxillaryTemperatureDataWithMode(mode, time) {
468
499
  const value = this.generateInitValue();
469
500
  value[0] = DeviceConst.GetAxillaryTemperatureDataWithMode;
@@ -483,8 +514,13 @@ export class BleSDK {
483
514
  this.crcValue(value);
484
515
  return value;
485
516
  }
486
- ///运动模式开关
487
- ///Sport mode switch
517
+ /**
518
+ *
519
+ * 运动模式开关
520
+ * @param {number} activityMode 运动模式类型
521
+ * @param {number} WorkMode 1:开始 , 2:暂停, 3:继续, 4结束。5: 查询状态
522
+ * @return {*} {number[]} 指令包,给固件发生指令
523
+ */
488
524
  static enterActivityMode(activityMode, WorkMode) {
489
525
  const value = this.generateInitValue();
490
526
  value[0] = DeviceConst.CMD_Start_EXERCISE;
@@ -493,10 +529,14 @@ export class BleSDK {
493
529
  this.crcValue(value);
494
530
  return value;
495
531
  }
496
- ///发送运动模式心跳包(配合"EnterActivityMode"使用)
497
- ///当手环是通过APP进入多运动模式后,APP必须每隔1秒发送一个数据给手环,否则手环会退出多运动模式
498
- ///Send a sports mode heartbeat packet (used in conjunction with 'EnterActivityMode')
499
- ///When the bracelet enters multi sport mode through the APP, the APP must send data to the bracelet every 1 second, otherwise the bracelet will exit multi sport mode
532
+ /**
533
+ * 发送运动模式心跳包(配合"EnterActivityMode"使用)
534
+ * 当手环是通过APP进入多运动模式后,APP必须每隔1秒发送一个数据给手环,否则手环会退出多运动模式
535
+ * @param {number} distance 距离,浮点数。单位是KM。
536
+ * @param {number} space 配速度,MM:分钟,SS秒钟
537
+ * @param {number} rssi APPGPS信号强度。范围是:1,2,3
538
+ * @return {*} {number[]} 指令包,给固件发生指令
539
+ */
500
540
  static sendHeartPackage(distance, space, rssi) {
501
541
  // 1. 初始化数据包(8 字节 + 1 字节 CRC => 总共 9 字节?根据协议可调)
502
542
  const value = this.generateInitValue(); // 返回长度为 8 或 9 的数组
@@ -511,19 +551,20 @@ export class BleSDK {
511
551
  // 4. 组装数据包
512
552
  value[0] = DeviceConst.CMD_heart_package;
513
553
  this.arrayCopy(distanceBytes, 0, value, 1, distanceBytes.length);
514
- // 将 distanceBytes 复制到 value 的索引 1~4
515
- // distanceBytes.forEach((byte, i) => {
516
- // value[1 + i] = byte;
517
- // });
518
554
  value[5] = min;
519
555
  value[6] = second;
520
556
  value[7] = rssi & 0xff; // 确保是 1 字节
521
557
  this.crcValue(value);
522
558
  return value;
523
559
  }
524
- ///开始实时计步
525
- ///Start real time step
526
- static RealTimeStep(enable, tempEnable) {
560
+ /**
561
+ *
562
+ * 启动或关闭实时计步模式
563
+ * @param {boolean} enable 1:启动实时计步,0:关闭实时计步
564
+ * @param {boolean} tempEnable 1:开启实时温度 0:关闭实时温度
565
+ * @return {*} {number[]} 指令包,给固件发生指令
566
+ */
567
+ static realTimeStep(enable, tempEnable) {
527
568
  const value = this.generateInitValue();
528
569
  value[0] = DeviceConst.CMD_Enable_Activity;
529
570
  value[1] = enable ? 1 : 0;
@@ -531,8 +572,11 @@ export class BleSDK {
531
572
  this.crcValue(value);
532
573
  return value;
533
574
  }
534
- ///停止实时计步
535
- ///Stop real-time step counting
575
+ /**
576
+ *
577
+ * 停止实时计步
578
+ * @return {*} {number[]} 指令包,给固件发生指令
579
+ */
536
580
  static stopGo() {
537
581
  const value = this.generateInitValue();
538
582
  value[0] = DeviceConst.CMD_Enable_Activity;
@@ -540,8 +584,12 @@ export class BleSDK {
540
584
  this.crcValue(value);
541
585
  return value;
542
586
  }
543
- ///设置个人信息
544
- ///Set user profile
587
+ /**
588
+ * 设置个人信息
589
+ *
590
+ * @param {MyPersonalInfo} info
591
+ * @return {*} {number[]} 指令包,给固件发生指令
592
+ */
545
593
  static setPersonalInfo(info) {
546
594
  const value = this.generateInitValue();
547
595
  value[0] = DeviceConst.CMD_Set_UseInfo;
@@ -555,8 +603,11 @@ export class BleSDK {
555
603
  this.crcValue(value);
556
604
  return value;
557
605
  }
558
- ///获取个人信息
559
- ///Get user's personal information
606
+ /**
607
+ *
608
+ * 获取个人信息
609
+ * @return {*} {number[]} 指令包,给固件发生指令
610
+ */
560
611
  static getPersonalInfo() {
561
612
  const value = this.generateInitValue(); // 初始化 buffer
562
613
  value[0] = DeviceConst.CMD_GET_USERINFO;
@@ -571,51 +622,67 @@ export class BleSDK {
571
622
  this.crcValue(value);
572
623
  return value;
573
624
  }
574
- ///获取设备版本号
575
- ///Read software version number
625
+ /**
626
+ *
627
+ * 获取设备版本号
628
+ * @return {*} {number[]} 指令包,给固件发生指令
629
+ */
576
630
  static getDeviceVersion() {
577
631
  const value = this.generateInitValue();
578
632
  value[0] = DeviceConst.CMD_Get_Version;
579
633
  this.crcValue(value);
580
634
  return value;
581
635
  }
582
- ///恢复出厂设置
583
- ///Restore factory settings
636
+ /**
637
+ *
638
+ * 恢复出厂设置
639
+ * @return {*} {number[]} 指令包,给固件发生指令
640
+ */
584
641
  static reset() {
585
642
  const value = this.generateInitValue();
586
643
  value[0] = DeviceConst.CMD_Reset;
587
644
  this.crcValue(value);
588
645
  return value;
589
646
  }
590
- ///获取设备mac地址
591
- ///Read MAC address
647
+ /**
648
+ *
649
+ * 获取设备mac地址
650
+ * @return {*} {number[]} 指令包,给固件发生指令
651
+ */
592
652
  static getDeviceMacAddress() {
593
653
  const value = this.generateInitValue();
594
654
  value[0] = DeviceConst.CMD_Get_Address;
595
655
  this.crcValue(value);
596
656
  return value;
597
657
  }
598
- ///获取设备电量
599
- ///Read device power
658
+ /**
659
+ *
660
+ * 获取设备电量
661
+ * @return {*} {number[]} 指令包,给固件发生指令
662
+ */
600
663
  static getDeviceBatteryLevel() {
601
664
  const value = this.generateInitValue();
602
665
  value[0] = DeviceConst.CMD_Get_BatteryLevel;
603
666
  this.crcValue(value);
604
667
  return value;
605
668
  }
606
- ///重启设备
607
- ///MCU soft reset command
608
- static MCUReset() {
669
+ /**
670
+ *
671
+ * 重启设备
672
+ * @return {*} {number[]} 指令包,给固件发生指令
673
+ */
674
+ static mcuReset() {
609
675
  const value = this.generateInitValue();
610
676
  value[0] = DeviceConst.CMD_Mcu_Reset;
611
677
  this.crcValue(value);
612
678
  return value;
613
679
  }
614
680
  /**
615
- * 设置设备名称
616
- * @param deviceName 设备名称(最多14个ASCII字符)
617
- * @returns Uint8Array 指令包(7字节)
618
- */
681
+ * 设置设备名称
682
+ *
683
+ * @param {string} deviceName 设备名称(最多14个ASCII字符)
684
+ * @return {*} {number[]} 指令包(7字节)
685
+ */
619
686
  static setDeviceName(deviceName) {
620
687
  const value = this.generateInitValue(); // 初始化7字节数组
621
688
  const maxLength = 14;
@@ -635,7 +702,7 @@ export class BleSDK {
635
702
  }
636
703
  /**
637
704
  * 获取设备名称
638
- * @returns Uint8Array 指令包(7字节)
705
+ * @return {*} {number[]} 指令包(7字节)
639
706
  */
640
707
  static getDeviceName() {
641
708
  const value = this.generateInitValue();
@@ -648,8 +715,12 @@ export class BleSDK {
648
715
  this.crcValue(value);
649
716
  return value;
650
717
  }
651
- ///设置设备时间
652
- ///Set Device Time
718
+ /**
719
+ *
720
+ * 设置设备时间
721
+ * @param {Date} dateTime
722
+ * @return {*} {number[]} 指令包,给固件发生指令
723
+ */
653
724
  static setDeviceTime(dateTime) {
654
725
  const value = this.generateInitValue();
655
726
  const year = dateTime.getFullYear();
@@ -668,16 +739,23 @@ export class BleSDK {
668
739
  this.crcValue(value);
669
740
  return value;
670
741
  }
671
- ///获取设备时间
672
- ///Get device time
742
+ /**
743
+ *
744
+ * 获取设备时间
745
+ * @return {*} {number[]}
746
+ */
673
747
  static getDeviceTime() {
674
748
  const value = this.generateInitValue();
675
749
  value[0] = DeviceConst.CMD_GET_TIME;
676
750
  this.crcValue(value);
677
751
  return value;
678
752
  }
679
- ///设置设备信息
680
- ///Set basic parameters of Bracelet
753
+ /**
754
+ *
755
+ * 设置设备信息
756
+ * @param {MyDeviceInfo} deviceBaseParameter
757
+ * @return {*} {number[]}
758
+ */
681
759
  static setDeviceInfo(deviceBaseParameter) {
682
760
  const value = this.generateInitValue();
683
761
  value[0] = DeviceConst.CMD_Set_DeviceInfo;
@@ -694,8 +772,13 @@ export class BleSDK {
694
772
  this.crcValue(value);
695
773
  return value;
696
774
  }
697
- ///健康测量控制
698
- ///Health measurement control
775
+ /**
776
+ *健康测量控制
777
+ *
778
+ * @param {number} dataType 测试类型 0x01,HRV 0x02,心率测量 0x03,血氧测量
779
+ * @param {boolean} open 1开启测量 0 关闭测量
780
+ * @return {*} {number[]} 指令包,给固件发生指令
781
+ */
699
782
  static healthMeasurementWithDataType(dataType, open) {
700
783
  this.StartDeviceMeasurementWithType = open;
701
784
  const value = this.generateInitValue();
@@ -706,10 +789,11 @@ export class BleSDK {
706
789
  return value;
707
790
  }
708
791
  /**
709
- * 设置手环表盘模式
710
- * @param mode 表盘模式(0, 1, 2... 根据设备定义)
711
- * @returns Uint8Array 指令包(7字节)
712
- */
792
+ *
793
+ * 设置手环表盘模式
794
+ * @param {number} mode 表盘模式(0, 1, 2... 根据设备定义)
795
+ * @return {*} {number[]} 指令包(7字节)
796
+ */
713
797
  static setBraceletdial(mode) {
714
798
  // 设置运行状态(可选,用于控制流程)
715
799
  this.isRuning = true;
@@ -719,8 +803,12 @@ export class BleSDK {
719
803
  this.crcValue(value);
720
804
  return value;
721
805
  }
722
- ///设置自动检测心率时段
723
- ///Set automatic heart rate detection period
806
+ /**
807
+ *
808
+ * 设置自动检测心率时段
809
+ * @param {MyAutomaticHRMonitoring} autoHeart
810
+ * @return {*} {number[]} 指令包,给固件发生指令
811
+ */
724
812
  static setAutomaticHRMonitoring(autoHeart) {
725
813
  const value = this.generateInitValue();
726
814
  const time = autoHeart.time;
@@ -737,10 +825,12 @@ export class BleSDK {
737
825
  this.crcValue(value);
738
826
  return value;
739
827
  }
740
- ///读取自动检测心率时段
741
- ///1 心率 2 血氧 3 温度 4 HRV
742
- ///Read auto detect heart rate period
743
- ///1 Heart rate 2 Blood oxygen 3 Temperature 4 HRV
828
+ /**
829
+ *
830
+ * 读取自动检测心率时段
831
+ * @param {number} type 1、读取心率设置时间 2、读取设置血氧时间 4、读取HRV设置时间段
832
+ * @return {*} {number[]} 指令包,给固件发生指令
833
+ */
744
834
  static getAutomaticHRMonitoring(type) {
745
835
  const value = this.generateInitValue();
746
836
  value[0] = DeviceConst.CMD_Get_AutoHeart;
@@ -748,10 +838,12 @@ export class BleSDK {
748
838
  this.crcValue(value);
749
839
  return value;
750
840
  }
751
- ///获取多模式运动数据
752
- ///mode 0:表⽰是从最新的位置开始读取(最多50组数据) 2:表⽰接着读取(当数据总数⼤于50的时候) 0x99:表⽰删除所有GPS数据
753
- ///Obtain multimodal motion data
754
- ///Mode 0: Table 1 starts reading from the latest position (up to 50 sets of data) 2: Table 2 continues reading (when the total number of data exceeds 50) 0x99: Table 1 deletes all GPS data
841
+ /**
842
+ *
843
+ *获取多模式运动数据
844
+ * @param {number} mode 0:表⽰是从最新的位置开始读取(最多50组数据) 2:表⽰接着读取(当数据总数⼤于50的时候) 0x99:表⽰删除所有GPS数据
845
+ * @return {*} {number[]} 指令包,给固件发生指令
846
+ */
755
847
  static getActivityModeDataWithMode(mode) {
756
848
  const value = this.generateInitValue();
757
849
  value[0] = DeviceConst.CMD_Get_SPORTData;
@@ -759,10 +851,13 @@ export class BleSDK {
759
851
  this.crcValue(value);
760
852
  return value;
761
853
  }
762
- ///获得单次心率数据(间隔测试心率)
763
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time: yyyy-MM-dd HH:mm:ss
764
- ///Obtain single heart rate data (interval test heart rate)
765
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time: yyyy-MM-dd HH:mm:ss
854
+ /**
855
+ *
856
+ * 获得单次心率数据(间隔测试心率)
857
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
858
+ * @param {string} time yyyy-MM-dd HH:mm:ss
859
+ * @return {*} {number[]} 指令包,给固件发生指令
860
+ */
766
861
  static getStaticHRWithMode(mode, time) {
767
862
  const value = this.generateInitValue();
768
863
  value[0] = DeviceConst.CMD_Get_OnceHeartData;
@@ -771,10 +866,13 @@ export class BleSDK {
771
866
  this.crcValue(value);
772
867
  return value;
773
868
  }
774
- ///获得心率数据
775
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time: yyyy-MM-dd HH:mm:ss
776
- ///Get heart rate data
777
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time: yyyy-MM-dd HH:mm:ss
869
+ /**
870
+ *
871
+ * 获得心率数据
872
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
873
+ * @param {string} time yyyy-MM-dd HH:mm:ss
874
+ * @return {*} {number[]} 指令包,给固件发生指令
875
+ */
778
876
  static getDynamicHRWithMode(mode, time) {
779
877
  const value = this.generateInitValue();
780
878
  value[0] = DeviceConst.CMD_Get_HeartData;
@@ -783,10 +881,13 @@ export class BleSDK {
783
881
  this.crcValue(value);
784
882
  return value;
785
883
  }
786
- ///获得血氧数据
787
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time: yyyy-MM-dd HH:mm:ss
788
- ///Get blood oxygen data
789
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time: yyyy-MM-dd HH:mm:ss
884
+ /**
885
+ *
886
+ * 获得血氧数据
887
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
888
+ * @param {string} time yyyy-MM-dd HH:mm:ss
889
+ * @return {*} {number[]} 指令包,给固件发生指令
890
+ */
790
891
  static getBloodOxygen(mode, time) {
791
892
  const value = this.generateInitValue();
792
893
  value[0] = DeviceConst.CMD_Get_Blood_oxygen;
@@ -795,10 +896,13 @@ export class BleSDK {
795
896
  this.crcValue(value);
796
897
  return value;
797
898
  }
798
- ///获得血氧数据(自动测试)
799
- ///mode : 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据 time: yyyy-MM-dd HH:mm:ss
800
- ///Obtain blood oxygen data (automatic testing)
801
- ///mode : 0-Read the latest detailed data 2-Continue with the next data segment at the last read location 99-Delete data time: yyyy-MM-dd HH:mm:ss
899
+ /**
900
+ *
901
+ * 获得血氧数据(自动测试)
902
+ * @param {number} mode 0-读最近的详细数据 2-继续上次读的位置下一段数据 99-删除数据
903
+ * @param {string} time yyyy-MM-dd HH:mm:ss
904
+ * @return {*} {number[]}
905
+ */
802
906
  static getAutoBloodOxygen(mode, time) {
803
907
  const value = this.generateInitValue();
804
908
  value[0] = DeviceConst.CMD_Get_Auto_Blood_oxygen;
@@ -841,8 +945,11 @@ export class BleSDK {
841
945
  this.crcValue(value);
842
946
  return value;
843
947
  }
844
- ///读取目标步数
845
- ///Read target steps
948
+ /**
949
+ *
950
+ * 读取目标步数
951
+ * @return {*} {number[]} 指令包,给固件发生指令
952
+ */
846
953
  static GetStepGoal() {
847
954
  const value = this.generateInitValue();
848
955
  value[0] = DeviceConst.CMD_Get_Goal;
@@ -866,14 +973,22 @@ export class BleSDK {
866
973
  }
867
974
  return current;
868
975
  }
869
- //获取闹钟
976
+ /**
977
+ *
978
+ * 获取闹钟
979
+ * @return {*} {number[]} 指令包,给固件发生指令
980
+ */
870
981
  static getAlarmClock() {
871
982
  const value = this.generateInitValue();
872
983
  value[0] = DeviceConst.CMD_Get_Clock;
873
984
  this.crcValue(value);
874
985
  return value;
875
986
  }
876
- // 删除所有闹钟
987
+ /**
988
+ *
989
+ * 删除所有闹钟
990
+ * @return {*} {number[]} 指令包,给固件发生指令
991
+ */
877
992
  static deleteAllAlarmClock() {
878
993
  const value = this.generateInitValue();
879
994
  value[0] = DeviceConst.CMD_Get_Clock;
@@ -881,7 +996,12 @@ export class BleSDK {
881
996
  this.crcValue(value);
882
997
  return value;
883
998
  }
884
- // 设置所有闹钟
999
+ /**
1000
+ *
1001
+ *设置所有闹钟
1002
+ * @param {any[]} arrayClockAlarm
1003
+ * @return {*} {number[][]}
1004
+ */
885
1005
  static setAlarmClock(arrayClockAlarm) {
886
1006
  const result = [];
887
1007
  const LENGTH_UNIT = 39;
@@ -943,14 +1063,23 @@ export class BleSDK {
943
1063
  }
944
1064
  return result;
945
1065
  }
946
- // 获取久坐提醒
1066
+ /**
1067
+ *
1068
+ * 获取久坐提醒
1069
+ * @return {*} {number[]} 指令包,给固件发生指令
1070
+ */
947
1071
  static getSedentaryReminder() {
948
1072
  const value = this.generateInitValue();
949
1073
  value[0] = DeviceConst.CMD_Get_ActivityAlarm;
950
1074
  this.crcValue(value);
951
1075
  return value;
952
1076
  }
953
- // 设置久坐提醒
1077
+ /**
1078
+ * 设置久坐提醒
1079
+ *
1080
+ * @param {MySedentaryReminderV4} reminder
1081
+ * @return {*} {number[]} 指令包,给固件发生指令
1082
+ */
954
1083
  static setSedentaryReminder(reminder) {
955
1084
  const value = this.generateInitValue();
956
1085
  value[0] = DeviceConst.CMD_Set_ActivityAlarm;