sensor-sdk 0.0.31__py3-none-any.whl → 0.0.32__py3-none-any.whl
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.
Potentially problematic release.
This version of sensor-sdk might be problematic. Click here for more details.
- sensor/sensor_data.py +5 -3
- sensor/sensor_data_context.py +40 -17
- sensor/sensor_profile.py +2 -2
- sensor/sensor_utils.py +533 -0
- {sensor_sdk-0.0.31.dist-info → sensor_sdk-0.0.32.dist-info}/METADATA +4 -13
- sensor_sdk-0.0.32.dist-info/RECORD +14 -0
- {sensor_sdk-0.0.31.dist-info → sensor_sdk-0.0.32.dist-info}/WHEEL +1 -1
- sensor_sdk-0.0.31.dist-info/RECORD +0 -14
- {sensor_sdk-0.0.31.dist-info/licenses → sensor_sdk-0.0.32.dist-info}/LICENSE.txt +0 -0
- {sensor_sdk-0.0.31.dist-info → sensor_sdk-0.0.32.dist-info}/top_level.txt +0 -0
- {sensor_sdk-0.0.31.dist-info → sensor_sdk-0.0.32.dist-info}/zip-safe +0 -0
sensor/sensor_data.py
CHANGED
|
@@ -41,10 +41,12 @@ class DataType(IntEnum):
|
|
|
41
41
|
NTF_EMG = 0x8 # EMG,用于标识肌电传感器采集的数据
|
|
42
42
|
NTF_EEG = 0x10 # EEG,用于标识脑电传感器采集的数据
|
|
43
43
|
NTF_ECG = 0x11 # ECG,用于标识心电传感器采集的数据
|
|
44
|
-
NTF_IMPEDANCE =
|
|
45
|
-
NTF_IMU =
|
|
46
|
-
NTF_ADS =
|
|
44
|
+
NTF_IMPEDANCE = 0x12 # 阻抗数据
|
|
45
|
+
NTF_IMU = 0x13 # 包含ACC和GYRO数据
|
|
46
|
+
NTF_ADS = 0x14 # 无单位ads数据
|
|
47
47
|
NTF_BRTH = 0x15 # 呼吸,用于标识呼吸传感器采集的数据
|
|
48
|
+
NTF_IMPEDANCE_EXT = 0x16 # 阻抗数据扩展
|
|
49
|
+
NTF_DATA_TYPE_MAX = 0x17
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
# 一次采样的数据,包含多个通道的数据,channal_samples 为一个二维数组, 第一个维度为通道索引,第二个维度为采样索引
|
sensor/sensor_data_context.py
CHANGED
|
@@ -61,7 +61,7 @@ class SensorProfileDataCtx:
|
|
|
61
61
|
self.saturationData: List[float] = list()
|
|
62
62
|
self.dataPool = ThreadPoolExecutor(1, "data")
|
|
63
63
|
self.init_map = {"NTF_EMG": "ON", "NTF_EEG": "ON", "NTF_ECG": "ON", "NTF_IMU": "ON", "NTF_BRTH": "ON"}
|
|
64
|
-
self.filter_map = {"
|
|
64
|
+
self.filter_map = {"FILTER_50HZ": "ON", "FILTER_60HZ": "ON", "FILTER_HPF": "ON", "FILTER_LPF": "ON"}
|
|
65
65
|
self.debugCSVWriter = None
|
|
66
66
|
self.debugCSVPath = None
|
|
67
67
|
|
|
@@ -340,10 +340,10 @@ class SensorProfileDataCtx:
|
|
|
340
340
|
switch = 0
|
|
341
341
|
for filter in self.filter_map.keys():
|
|
342
342
|
value = self.filter_map[filter]
|
|
343
|
-
if filter == "
|
|
343
|
+
if filter == "FILTER_50HZ":
|
|
344
344
|
if value == "ON":
|
|
345
345
|
switch |= 1
|
|
346
|
-
elif filter == "
|
|
346
|
+
elif filter == "FILTER_60HZ":
|
|
347
347
|
if value == "ON":
|
|
348
348
|
switch |= 2
|
|
349
349
|
elif filter == "FILTER_HPF":
|
|
@@ -427,6 +427,29 @@ class SensorProfileDataCtx:
|
|
|
427
427
|
|
|
428
428
|
self.impedanceData = impedanceData
|
|
429
429
|
self.saturationData = saturationData
|
|
430
|
+
elif v == DataType.NTF_IMPEDANCE_EXT:
|
|
431
|
+
offset = 1
|
|
432
|
+
# packageIndex = ((data[offset + 1] & 0xff) << 8) | (data[offset] & 0xff)
|
|
433
|
+
offset += 2
|
|
434
|
+
|
|
435
|
+
impedanceData = []
|
|
436
|
+
saturationData = []
|
|
437
|
+
|
|
438
|
+
dataCount = self._device_info.EegChannelCount + self._device_info.EcgChannelCount
|
|
439
|
+
|
|
440
|
+
for index in range(dataCount):
|
|
441
|
+
impedance = struct.unpack_from("<f", data, offset)[0]
|
|
442
|
+
offset += 4
|
|
443
|
+
impedanceData.append(impedance)
|
|
444
|
+
|
|
445
|
+
for index in range(dataCount):
|
|
446
|
+
saturation = struct.unpack_from("<H", data, offset)[0]
|
|
447
|
+
offset += 2
|
|
448
|
+
saturationData.append(saturation / 10) # firmware value range 0 - 1000
|
|
449
|
+
|
|
450
|
+
self.impedanceData = impedanceData
|
|
451
|
+
self.saturationData = saturationData
|
|
452
|
+
|
|
430
453
|
elif v == DataType.NTF_EMG:
|
|
431
454
|
sensor_data = self.sensorDatas[SensorDataType.DATA_TYPE_EMG]
|
|
432
455
|
if self.checkReadSamples(sensor, data, sensor_data, 3, 0):
|
|
@@ -712,39 +735,39 @@ class SensorProfileDataCtx:
|
|
|
712
735
|
|
|
713
736
|
if self._concatDataBuffer[index] == 0x55:
|
|
714
737
|
if (index + 1) >= data_size:
|
|
715
|
-
index
|
|
738
|
+
index = data_size
|
|
716
739
|
continue
|
|
717
740
|
n = self._concatDataBuffer[index + 1]
|
|
718
|
-
if (index + 1 + n +
|
|
719
|
-
index
|
|
741
|
+
if (index + 1 + n + 2) >= data_size:
|
|
742
|
+
index = data_size
|
|
720
743
|
continue
|
|
721
|
-
|
|
722
|
-
calc_crc = sensor_utils.
|
|
723
|
-
if
|
|
744
|
+
crc16 = (self._concatDataBuffer[index + 1 + n + 2] << 8) | self._concatDataBuffer[index + 1 + n + 1]
|
|
745
|
+
calc_crc = sensor_utils.crc16_cal(self._concatDataBuffer[index + 2 : index + 2 + n], n)
|
|
746
|
+
if crc16 != calc_crc:
|
|
724
747
|
index += 1
|
|
725
748
|
continue
|
|
726
749
|
if self._is_data_transfering:
|
|
727
750
|
data_package = bytes(self._concatDataBuffer[index + 2 : index + 2 + n])
|
|
728
751
|
self._processDataPackage(data_package, buf, sensor)
|
|
729
|
-
last_cut = index = index + 2 + n
|
|
752
|
+
last_cut = index = index + 2 + n + 1
|
|
730
753
|
elif self._concatDataBuffer[index] == 0xAA:
|
|
731
754
|
if (index + 1) >= data_size:
|
|
732
|
-
index
|
|
755
|
+
index = data_size
|
|
733
756
|
continue
|
|
734
757
|
n = self._concatDataBuffer[index + 1]
|
|
735
|
-
if (index + 1 + n +
|
|
736
|
-
index
|
|
758
|
+
if (index + 1 + n + 2) >= data_size:
|
|
759
|
+
index = data_size
|
|
737
760
|
continue
|
|
738
|
-
|
|
739
|
-
calc_crc = sensor_utils.
|
|
740
|
-
if
|
|
761
|
+
crc16 = (self._concatDataBuffer[index + 1 + n + 2] << 8) | self._concatDataBuffer[index + 1 + n + 1]
|
|
762
|
+
calc_crc = sensor_utils.crc16_cal(self._concatDataBuffer[index + 2 : index + 2 + n], n)
|
|
763
|
+
if crc16 != calc_crc:
|
|
741
764
|
index += 1
|
|
742
765
|
continue
|
|
743
766
|
data_package = bytes(self._concatDataBuffer[index + 2 : index + 2 + n])
|
|
744
767
|
|
|
745
768
|
if not sensor_utils._terminated:
|
|
746
769
|
await sensor_utils.async_call(self.gForce.async_on_cmd_response(data_package), runloop=sensor._event_loop)
|
|
747
|
-
last_cut = index = index + 2 + n
|
|
770
|
+
last_cut = index = index + 2 + n + 1
|
|
748
771
|
else:
|
|
749
772
|
index += 1
|
|
750
773
|
|
sensor/sensor_profile.py
CHANGED
|
@@ -582,12 +582,12 @@ class SensorProfile:
|
|
|
582
582
|
if self.deviceState != DeviceStateEx.Ready:
|
|
583
583
|
result = "Error: Please connect first"
|
|
584
584
|
|
|
585
|
-
if key in ["NTF_EMG", "NTF_EEG", "NTF_ECG", "NTF_IMU", "NTF_BRTH"]:
|
|
585
|
+
if key in ["NTF_EMG", "NTF_EEG", "NTF_ECG", "NTF_IMU", "NTF_BRTH", "NTF_IMPEDANCE"]:
|
|
586
586
|
if value in ["ON", "OFF"]:
|
|
587
587
|
self._data_ctx.init_map[key] = value
|
|
588
588
|
result = "OK"
|
|
589
589
|
|
|
590
|
-
if key in ["
|
|
590
|
+
if key in ["FILTER_50HZ", "FILTER_60HZ", "FILTER_HPF", "FILTER_LPF"]:
|
|
591
591
|
if value in ["ON", "OFF"]:
|
|
592
592
|
result = await self._data_ctx.setFilter(key, value)
|
|
593
593
|
|
sensor/sensor_utils.py
CHANGED
|
@@ -371,3 +371,536 @@ def calc_crc8(data):
|
|
|
371
371
|
crc8 = crc8Table[crc8]
|
|
372
372
|
|
|
373
373
|
return crc8
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
def crc16_cal(data, iLen):
|
|
377
|
+
auchCRCHi = [
|
|
378
|
+
0x00,
|
|
379
|
+
0xC1,
|
|
380
|
+
0x81,
|
|
381
|
+
0x40,
|
|
382
|
+
0x01,
|
|
383
|
+
0xC0,
|
|
384
|
+
0x80,
|
|
385
|
+
0x41,
|
|
386
|
+
0x01,
|
|
387
|
+
0xC0,
|
|
388
|
+
0x80,
|
|
389
|
+
0x41,
|
|
390
|
+
0x00,
|
|
391
|
+
0xC1,
|
|
392
|
+
0x81,
|
|
393
|
+
0x40,
|
|
394
|
+
0x01,
|
|
395
|
+
0xC0,
|
|
396
|
+
0x80,
|
|
397
|
+
0x41,
|
|
398
|
+
0x00,
|
|
399
|
+
0xC1,
|
|
400
|
+
0x81,
|
|
401
|
+
0x40,
|
|
402
|
+
0x00,
|
|
403
|
+
0xC1,
|
|
404
|
+
0x81,
|
|
405
|
+
0x40,
|
|
406
|
+
0x01,
|
|
407
|
+
0xC0,
|
|
408
|
+
0x80,
|
|
409
|
+
0x41,
|
|
410
|
+
0x01,
|
|
411
|
+
0xC0,
|
|
412
|
+
0x80,
|
|
413
|
+
0x41,
|
|
414
|
+
0x00,
|
|
415
|
+
0xC1,
|
|
416
|
+
0x81,
|
|
417
|
+
0x40,
|
|
418
|
+
0x00,
|
|
419
|
+
0xC1,
|
|
420
|
+
0x81,
|
|
421
|
+
0x40,
|
|
422
|
+
0x01,
|
|
423
|
+
0xC0,
|
|
424
|
+
0x80,
|
|
425
|
+
0x41,
|
|
426
|
+
0x00,
|
|
427
|
+
0xC1,
|
|
428
|
+
0x81,
|
|
429
|
+
0x40,
|
|
430
|
+
0x01,
|
|
431
|
+
0xC0,
|
|
432
|
+
0x80,
|
|
433
|
+
0x41,
|
|
434
|
+
0x01,
|
|
435
|
+
0xC0,
|
|
436
|
+
0x80,
|
|
437
|
+
0x41,
|
|
438
|
+
0x00,
|
|
439
|
+
0xC1,
|
|
440
|
+
0x81,
|
|
441
|
+
0x40,
|
|
442
|
+
0x01,
|
|
443
|
+
0xC0,
|
|
444
|
+
0x80,
|
|
445
|
+
0x41,
|
|
446
|
+
0x00,
|
|
447
|
+
0xC1,
|
|
448
|
+
0x81,
|
|
449
|
+
0x40,
|
|
450
|
+
0x00,
|
|
451
|
+
0xC1,
|
|
452
|
+
0x81,
|
|
453
|
+
0x40,
|
|
454
|
+
0x01,
|
|
455
|
+
0xC0,
|
|
456
|
+
0x80,
|
|
457
|
+
0x41,
|
|
458
|
+
0x00,
|
|
459
|
+
0xC1,
|
|
460
|
+
0x81,
|
|
461
|
+
0x40,
|
|
462
|
+
0x01,
|
|
463
|
+
0xC0,
|
|
464
|
+
0x80,
|
|
465
|
+
0x41,
|
|
466
|
+
0x01,
|
|
467
|
+
0xC0,
|
|
468
|
+
0x80,
|
|
469
|
+
0x41,
|
|
470
|
+
0x00,
|
|
471
|
+
0xC1,
|
|
472
|
+
0x81,
|
|
473
|
+
0x40,
|
|
474
|
+
0x00,
|
|
475
|
+
0xC1,
|
|
476
|
+
0x81,
|
|
477
|
+
0x40,
|
|
478
|
+
0x01,
|
|
479
|
+
0xC0,
|
|
480
|
+
0x80,
|
|
481
|
+
0x41,
|
|
482
|
+
0x01,
|
|
483
|
+
0xC0,
|
|
484
|
+
0x80,
|
|
485
|
+
0x41,
|
|
486
|
+
0x00,
|
|
487
|
+
0xC1,
|
|
488
|
+
0x81,
|
|
489
|
+
0x40,
|
|
490
|
+
0x01,
|
|
491
|
+
0xC0,
|
|
492
|
+
0x80,
|
|
493
|
+
0x41,
|
|
494
|
+
0x00,
|
|
495
|
+
0xC1,
|
|
496
|
+
0x81,
|
|
497
|
+
0x40,
|
|
498
|
+
0x00,
|
|
499
|
+
0xC1,
|
|
500
|
+
0x81,
|
|
501
|
+
0x40,
|
|
502
|
+
0x01,
|
|
503
|
+
0xC0,
|
|
504
|
+
0x80,
|
|
505
|
+
0x41,
|
|
506
|
+
0x01,
|
|
507
|
+
0xC0,
|
|
508
|
+
0x80,
|
|
509
|
+
0x41,
|
|
510
|
+
0x00,
|
|
511
|
+
0xC1,
|
|
512
|
+
0x81,
|
|
513
|
+
0x40,
|
|
514
|
+
0x00,
|
|
515
|
+
0xC1,
|
|
516
|
+
0x81,
|
|
517
|
+
0x40,
|
|
518
|
+
0x01,
|
|
519
|
+
0xC0,
|
|
520
|
+
0x80,
|
|
521
|
+
0x41,
|
|
522
|
+
0x00,
|
|
523
|
+
0xC1,
|
|
524
|
+
0x81,
|
|
525
|
+
0x40,
|
|
526
|
+
0x01,
|
|
527
|
+
0xC0,
|
|
528
|
+
0x80,
|
|
529
|
+
0x41,
|
|
530
|
+
0x01,
|
|
531
|
+
0xC0,
|
|
532
|
+
0x80,
|
|
533
|
+
0x41,
|
|
534
|
+
0x00,
|
|
535
|
+
0xC1,
|
|
536
|
+
0x81,
|
|
537
|
+
0x40,
|
|
538
|
+
0x00,
|
|
539
|
+
0xC1,
|
|
540
|
+
0x81,
|
|
541
|
+
0x40,
|
|
542
|
+
0x01,
|
|
543
|
+
0xC0,
|
|
544
|
+
0x80,
|
|
545
|
+
0x41,
|
|
546
|
+
0x01,
|
|
547
|
+
0xC0,
|
|
548
|
+
0x80,
|
|
549
|
+
0x41,
|
|
550
|
+
0x00,
|
|
551
|
+
0xC1,
|
|
552
|
+
0x81,
|
|
553
|
+
0x40,
|
|
554
|
+
0x01,
|
|
555
|
+
0xC0,
|
|
556
|
+
0x80,
|
|
557
|
+
0x41,
|
|
558
|
+
0x00,
|
|
559
|
+
0xC1,
|
|
560
|
+
0x81,
|
|
561
|
+
0x40,
|
|
562
|
+
0x00,
|
|
563
|
+
0xC1,
|
|
564
|
+
0x81,
|
|
565
|
+
0x40,
|
|
566
|
+
0x01,
|
|
567
|
+
0xC0,
|
|
568
|
+
0x80,
|
|
569
|
+
0x41,
|
|
570
|
+
0x00,
|
|
571
|
+
0xC1,
|
|
572
|
+
0x81,
|
|
573
|
+
0x40,
|
|
574
|
+
0x01,
|
|
575
|
+
0xC0,
|
|
576
|
+
0x80,
|
|
577
|
+
0x41,
|
|
578
|
+
0x01,
|
|
579
|
+
0xC0,
|
|
580
|
+
0x80,
|
|
581
|
+
0x41,
|
|
582
|
+
0x00,
|
|
583
|
+
0xC1,
|
|
584
|
+
0x81,
|
|
585
|
+
0x40,
|
|
586
|
+
0x01,
|
|
587
|
+
0xC0,
|
|
588
|
+
0x80,
|
|
589
|
+
0x41,
|
|
590
|
+
0x00,
|
|
591
|
+
0xC1,
|
|
592
|
+
0x81,
|
|
593
|
+
0x40,
|
|
594
|
+
0x00,
|
|
595
|
+
0xC1,
|
|
596
|
+
0x81,
|
|
597
|
+
0x40,
|
|
598
|
+
0x01,
|
|
599
|
+
0xC0,
|
|
600
|
+
0x80,
|
|
601
|
+
0x41,
|
|
602
|
+
0x01,
|
|
603
|
+
0xC0,
|
|
604
|
+
0x80,
|
|
605
|
+
0x41,
|
|
606
|
+
0x00,
|
|
607
|
+
0xC1,
|
|
608
|
+
0x81,
|
|
609
|
+
0x40,
|
|
610
|
+
0x00,
|
|
611
|
+
0xC1,
|
|
612
|
+
0x81,
|
|
613
|
+
0x40,
|
|
614
|
+
0x01,
|
|
615
|
+
0xC0,
|
|
616
|
+
0x80,
|
|
617
|
+
0x41,
|
|
618
|
+
0x00,
|
|
619
|
+
0xC1,
|
|
620
|
+
0x81,
|
|
621
|
+
0x40,
|
|
622
|
+
0x01,
|
|
623
|
+
0xC0,
|
|
624
|
+
0x80,
|
|
625
|
+
0x41,
|
|
626
|
+
0x01,
|
|
627
|
+
0xC0,
|
|
628
|
+
0x80,
|
|
629
|
+
0x41,
|
|
630
|
+
0x00,
|
|
631
|
+
0xC1,
|
|
632
|
+
0x81,
|
|
633
|
+
0x40,
|
|
634
|
+
]
|
|
635
|
+
|
|
636
|
+
auchCRCLo = [
|
|
637
|
+
0x00,
|
|
638
|
+
0xC0,
|
|
639
|
+
0xC1,
|
|
640
|
+
0x01,
|
|
641
|
+
0xC3,
|
|
642
|
+
0x03,
|
|
643
|
+
0x02,
|
|
644
|
+
0xC2,
|
|
645
|
+
0xC6,
|
|
646
|
+
0x06,
|
|
647
|
+
0x07,
|
|
648
|
+
0xC7,
|
|
649
|
+
0x05,
|
|
650
|
+
0xC5,
|
|
651
|
+
0xC4,
|
|
652
|
+
0x04,
|
|
653
|
+
0xCC,
|
|
654
|
+
0x0C,
|
|
655
|
+
0x0D,
|
|
656
|
+
0xCD,
|
|
657
|
+
0x0F,
|
|
658
|
+
0xCF,
|
|
659
|
+
0xCE,
|
|
660
|
+
0x0E,
|
|
661
|
+
0x0A,
|
|
662
|
+
0xCA,
|
|
663
|
+
0xCB,
|
|
664
|
+
0x0B,
|
|
665
|
+
0xC9,
|
|
666
|
+
0x09,
|
|
667
|
+
0x08,
|
|
668
|
+
0xC8,
|
|
669
|
+
0xD8,
|
|
670
|
+
0x18,
|
|
671
|
+
0x19,
|
|
672
|
+
0xD9,
|
|
673
|
+
0x1B,
|
|
674
|
+
0xDB,
|
|
675
|
+
0xDA,
|
|
676
|
+
0x1A,
|
|
677
|
+
0x1E,
|
|
678
|
+
0xDE,
|
|
679
|
+
0xDF,
|
|
680
|
+
0x1F,
|
|
681
|
+
0xDD,
|
|
682
|
+
0x1D,
|
|
683
|
+
0x1C,
|
|
684
|
+
0xDC,
|
|
685
|
+
0x14,
|
|
686
|
+
0xD4,
|
|
687
|
+
0xD5,
|
|
688
|
+
0x15,
|
|
689
|
+
0xD7,
|
|
690
|
+
0x17,
|
|
691
|
+
0x16,
|
|
692
|
+
0xD6,
|
|
693
|
+
0xD2,
|
|
694
|
+
0x12,
|
|
695
|
+
0x13,
|
|
696
|
+
0xD3,
|
|
697
|
+
0x11,
|
|
698
|
+
0xD1,
|
|
699
|
+
0xD0,
|
|
700
|
+
0x10,
|
|
701
|
+
0xF0,
|
|
702
|
+
0x30,
|
|
703
|
+
0x31,
|
|
704
|
+
0xF1,
|
|
705
|
+
0x33,
|
|
706
|
+
0xF3,
|
|
707
|
+
0xF2,
|
|
708
|
+
0x32,
|
|
709
|
+
0x36,
|
|
710
|
+
0xF6,
|
|
711
|
+
0xF7,
|
|
712
|
+
0x37,
|
|
713
|
+
0xF5,
|
|
714
|
+
0x35,
|
|
715
|
+
0x34,
|
|
716
|
+
0xF4,
|
|
717
|
+
0x3C,
|
|
718
|
+
0xFC,
|
|
719
|
+
0xFD,
|
|
720
|
+
0x3D,
|
|
721
|
+
0xFF,
|
|
722
|
+
0x3F,
|
|
723
|
+
0x3E,
|
|
724
|
+
0xFE,
|
|
725
|
+
0xFA,
|
|
726
|
+
0x3A,
|
|
727
|
+
0x3B,
|
|
728
|
+
0xFB,
|
|
729
|
+
0x39,
|
|
730
|
+
0xF9,
|
|
731
|
+
0xF8,
|
|
732
|
+
0x38,
|
|
733
|
+
0x28,
|
|
734
|
+
0xE8,
|
|
735
|
+
0xE9,
|
|
736
|
+
0x29,
|
|
737
|
+
0xEB,
|
|
738
|
+
0x2B,
|
|
739
|
+
0x2A,
|
|
740
|
+
0xEA,
|
|
741
|
+
0xEE,
|
|
742
|
+
0x2E,
|
|
743
|
+
0x2F,
|
|
744
|
+
0xEF,
|
|
745
|
+
0x2D,
|
|
746
|
+
0xED,
|
|
747
|
+
0xEC,
|
|
748
|
+
0x2C,
|
|
749
|
+
0xE4,
|
|
750
|
+
0x24,
|
|
751
|
+
0x25,
|
|
752
|
+
0xE5,
|
|
753
|
+
0x27,
|
|
754
|
+
0xE7,
|
|
755
|
+
0xE6,
|
|
756
|
+
0x26,
|
|
757
|
+
0x22,
|
|
758
|
+
0xE2,
|
|
759
|
+
0xE3,
|
|
760
|
+
0x23,
|
|
761
|
+
0xE1,
|
|
762
|
+
0x21,
|
|
763
|
+
0x20,
|
|
764
|
+
0xE0,
|
|
765
|
+
0xA0,
|
|
766
|
+
0x60,
|
|
767
|
+
0x61,
|
|
768
|
+
0xA1,
|
|
769
|
+
0x63,
|
|
770
|
+
0xA3,
|
|
771
|
+
0xA2,
|
|
772
|
+
0x62,
|
|
773
|
+
0x66,
|
|
774
|
+
0xA6,
|
|
775
|
+
0xA7,
|
|
776
|
+
0x67,
|
|
777
|
+
0xA5,
|
|
778
|
+
0x65,
|
|
779
|
+
0x64,
|
|
780
|
+
0xA4,
|
|
781
|
+
0x6C,
|
|
782
|
+
0xAC,
|
|
783
|
+
0xAD,
|
|
784
|
+
0x6D,
|
|
785
|
+
0xAF,
|
|
786
|
+
0x6F,
|
|
787
|
+
0x6E,
|
|
788
|
+
0xAE,
|
|
789
|
+
0xAA,
|
|
790
|
+
0x6A,
|
|
791
|
+
0x6B,
|
|
792
|
+
0xAB,
|
|
793
|
+
0x69,
|
|
794
|
+
0xA9,
|
|
795
|
+
0xA8,
|
|
796
|
+
0x68,
|
|
797
|
+
0x78,
|
|
798
|
+
0xB8,
|
|
799
|
+
0xB9,
|
|
800
|
+
0x79,
|
|
801
|
+
0xBB,
|
|
802
|
+
0x7B,
|
|
803
|
+
0x7A,
|
|
804
|
+
0xBA,
|
|
805
|
+
0xBE,
|
|
806
|
+
0x7E,
|
|
807
|
+
0x7F,
|
|
808
|
+
0xBF,
|
|
809
|
+
0x7D,
|
|
810
|
+
0xBD,
|
|
811
|
+
0xBC,
|
|
812
|
+
0x7C,
|
|
813
|
+
0xB4,
|
|
814
|
+
0x74,
|
|
815
|
+
0x75,
|
|
816
|
+
0xB5,
|
|
817
|
+
0x77,
|
|
818
|
+
0xB7,
|
|
819
|
+
0xB6,
|
|
820
|
+
0x76,
|
|
821
|
+
0x72,
|
|
822
|
+
0xB2,
|
|
823
|
+
0xB3,
|
|
824
|
+
0x73,
|
|
825
|
+
0xB1,
|
|
826
|
+
0x71,
|
|
827
|
+
0x70,
|
|
828
|
+
0xB0,
|
|
829
|
+
0x50,
|
|
830
|
+
0x90,
|
|
831
|
+
0x91,
|
|
832
|
+
0x51,
|
|
833
|
+
0x93,
|
|
834
|
+
0x53,
|
|
835
|
+
0x52,
|
|
836
|
+
0x92,
|
|
837
|
+
0x96,
|
|
838
|
+
0x56,
|
|
839
|
+
0x57,
|
|
840
|
+
0x97,
|
|
841
|
+
0x55,
|
|
842
|
+
0x95,
|
|
843
|
+
0x94,
|
|
844
|
+
0x54,
|
|
845
|
+
0x9C,
|
|
846
|
+
0x5C,
|
|
847
|
+
0x5D,
|
|
848
|
+
0x9D,
|
|
849
|
+
0x5F,
|
|
850
|
+
0x9F,
|
|
851
|
+
0x9E,
|
|
852
|
+
0x5E,
|
|
853
|
+
0x5A,
|
|
854
|
+
0x9A,
|
|
855
|
+
0x9B,
|
|
856
|
+
0x5B,
|
|
857
|
+
0x99,
|
|
858
|
+
0x59,
|
|
859
|
+
0x58,
|
|
860
|
+
0x98,
|
|
861
|
+
0x88,
|
|
862
|
+
0x48,
|
|
863
|
+
0x49,
|
|
864
|
+
0x89,
|
|
865
|
+
0x4B,
|
|
866
|
+
0x8B,
|
|
867
|
+
0x8A,
|
|
868
|
+
0x4A,
|
|
869
|
+
0x4E,
|
|
870
|
+
0x8E,
|
|
871
|
+
0x8F,
|
|
872
|
+
0x4F,
|
|
873
|
+
0x8D,
|
|
874
|
+
0x4D,
|
|
875
|
+
0x4C,
|
|
876
|
+
0x8C,
|
|
877
|
+
0x44,
|
|
878
|
+
0x84,
|
|
879
|
+
0x85,
|
|
880
|
+
0x45,
|
|
881
|
+
0x87,
|
|
882
|
+
0x47,
|
|
883
|
+
0x46,
|
|
884
|
+
0x86,
|
|
885
|
+
0x82,
|
|
886
|
+
0x42,
|
|
887
|
+
0x43,
|
|
888
|
+
0x83,
|
|
889
|
+
0x41,
|
|
890
|
+
0x81,
|
|
891
|
+
0x80,
|
|
892
|
+
0x40,
|
|
893
|
+
]
|
|
894
|
+
|
|
895
|
+
uchCRCHi = 0xFF
|
|
896
|
+
uchCRCLo = 0xFF
|
|
897
|
+
index = 0
|
|
898
|
+
|
|
899
|
+
iLenCount = range(iLen)
|
|
900
|
+
|
|
901
|
+
for i in iLenCount:
|
|
902
|
+
index = uchCRCHi ^ data[i]
|
|
903
|
+
uchCRCHi = uchCRCLo ^ auchCRCHi[index]
|
|
904
|
+
uchCRCLo = auchCRCLo[index]
|
|
905
|
+
|
|
906
|
+
return (uchCRCHi << 8) | uchCRCLo
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: sensor-sdk
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.32
|
|
4
4
|
Summary: Python sdk for Synchroni
|
|
5
5
|
Home-page: https://github.com/oymotion/SynchroniSDKPython
|
|
6
6
|
Author: Martin Ye
|
|
@@ -11,15 +11,6 @@ License-File: LICENSE.txt
|
|
|
11
11
|
Requires-Dist: numpy
|
|
12
12
|
Requires-Dist: setuptools
|
|
13
13
|
Requires-Dist: bleak
|
|
14
|
-
Dynamic: author
|
|
15
|
-
Dynamic: author-email
|
|
16
|
-
Dynamic: description
|
|
17
|
-
Dynamic: description-content-type
|
|
18
|
-
Dynamic: home-page
|
|
19
|
-
Dynamic: license-file
|
|
20
|
-
Dynamic: requires-dist
|
|
21
|
-
Dynamic: requires-python
|
|
22
|
-
Dynamic: summary
|
|
23
14
|
|
|
24
15
|
# sensor-sdk
|
|
25
16
|
|
|
@@ -387,10 +378,10 @@ result = sensorProfile.setParam("NTF_IMU", "ON")
|
|
|
387
378
|
result = sensorProfile.setParam("NTF_BRTH", "ON")
|
|
388
379
|
# set BRTH data to ON or OFF, result is "OK" if succeed
|
|
389
380
|
|
|
390
|
-
result = sensorProfile.setParam("
|
|
381
|
+
result = sensorProfile.setParam("FILTER_50HZ", "ON")
|
|
391
382
|
# set 50Hz notch filter to ON or OFF, result is "OK" if succeed
|
|
392
383
|
|
|
393
|
-
result = sensorProfile.setParam("
|
|
384
|
+
result = sensorProfile.setParam("FILTER_60HZ", "ON")
|
|
394
385
|
# set 60Hz notch filter to ON or OFF, result is "OK" if succeed
|
|
395
386
|
|
|
396
387
|
result = sensorProfile.setParam("FILTER_HPF", "ON")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
sensor/__init__.py,sha256=L1VyAP0EDEnJIMeMTzp4iXHSRUUHyHScF_GIl3iYKRI,123
|
|
2
|
+
sensor/gforce.py,sha256=k6nHsNV_IM8ymGYrZXXD3oHC5Ed0qODlvk8W6dhtMMk,26291
|
|
3
|
+
sensor/sensor_controller.py,sha256=cjVOcGaU9_8_eWFamtOpXsqSZMzD7lGU24gC_rsm2FQ,9546
|
|
4
|
+
sensor/sensor_data.py,sha256=RRj5k3F7Cwv_sFvOPN3HqtklntUHFCFMIqzp8QHIhxM,4078
|
|
5
|
+
sensor/sensor_data_context.py,sha256=Y13eTdCKPHAptuMLH8AYozWjxBz2BIEPfcilba5nJX0,31888
|
|
6
|
+
sensor/sensor_device.py,sha256=eO1vaqjxCc2UCPBoKXqlk6o498uRyWt6IYs7r7wXSD0,3042
|
|
7
|
+
sensor/sensor_profile.py,sha256=cCAw8jDSp-EN7eznLhrbJo6dFhOLIOfgTunj47e3qT0,22671
|
|
8
|
+
sensor/sensor_utils.py,sha256=Laj9rJG_6e7mfrXBlw5_NKJC93mOKogati_YQso11Tw,15043
|
|
9
|
+
sensor_sdk-0.0.32.dist-info/LICENSE.txt,sha256=8CSivOpub3IuXODTyqBRI91AxouJZk02YrcKuOAkWu8,1111
|
|
10
|
+
sensor_sdk-0.0.32.dist-info/METADATA,sha256=Os3_yXfiRlJJRSBo9BBULzDpez7sVughbflcN2u2-Ic,9821
|
|
11
|
+
sensor_sdk-0.0.32.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
12
|
+
sensor_sdk-0.0.32.dist-info/top_level.txt,sha256=Ftq49B6bH0Ffdc7c8LkcyakHo6lsg_snlBbpEUoILSk,7
|
|
13
|
+
sensor_sdk-0.0.32.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
14
|
+
sensor_sdk-0.0.32.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
sensor/__init__.py,sha256=L1VyAP0EDEnJIMeMTzp4iXHSRUUHyHScF_GIl3iYKRI,123
|
|
2
|
-
sensor/gforce.py,sha256=k6nHsNV_IM8ymGYrZXXD3oHC5Ed0qODlvk8W6dhtMMk,26291
|
|
3
|
-
sensor/sensor_controller.py,sha256=cjVOcGaU9_8_eWFamtOpXsqSZMzD7lGU24gC_rsm2FQ,9546
|
|
4
|
-
sensor/sensor_data.py,sha256=vKreLHZs7WbQcnfqHiLLfHQ3cCmvD1K2xl2WUQg8vv0,4005
|
|
5
|
-
sensor/sensor_data_context.py,sha256=YGDEbUYElHE8PZLQIcCR08N8Jk3j5UNH2odo43nmba8,30856
|
|
6
|
-
sensor/sensor_device.py,sha256=eO1vaqjxCc2UCPBoKXqlk6o498uRyWt6IYs7r7wXSD0,3042
|
|
7
|
-
sensor/sensor_profile.py,sha256=KDmOQjBM_diG5PDVth9s1ALN-Sd4Y_zpEVkDjW-khSk,22654
|
|
8
|
-
sensor/sensor_utils.py,sha256=7JIZF6uhOcHuAPXwwrQi5FwGU5BVLc6Aml-n9QXzupM,6998
|
|
9
|
-
sensor_sdk-0.0.31.dist-info/licenses/LICENSE.txt,sha256=8CSivOpub3IuXODTyqBRI91AxouJZk02YrcKuOAkWu8,1111
|
|
10
|
-
sensor_sdk-0.0.31.dist-info/METADATA,sha256=Y25zWQWh_rF42spGr1eZf9DDQtQ_fS33vxJNYfHReTQ,10029
|
|
11
|
-
sensor_sdk-0.0.31.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
12
|
-
sensor_sdk-0.0.31.dist-info/top_level.txt,sha256=Ftq49B6bH0Ffdc7c8LkcyakHo6lsg_snlBbpEUoILSk,7
|
|
13
|
-
sensor_sdk-0.0.31.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
14
|
-
sensor_sdk-0.0.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|