sensor-sdk 0.0.3__py3-none-any.whl → 0.0.5__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/gforce.py +73 -46
- sensor/sensor_controller.py +114 -38
- sensor/sensor_data.py +44 -41
- sensor/sensor_data_context.py +428 -107
- sensor/sensor_device.py +34 -34
- sensor/sensor_profile.py +243 -109
- sensor/utils.py +54 -10
- {sensor_sdk-0.0.3.dist-info → sensor_sdk-0.0.5.dist-info}/METADATA +14 -2
- sensor_sdk-0.0.5.dist-info/RECORD +14 -0
- sensor_sdk-0.0.3.dist-info/RECORD +0 -14
- {sensor_sdk-0.0.3.dist-info → sensor_sdk-0.0.5.dist-info}/LICENSE.txt +0 -0
- {sensor_sdk-0.0.3.dist-info → sensor_sdk-0.0.5.dist-info}/WHEEL +0 -0
- {sensor_sdk-0.0.3.dist-info → sensor_sdk-0.0.5.dist-info}/top_level.txt +0 -0
- {sensor_sdk-0.0.3.dist-info → sensor_sdk-0.0.5.dist-info}/zip-safe +0 -0
sensor/sensor_device.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
# 详细设备信息
|
|
4
2
|
# 该类用于存储设备的详细信息,包括设备名称、型号、硬件和固件版本、各种通道数量以及 MTU 大小
|
|
5
3
|
from enum import Enum
|
|
@@ -24,40 +22,41 @@ class DeviceInfo:
|
|
|
24
22
|
# def __init__(self, device_name: str, model_name: str, hardware_version: str, firmware_version: str,
|
|
25
23
|
# emg_channel_count: int, eeg_channel_count: int, ecg_channel_count: int,
|
|
26
24
|
# acc_channel_count: int, gyro_channel_count: int, brth_channel_count: int, mtu_size: int):
|
|
27
|
-
# self.DeviceName = device_name
|
|
28
|
-
# self.ModelName = model_name
|
|
29
|
-
# self.HardwareVersion = hardware_version
|
|
30
|
-
# self.FirmwareVersion = firmware_version
|
|
31
|
-
# self.EmgChannelCount = emg_channel_count
|
|
32
|
-
# self.EegChannelCount = eeg_channel_count
|
|
33
|
-
# self.EcgChannelCount = ecg_channel_count
|
|
34
|
-
# self.AccChannelCount = acc_channel_count
|
|
35
|
-
# self.GyroChannelCount = gyro_channel_count
|
|
36
|
-
# self.BrthChannelCount = brth_channel_count
|
|
37
|
-
# self.MTUSize = mtu_size
|
|
25
|
+
# self.DeviceName = device_name
|
|
26
|
+
# self.ModelName = model_name
|
|
27
|
+
# self.HardwareVersion = hardware_version
|
|
28
|
+
# self.FirmwareVersion = firmware_version
|
|
29
|
+
# self.EmgChannelCount = emg_channel_count
|
|
30
|
+
# self.EegChannelCount = eeg_channel_count
|
|
31
|
+
# self.EcgChannelCount = ecg_channel_count
|
|
32
|
+
# self.AccChannelCount = acc_channel_count
|
|
33
|
+
# self.GyroChannelCount = gyro_channel_count
|
|
34
|
+
# self.BrthChannelCount = brth_channel_count
|
|
35
|
+
# self.MTUSize = mtu_size
|
|
38
36
|
|
|
39
37
|
def __init__(self):
|
|
40
|
-
self.DeviceName = ""
|
|
41
|
-
self.ModelName = ""
|
|
42
|
-
self.HardwareVersion = ""
|
|
43
|
-
self.FirmwareVersion = ""
|
|
44
|
-
self.EmgChannelCount = 0
|
|
45
|
-
self.EegChannelCount = 0
|
|
46
|
-
self.EcgChannelCount = 0
|
|
47
|
-
self.AccChannelCount = 0
|
|
48
|
-
self.GyroChannelCount = 0
|
|
49
|
-
self.BrthChannelCount = 0
|
|
50
|
-
self.MTUSize = 0
|
|
38
|
+
self.DeviceName = ""
|
|
39
|
+
self.ModelName = ""
|
|
40
|
+
self.HardwareVersion = ""
|
|
41
|
+
self.FirmwareVersion = ""
|
|
42
|
+
self.EmgChannelCount = 0
|
|
43
|
+
self.EegChannelCount = 0
|
|
44
|
+
self.EcgChannelCount = 0
|
|
45
|
+
self.AccChannelCount = 0
|
|
46
|
+
self.GyroChannelCount = 0
|
|
47
|
+
self.BrthChannelCount = 0
|
|
48
|
+
self.MTUSize = 0
|
|
49
|
+
|
|
51
50
|
|
|
52
51
|
class DeviceStateEx(Enum):
|
|
53
|
-
Disconnected = 0
|
|
54
|
-
Connecting = 1
|
|
55
|
-
Connected = 2
|
|
56
|
-
Ready = 3
|
|
57
|
-
Disconnecting = 4
|
|
58
|
-
Invalid = 5
|
|
52
|
+
Disconnected = 0
|
|
53
|
+
Connecting = 1
|
|
54
|
+
Connected = 2
|
|
55
|
+
Ready = 3
|
|
56
|
+
Disconnecting = 4
|
|
57
|
+
Invalid = 5
|
|
58
|
+
|
|
59
59
|
|
|
60
|
-
|
|
61
60
|
# 蓝牙设备信息
|
|
62
61
|
# 该类用于存储蓝牙设备的基本信息,包括设备名称、地址和信号强度
|
|
63
62
|
class BLEDevice:
|
|
@@ -67,9 +66,10 @@ class BLEDevice:
|
|
|
67
66
|
:param address (str): 设备地址
|
|
68
67
|
:param rssi (int): 信号强度
|
|
69
68
|
"""
|
|
69
|
+
|
|
70
70
|
def __init__(self, name: str, address: str, rssi: int):
|
|
71
71
|
|
|
72
72
|
# 初始化函数,用于创建一个Beacon对象
|
|
73
|
-
self.Name = name
|
|
74
|
-
self.Address = address
|
|
75
|
-
self.RSSI = rssi
|
|
73
|
+
self.Name = name # 设置Beacon的名称
|
|
74
|
+
self.Address = address # 设置Beacon的地址
|
|
75
|
+
self.RSSI = rssi
|