sensor-sdk 0.0.2__py3-none-any.whl → 0.0.4__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sensor-sdk
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: Python sdk for Synchroni
5
5
  Home-page: https://github.com/oymotion/SynchroniSDKPython
6
6
  Author: Martin Ye
@@ -12,7 +12,7 @@ Requires-Dist: numpy
12
12
  Requires-Dist: setuptools
13
13
  Requires-Dist: bleak
14
14
 
15
- # synchroni_sdk_python
15
+ # sensor-sdk
16
16
 
17
17
  Synchroni sdk for Python
18
18
 
@@ -20,7 +20,6 @@ Synchroni sdk for Python
20
20
 
21
21
  Synchroni SDK is the software development kit for developers to access Synchroni products.
22
22
 
23
-
24
23
  ## Contributing
25
24
 
26
25
  See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
@@ -37,7 +36,7 @@ MIT
37
36
  pip install sensor-sdk
38
37
  ```
39
38
 
40
- ## 1. Permission
39
+ ## 1. Permission
41
40
 
42
41
  Application will obtain bluetooth permission by itself.
43
42
 
@@ -47,9 +46,9 @@ Application will obtain bluetooth permission by itself.
47
46
  from sensor import *
48
47
  ```
49
48
 
50
- # SensorController methods:
49
+ ## SensorController methods
51
50
 
52
- ## 1. Initalize
51
+ ### 1. Initalize
53
52
 
54
53
  ```python
55
54
  SensorControllerInstance = SensorController()
@@ -62,33 +61,41 @@ if not SensorControllerInstance.hasDeviceFoundCallback:
62
61
  SensorControllerInstance.onDeviceFoundCallback = on_device_callback
63
62
  ```
64
63
 
65
- ## 2. Start scan
66
- Use `def start_scan(period_in_ms: int) -> bool` to start scan
64
+ ### 2. Start scan
65
+
66
+ Use `def startScan(period_in_ms: int) -> bool` to start scan
67
+
67
68
  ```python
68
69
  success = SensorControllerInstance.startScan(6000)
69
70
  ```
71
+
70
72
  returns true if start scan success, periodInMS means onDeviceCallback will be called every periodInMS
71
73
 
72
- ## 3. Stop scan
74
+ ### 3. Stop scan
75
+
76
+ Use `def stopScan() -> None` to stop scan
73
77
 
74
- Use `def stop_scan() -> None` to stop scan
75
78
  ```python
76
79
  SensorControllerInstance.stopScan()
77
80
  ```
78
- ## 4. Check scaning
81
+
82
+ ### 4. Check scaning
79
83
 
80
84
  Use `property isScanning: bool` to check scanning status
85
+
81
86
  ```python
82
87
  isScanning = SensorControllerInstance.isScanning
83
88
  ```
84
89
 
85
- ## 5. Check if bluetooth is enabled
90
+ ### 5. Check if bluetooth is enabled
86
91
 
87
92
  Use `property isEnabled: bool` to check if bluetooth is enabled
93
+
88
94
  ```python
89
95
  isEnabled = SensorControllerInstance.isEnabled
90
96
  ```
91
- ## 6. Create SensorProfile
97
+
98
+ ### 6. Create SensorProfile
92
99
 
93
100
  Use `def requireSensor(device: BLEDevice) -> SensorProfile | None` to create SensorProfile.
94
101
 
@@ -98,7 +105,7 @@ If bleDevice is invalid, result is None.
98
105
  sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
99
106
  ```
100
107
 
101
- ## 7. Get SensorProfile
108
+ ### 7. Get SensorProfile
102
109
 
103
110
  Use `def getSensor(device: BLEDevice) -> SensorProfile | None` to get SensorProfile.
104
111
 
@@ -108,24 +115,27 @@ If SensorProfile didn't created, result is None.
108
115
  sensorProfile = SensorControllerInstance.getSensor(bleDevice)
109
116
  ```
110
117
 
111
- ## 8. Get Connected SensorProfiles
118
+ ### 8. Get Connected SensorProfiles
112
119
 
113
120
  Use `def getConnectedSensors() -> list[SensorProfile]` to get connected SensorProfiles.
121
+
114
122
  ```python
115
123
  sensorProfiles = SensorControllerInstance.getConnectedSensors()
116
124
  ```
117
125
 
118
- ## 9. Get Connected BLE Devices
126
+ ### 9. Get Connected BLE Devices
119
127
 
120
128
  Use `def getConnectedDevices() -> list[SensorProfile]` to get connected BLE Devices.
129
+
121
130
  ```python
122
131
  bleDevices = SensorControllerInstance.getConnectedDevices()
123
132
  ```
124
133
 
125
- ## 10. Terminate
134
+ ### 10. Terminate
135
+
136
+ Use `def terminate()` to terminate sdk
126
137
 
127
138
  ```python
128
- SensorControllerInstance.terminate()
129
139
 
130
140
  def terminate():
131
141
  SensorControllerInstance.terminate()
@@ -136,13 +146,15 @@ def main():
136
146
  time.sleep(30)
137
147
  SensorControllerInstance.terminate()
138
148
 
139
- Please call terminate when exit main() or press Ctrl+C
149
+ Please MAKE SURE to call terminate when exit main() or press Ctrl+C
140
150
  ```
141
151
 
142
- # SensorProfile methods:
152
+ ## SensorProfile methods
153
+
154
+ ### 11. Initalize
143
155
 
144
- ## 1. Initalize
145
156
  Please register callbacks for SensorProfile
157
+
146
158
  ```python
147
159
  sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
148
160
 
@@ -169,26 +181,30 @@ sensorProfile.onPowerChanged = on_power_changed
169
181
  sensorProfile.onDataCallback = on_data_callback
170
182
  ```
171
183
 
172
- ## 2. Connect device
184
+ ### 12. Connect device
185
+
173
186
  Use `def connect() -> bool` to connect.
187
+
174
188
  ```python
175
189
  success = sensorProfile.connect()
176
190
  ```
177
191
 
178
- ## 3. Disconnect
192
+ ### 13. Disconnect
193
+
179
194
  Use `def disconnect() -> bool` to disconnect.
195
+
180
196
  ```python
181
197
  success = sensorProfile.disconnect()
182
198
  ```
183
199
 
200
+ ### 14. Get device status
184
201
 
185
- ## 4. Get device status
186
- Use `property connectionState: DeviceStateEx` to get device status.
202
+ Use `property deviceState: DeviceStateEx` to get device status.
187
203
 
188
204
  Please send command in 'Ready' state, should be after connect() return True.
189
205
 
190
206
  ```python
191
- deviceStateEx = sensorProfile.connectionState
207
+ deviceStateEx = sensorProfile.deviceState
192
208
 
193
209
  # deviceStateEx has define:
194
210
  # class DeviceStateEx(Enum):
@@ -200,15 +216,16 @@ deviceStateEx = sensorProfile.connectionState
200
216
  # Invalid = 5
201
217
  ```
202
218
 
219
+ ### 15. Get BLE device of SensorProfile
203
220
 
204
-
205
- ## 5. Get BLE device of SensorProfile
206
221
  Use `property BLEDevice: BLEDevice` to get BLE device of SensorProfile.
222
+
207
223
  ```python
208
224
  bleDevice = sensorProfile.BLEDevice
209
225
  ```
210
226
 
211
- ## 6. Get device info of SensorProfile
227
+ ### 16. Get device info of SensorProfile
228
+
212
229
  Use `def getDeviceInfo() -> dict | None` to get device info of SensorProfile.
213
230
 
214
231
  Please call after device in 'Ready' state, return None if it's not connected.
@@ -232,28 +249,34 @@ Please call after device in 'Ready' state, return None if it's not connected.
232
249
  # }
233
250
  ```
234
251
 
252
+ ### 17. Init data transfer
235
253
 
236
- ## 7. Init data transfer
237
254
  Use `def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
238
255
 
239
256
  Please call after device in 'Ready' state, return True if init succeed.
257
+
240
258
  ```python
241
259
  success = sensorProfile.init(5, 60*1000)
242
260
  ```
261
+
243
262
  packageSampleCount: set sample counts of SensorData.channelSamples in onDataCallback()
244
263
  powerRefreshInterval: callback period for onPowerChanged()
245
264
 
246
- ## 8. Check if init data transfer succeed
265
+ ### 18. Check if init data transfer succeed
266
+
247
267
  Use `property hasInited: bool` to check if init data transfer succeed.
268
+
248
269
  ```python
249
270
  hasInited = sensorProfile.hasInited
250
271
  ```
251
272
 
252
- ## 9. DataNotify
273
+ ### 19. DataNotify
274
+
253
275
  Use `def startDataNotification() -> bool` to start data notification.
254
276
 
255
277
  Please call if hasInited return True
256
- ### 9.1 Start data transfer
278
+
279
+ #### 19.1 Start data transfer
257
280
 
258
281
  ```python
259
282
  success = sensorProfile.startDataNotification()
@@ -293,19 +316,24 @@ def on_data_callback(sensor, data):
293
316
  sensorProfile.onDataCallback = on_data_callback
294
317
  ```
295
318
 
296
- ### 9.2 Stop data transfer
319
+ #### 19.2 Stop data transfer
320
+
297
321
  Use `def stopDataNotification() -> bool` to stop data transfer.
322
+
298
323
  ```python
299
324
  success = sensorProfile.stopDataNotification()
300
325
  ```
301
326
 
302
- ### 9.3 Check if it's data transfering
327
+ #### 19.3 Check if it's data transfering
328
+
303
329
  Use `property isDataTransfering: bool` to check if it's data transfering.
330
+
304
331
  ```python
305
332
  isDataTransfering = sensorProfile.isDataTransfering
306
333
  ```
307
334
 
308
- ## 10. Get battery level
335
+ ### 20. Get battery level
336
+
309
337
  Use `def getBatteryLevel() -> int` to get battery level. Please call after device in 'Ready' state.
310
338
 
311
339
  ```python
@@ -0,0 +1,14 @@
1
+ sensor/__init__.py,sha256=L1VyAP0EDEnJIMeMTzp4iXHSRUUHyHScF_GIl3iYKRI,123
2
+ sensor/gforce.py,sha256=ZVOHV6_NiwGMPAf4BXqlxEHsDrynUBr0rcgqmbJT5oc,24586
3
+ sensor/sensor_controller.py,sha256=UcFsbkXbJsknkVARADB_wT0ZGIDVjHfBFMsmxglF1_0,8334
4
+ sensor/sensor_data.py,sha256=Hu7Ql0LgQ7V24xYZhaLrKPwU4KWZeWE655v8Gy8xphY,3934
5
+ sensor/sensor_data_context.py,sha256=fcGEYWOu5x9UGZ-psvKVKA-nxAKfA8vqMEeA4LjsxAA,27978
6
+ sensor/sensor_device.py,sha256=LCjBzm2TuOh2KpHsFTjm1sF8hzwvS22LhF_ueAct0Jo,2848
7
+ sensor/sensor_profile.py,sha256=NuWYSVGrHWA8y2Goi9UyNyZ3bXE8unKrQ560q8looNw,17873
8
+ sensor/utils.py,sha256=LPLnLTOrrsLnVkL65L10PLtqpjgMYkomyVenRc7pUUo,744
9
+ sensor_sdk-0.0.4.dist-info/LICENSE.txt,sha256=8CSivOpub3IuXODTyqBRI91AxouJZk02YrcKuOAkWu8,1111
10
+ sensor_sdk-0.0.4.dist-info/METADATA,sha256=EYBnMeflySNLB1qxF0OtqRx-xW-FiUo_CFAB89w4el8,8055
11
+ sensor_sdk-0.0.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
12
+ sensor_sdk-0.0.4.dist-info/top_level.txt,sha256=Ftq49B6bH0Ffdc7c8LkcyakHo6lsg_snlBbpEUoILSk,7
13
+ sensor_sdk-0.0.4.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
14
+ sensor_sdk-0.0.4.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- sensor/__init__.py,sha256=L1VyAP0EDEnJIMeMTzp4iXHSRUUHyHScF_GIl3iYKRI,123
2
- sensor/gforce.py,sha256=ZVOHV6_NiwGMPAf4BXqlxEHsDrynUBr0rcgqmbJT5oc,24586
3
- sensor/sensor_controller.py,sha256=SD4kcU9Z0IjAoCDCtpM475TpuNwymGxmuFATP4NjY9M,8078
4
- sensor/sensor_data.py,sha256=pHHHitKPs24MWYorW0DrIe4DKOMZU9c5Oh2mGktDUGg,4449
5
- sensor/sensor_data_context.py,sha256=DIY-7vN4ziCbtM8JQC5q_Ggz1FpBCVzm2vu8gEUu4mE,24148
6
- sensor/sensor_device.py,sha256=XLpYe7jlc60PmIstdcqWJ_Vr1CxR2GPVAx5ll_ofnPM,3052
7
- sensor/sensor_profile.py,sha256=44dCvb6EDv1fT6LJfjWmKlH_BMMVfdt46PlNO_LZaJs,17096
8
- sensor/utils.py,sha256=rrgMKIPJ3u1iVSbQqcfUhlQ5h_IatHNPtqojdUHIc9Y,741
9
- sensor_sdk-0.0.2.dist-info/LICENSE.txt,sha256=8CSivOpub3IuXODTyqBRI91AxouJZk02YrcKuOAkWu8,1111
10
- sensor_sdk-0.0.2.dist-info/METADATA,sha256=N1iLvtzUQTtxd9dIytAd61DYqcqZcUaP-TaVs5-FtXw,7970
11
- sensor_sdk-0.0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
12
- sensor_sdk-0.0.2.dist-info/top_level.txt,sha256=Ftq49B6bH0Ffdc7c8LkcyakHo6lsg_snlBbpEUoILSk,7
13
- sensor_sdk-0.0.2.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
14
- sensor_sdk-0.0.2.dist-info/RECORD,,