sensor-sdk 0.0.1__tar.gz → 0.0.2__tar.gz

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.1
3
+ Version: 0.0.2
4
4
  Summary: Python sdk for Synchroni
5
5
  Home-page: https://github.com/oymotion/SynchroniSDKPython
6
6
  Author: Martin Ye
@@ -31,7 +31,7 @@ MIT
31
31
  ## Installation
32
32
 
33
33
  ```sh
34
- pip install synchroni_sdk_python
34
+ pip install sensor-sdk
35
35
  ```
36
36
 
37
37
  ## 1. Permission
@@ -49,41 +49,41 @@ from sensor import *
49
49
  ## 1. Initalize
50
50
 
51
51
  ```python
52
- sensorControllerInstance = SensorController.Instance
52
+ SensorControllerInstance = SensorController()
53
53
 
54
54
  # register scan listener
55
- if not sensorControllerInstance.hasDeviceCallback:
56
- def on_device_callback(devices):
55
+ if not SensorControllerInstance.hasDeviceFoundCallback:
56
+ def on_device_callback(deviceList: List[BLEDevice]):
57
57
  # return all devices doesn't connected
58
58
  pass
59
- sensorControllerInstance.onDeviceCallback = on_device_callback
59
+ SensorControllerInstance.onDeviceFoundCallback = on_device_callback
60
60
  ```
61
61
 
62
62
  ## 2. Start scan
63
- Use `async def start_scan(period_in_ms: int) -> bool` to start scan
63
+ Use `def start_scan(period_in_ms: int) -> bool` to start scan
64
64
  ```python
65
- success = await sensorControllerInstance.startScan(6000)
65
+ success = SensorControllerInstance.startScan(6000)
66
66
  ```
67
67
  returns true if start scan success, periodInMS means onDeviceCallback will be called every periodInMS
68
68
 
69
69
  ## 3. Stop scan
70
70
 
71
- Use `async def stop_scan() -> None` to stop scan
71
+ Use `def stop_scan() -> None` to stop scan
72
72
  ```python
73
- await sensorControllerInstance.stopScan()
73
+ SensorControllerInstance.stopScan()
74
74
  ```
75
75
  ## 4. Check scaning
76
76
 
77
77
  Use `property isScanning: bool` to check scanning status
78
78
  ```python
79
- isScanning = sensorControllerInstance.isScanning
79
+ isScanning = SensorControllerInstance.isScanning
80
80
  ```
81
81
 
82
82
  ## 5. Check if bluetooth is enabled
83
83
 
84
84
  Use `property isEnabled: bool` to check if bluetooth is enabled
85
85
  ```python
86
- isEnabled = sensorControllerInstance.isEnabled
86
+ isEnabled = SensorControllerInstance.isEnabled
87
87
  ```
88
88
  ## 6. Create SensorProfile
89
89
 
@@ -92,7 +92,7 @@ Use `def requireSensor(device: BLEDevice) -> SensorProfile | None` to create Sen
92
92
  If bleDevice is invalid, result is None.
93
93
 
94
94
  ```python
95
- sensorProfile = sensorControllerInstance.requireSensor(bleDevice)
95
+ sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
96
96
  ```
97
97
 
98
98
  ## 7. Get SensorProfile
@@ -119,12 +119,29 @@ Use `def getConnectedDevices() -> list[SensorProfile]` to get connected BLE Devi
119
119
  bleDevices = SensorControllerInstance.getConnectedDevices()
120
120
  ```
121
121
 
122
+ ## 10. Terminate
123
+
124
+ ```python
125
+ SensorControllerInstance.terminate()
126
+
127
+ def terminate():
128
+ SensorControllerInstance.terminate()
129
+ exit()
130
+
131
+ def main():
132
+ signal.signal(signal.SIGINT, lambda signal, frame: terminate())
133
+ time.sleep(30)
134
+ SensorControllerInstance.terminate()
135
+
136
+ Please call terminate when exit main() or press Ctrl+C
137
+ ```
138
+
122
139
  # SensorProfile methods:
123
140
 
124
141
  ## 1. Initalize
125
142
  Please register callbacks for SensorProfile
126
143
  ```python
127
- sensorProfile = sensorControllerInstance.requireSensor(bleDevice)
144
+ sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
128
145
 
129
146
  # register callbacks
130
147
  def on_state_changed(sensor, newState):
@@ -150,15 +167,15 @@ sensorProfile.onDataCallback = on_data_callback
150
167
  ```
151
168
 
152
169
  ## 2. Connect device
153
- Use `async def connect() -> bool` to connect.
170
+ Use `def connect() -> bool` to connect.
154
171
  ```python
155
- success = await sensorProfile.connect()
172
+ success = sensorProfile.connect()
156
173
  ```
157
174
 
158
175
  ## 3. Disconnect
159
- Use `async def disconnect() -> bool` to disconnect.
176
+ Use `def disconnect() -> bool` to disconnect.
160
177
  ```python
161
- success = await sensorProfile.disconnect()
178
+ success = sensorProfile.disconnect()
162
179
  ```
163
180
 
164
181
 
@@ -189,12 +206,12 @@ bleDevice = sensorProfile.BLEDevice
189
206
  ```
190
207
 
191
208
  ## 6. Get device info of SensorProfile
192
- Use `async def deviceInfo() -> dict | None` to get device info of SensorProfile.
209
+ Use `def getDeviceInfo() -> dict | None` to get device info of SensorProfile.
193
210
 
194
211
  Please call after device in 'Ready' state, return None if it's not connected.
195
212
 
196
213
  ```python
197
- deviceInfo = await sensorProfile.deviceInfo()
214
+ deviceInfo = sensorProfile.getDeviceInfo()
198
215
 
199
216
  # deviceInfo has defines:
200
217
  # deviceInfo = {
@@ -214,11 +231,11 @@ Please call after device in 'Ready' state, return None if it's not connected.
214
231
 
215
232
 
216
233
  ## 7. Init data transfer
217
- Use `async def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
234
+ Use `def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
218
235
 
219
236
  Please call after device in 'Ready' state, return True if init succeed.
220
237
  ```python
221
- success = await sensorProfile.init(5, 60*1000)
238
+ success = sensorProfile.init(5, 60*1000)
222
239
  ```
223
240
  packageSampleCount: set sample counts of SensorData.channelSamples in onDataCallback()
224
241
  powerRefreshInterval: callback period for onPowerChanged()
@@ -230,13 +247,13 @@ hasInited = sensorProfile.hasInited
230
247
  ```
231
248
 
232
249
  ## 9. DataNotify
233
- Use `async def startDataNotification() -> bool` to start data notification.
250
+ Use `def startDataNotification() -> bool` to start data notification.
234
251
 
235
252
  Please call if hasInited return True
236
253
  ### 9.1 Start data transfer
237
254
 
238
255
  ```python
239
- success = await sensorProfile.startDataNotification()
256
+ success = sensorProfile.startDataNotification()
240
257
  ```
241
258
 
242
259
  Data type list:
@@ -274,9 +291,9 @@ sensorProfile.onDataCallback = on_data_callback
274
291
  ```
275
292
 
276
293
  ### 9.2 Stop data transfer
277
- Use `async def stopDataNotification() -> bool` to stop data transfer.
294
+ Use `def stopDataNotification() -> bool` to stop data transfer.
278
295
  ```python
279
- success = await sensorProfile.stopDataNotification()
296
+ success = sensorProfile.stopDataNotification()
280
297
  ```
281
298
 
282
299
  ### 9.3 Check if it's data transfering
@@ -286,12 +303,12 @@ isDataTransfering = sensorProfile.isDataTransfering
286
303
  ```
287
304
 
288
305
  ## 10. Get battery level
289
- Use `async def batteryPower() -> int` to get battery level. Please call after device in 'Ready' state.
306
+ Use `def getBatteryLevel() -> int` to get battery level. Please call after device in 'Ready' state.
290
307
 
291
308
  ```python
292
- batteryPower = await sensorProfile.batteryPower()
309
+ batteryPower = sensorProfile.getBatteryLevel()
293
310
 
294
311
  # batteryPower is battery level returned, value ranges from 0 to 100, 0 means out of battery, while 100 means full.
295
312
  ```
296
313
 
297
- Please check SimpleTest function in App
314
+ Please check console.py in examples directory
@@ -20,7 +20,7 @@ MIT
20
20
  ## Installation
21
21
 
22
22
  ```sh
23
- pip install synchroni_sdk_python
23
+ pip install sensor-sdk
24
24
  ```
25
25
 
26
26
  ## 1. Permission
@@ -38,41 +38,41 @@ from sensor import *
38
38
  ## 1. Initalize
39
39
 
40
40
  ```python
41
- sensorControllerInstance = SensorController.Instance
41
+ SensorControllerInstance = SensorController()
42
42
 
43
43
  # register scan listener
44
- if not sensorControllerInstance.hasDeviceCallback:
45
- def on_device_callback(devices):
44
+ if not SensorControllerInstance.hasDeviceFoundCallback:
45
+ def on_device_callback(deviceList: List[BLEDevice]):
46
46
  # return all devices doesn't connected
47
47
  pass
48
- sensorControllerInstance.onDeviceCallback = on_device_callback
48
+ SensorControllerInstance.onDeviceFoundCallback = on_device_callback
49
49
  ```
50
50
 
51
51
  ## 2. Start scan
52
- Use `async def start_scan(period_in_ms: int) -> bool` to start scan
52
+ Use `def start_scan(period_in_ms: int) -> bool` to start scan
53
53
  ```python
54
- success = await sensorControllerInstance.startScan(6000)
54
+ success = SensorControllerInstance.startScan(6000)
55
55
  ```
56
56
  returns true if start scan success, periodInMS means onDeviceCallback will be called every periodInMS
57
57
 
58
58
  ## 3. Stop scan
59
59
 
60
- Use `async def stop_scan() -> None` to stop scan
60
+ Use `def stop_scan() -> None` to stop scan
61
61
  ```python
62
- await sensorControllerInstance.stopScan()
62
+ SensorControllerInstance.stopScan()
63
63
  ```
64
64
  ## 4. Check scaning
65
65
 
66
66
  Use `property isScanning: bool` to check scanning status
67
67
  ```python
68
- isScanning = sensorControllerInstance.isScanning
68
+ isScanning = SensorControllerInstance.isScanning
69
69
  ```
70
70
 
71
71
  ## 5. Check if bluetooth is enabled
72
72
 
73
73
  Use `property isEnabled: bool` to check if bluetooth is enabled
74
74
  ```python
75
- isEnabled = sensorControllerInstance.isEnabled
75
+ isEnabled = SensorControllerInstance.isEnabled
76
76
  ```
77
77
  ## 6. Create SensorProfile
78
78
 
@@ -81,7 +81,7 @@ Use `def requireSensor(device: BLEDevice) -> SensorProfile | None` to create Sen
81
81
  If bleDevice is invalid, result is None.
82
82
 
83
83
  ```python
84
- sensorProfile = sensorControllerInstance.requireSensor(bleDevice)
84
+ sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
85
85
  ```
86
86
 
87
87
  ## 7. Get SensorProfile
@@ -108,12 +108,29 @@ Use `def getConnectedDevices() -> list[SensorProfile]` to get connected BLE Devi
108
108
  bleDevices = SensorControllerInstance.getConnectedDevices()
109
109
  ```
110
110
 
111
+ ## 10. Terminate
112
+
113
+ ```python
114
+ SensorControllerInstance.terminate()
115
+
116
+ def terminate():
117
+ SensorControllerInstance.terminate()
118
+ exit()
119
+
120
+ def main():
121
+ signal.signal(signal.SIGINT, lambda signal, frame: terminate())
122
+ time.sleep(30)
123
+ SensorControllerInstance.terminate()
124
+
125
+ Please call terminate when exit main() or press Ctrl+C
126
+ ```
127
+
111
128
  # SensorProfile methods:
112
129
 
113
130
  ## 1. Initalize
114
131
  Please register callbacks for SensorProfile
115
132
  ```python
116
- sensorProfile = sensorControllerInstance.requireSensor(bleDevice)
133
+ sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
117
134
 
118
135
  # register callbacks
119
136
  def on_state_changed(sensor, newState):
@@ -139,15 +156,15 @@ sensorProfile.onDataCallback = on_data_callback
139
156
  ```
140
157
 
141
158
  ## 2. Connect device
142
- Use `async def connect() -> bool` to connect.
159
+ Use `def connect() -> bool` to connect.
143
160
  ```python
144
- success = await sensorProfile.connect()
161
+ success = sensorProfile.connect()
145
162
  ```
146
163
 
147
164
  ## 3. Disconnect
148
- Use `async def disconnect() -> bool` to disconnect.
165
+ Use `def disconnect() -> bool` to disconnect.
149
166
  ```python
150
- success = await sensorProfile.disconnect()
167
+ success = sensorProfile.disconnect()
151
168
  ```
152
169
 
153
170
 
@@ -178,12 +195,12 @@ bleDevice = sensorProfile.BLEDevice
178
195
  ```
179
196
 
180
197
  ## 6. Get device info of SensorProfile
181
- Use `async def deviceInfo() -> dict | None` to get device info of SensorProfile.
198
+ Use `def getDeviceInfo() -> dict | None` to get device info of SensorProfile.
182
199
 
183
200
  Please call after device in 'Ready' state, return None if it's not connected.
184
201
 
185
202
  ```python
186
- deviceInfo = await sensorProfile.deviceInfo()
203
+ deviceInfo = sensorProfile.getDeviceInfo()
187
204
 
188
205
  # deviceInfo has defines:
189
206
  # deviceInfo = {
@@ -203,11 +220,11 @@ Please call after device in 'Ready' state, return None if it's not connected.
203
220
 
204
221
 
205
222
  ## 7. Init data transfer
206
- Use `async def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
223
+ Use `def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
207
224
 
208
225
  Please call after device in 'Ready' state, return True if init succeed.
209
226
  ```python
210
- success = await sensorProfile.init(5, 60*1000)
227
+ success = sensorProfile.init(5, 60*1000)
211
228
  ```
212
229
  packageSampleCount: set sample counts of SensorData.channelSamples in onDataCallback()
213
230
  powerRefreshInterval: callback period for onPowerChanged()
@@ -219,13 +236,13 @@ hasInited = sensorProfile.hasInited
219
236
  ```
220
237
 
221
238
  ## 9. DataNotify
222
- Use `async def startDataNotification() -> bool` to start data notification.
239
+ Use `def startDataNotification() -> bool` to start data notification.
223
240
 
224
241
  Please call if hasInited return True
225
242
  ### 9.1 Start data transfer
226
243
 
227
244
  ```python
228
- success = await sensorProfile.startDataNotification()
245
+ success = sensorProfile.startDataNotification()
229
246
  ```
230
247
 
231
248
  Data type list:
@@ -263,9 +280,9 @@ sensorProfile.onDataCallback = on_data_callback
263
280
  ```
264
281
 
265
282
  ### 9.2 Stop data transfer
266
- Use `async def stopDataNotification() -> bool` to stop data transfer.
283
+ Use `def stopDataNotification() -> bool` to stop data transfer.
267
284
  ```python
268
- success = await sensorProfile.stopDataNotification()
285
+ success = sensorProfile.stopDataNotification()
269
286
  ```
270
287
 
271
288
  ### 9.3 Check if it's data transfering
@@ -275,12 +292,12 @@ isDataTransfering = sensorProfile.isDataTransfering
275
292
  ```
276
293
 
277
294
  ## 10. Get battery level
278
- Use `async def batteryPower() -> int` to get battery level. Please call after device in 'Ready' state.
295
+ Use `def getBatteryLevel() -> int` to get battery level. Please call after device in 'Ready' state.
279
296
 
280
297
  ```python
281
- batteryPower = await sensorProfile.batteryPower()
298
+ batteryPower = sensorProfile.getBatteryLevel()
282
299
 
283
300
  # batteryPower is battery level returned, value ranges from 0 to 100, 0 means out of battery, while 100 means full.
284
301
  ```
285
302
 
286
- Please check SimpleTest function in App
303
+ Please check console.py in examples directory
@@ -61,7 +61,7 @@ class SensorController:
61
61
  def terminate(self):
62
62
  for sensor in self._sensor_profiles.values():
63
63
  if sensor.deviceState == DeviceStateEx.Connected or sensor.deviceState == DeviceStateEx.Ready:
64
- sensor.destroy()
64
+ sensor._destroy()
65
65
 
66
66
 
67
67
  def _match_device(self, _device: bleak.BLEDevice, adv: AdvertisementData):
@@ -104,7 +104,7 @@ class SensorController:
104
104
  self._enable_callback = callback
105
105
 
106
106
  @property
107
- def hasDeviceCallback(self) -> bool:
107
+ def hasDeviceFoundCallback(self) -> bool:
108
108
  """
109
109
  检查是否有扫描设备回调。
110
110
 
@@ -112,7 +112,7 @@ class SensorController:
112
112
  """
113
113
  return self._device_callback != None
114
114
 
115
- @hasDeviceCallback.setter
115
+ @hasDeviceFoundCallback.setter
116
116
  def onDeviceFoundCallback(self, callback: Callable[[List[sensor_profile.BLEDevice]], None]):
117
117
  """
118
118
  设置扫描设备回调。
@@ -70,9 +70,9 @@ class SensorProfile:
70
70
  反初始化 SensorProfile 类的实例。
71
71
 
72
72
  """
73
- self.destroy()
73
+ self._destroy()
74
74
 
75
- def destroy(self):
75
+ def _destroy(self):
76
76
  if self._device_state == DeviceStateEx.Connected or self._device_state == DeviceStateEx.Ready:
77
77
  self.disconnect()
78
78
  if (self._data_event_loop != None):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sensor-sdk
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Python sdk for Synchroni
5
5
  Home-page: https://github.com/oymotion/SynchroniSDKPython
6
6
  Author: Martin Ye
@@ -31,7 +31,7 @@ MIT
31
31
  ## Installation
32
32
 
33
33
  ```sh
34
- pip install synchroni_sdk_python
34
+ pip install sensor-sdk
35
35
  ```
36
36
 
37
37
  ## 1. Permission
@@ -49,41 +49,41 @@ from sensor import *
49
49
  ## 1. Initalize
50
50
 
51
51
  ```python
52
- sensorControllerInstance = SensorController.Instance
52
+ SensorControllerInstance = SensorController()
53
53
 
54
54
  # register scan listener
55
- if not sensorControllerInstance.hasDeviceCallback:
56
- def on_device_callback(devices):
55
+ if not SensorControllerInstance.hasDeviceFoundCallback:
56
+ def on_device_callback(deviceList: List[BLEDevice]):
57
57
  # return all devices doesn't connected
58
58
  pass
59
- sensorControllerInstance.onDeviceCallback = on_device_callback
59
+ SensorControllerInstance.onDeviceFoundCallback = on_device_callback
60
60
  ```
61
61
 
62
62
  ## 2. Start scan
63
- Use `async def start_scan(period_in_ms: int) -> bool` to start scan
63
+ Use `def start_scan(period_in_ms: int) -> bool` to start scan
64
64
  ```python
65
- success = await sensorControllerInstance.startScan(6000)
65
+ success = SensorControllerInstance.startScan(6000)
66
66
  ```
67
67
  returns true if start scan success, periodInMS means onDeviceCallback will be called every periodInMS
68
68
 
69
69
  ## 3. Stop scan
70
70
 
71
- Use `async def stop_scan() -> None` to stop scan
71
+ Use `def stop_scan() -> None` to stop scan
72
72
  ```python
73
- await sensorControllerInstance.stopScan()
73
+ SensorControllerInstance.stopScan()
74
74
  ```
75
75
  ## 4. Check scaning
76
76
 
77
77
  Use `property isScanning: bool` to check scanning status
78
78
  ```python
79
- isScanning = sensorControllerInstance.isScanning
79
+ isScanning = SensorControllerInstance.isScanning
80
80
  ```
81
81
 
82
82
  ## 5. Check if bluetooth is enabled
83
83
 
84
84
  Use `property isEnabled: bool` to check if bluetooth is enabled
85
85
  ```python
86
- isEnabled = sensorControllerInstance.isEnabled
86
+ isEnabled = SensorControllerInstance.isEnabled
87
87
  ```
88
88
  ## 6. Create SensorProfile
89
89
 
@@ -92,7 +92,7 @@ Use `def requireSensor(device: BLEDevice) -> SensorProfile | None` to create Sen
92
92
  If bleDevice is invalid, result is None.
93
93
 
94
94
  ```python
95
- sensorProfile = sensorControllerInstance.requireSensor(bleDevice)
95
+ sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
96
96
  ```
97
97
 
98
98
  ## 7. Get SensorProfile
@@ -119,12 +119,29 @@ Use `def getConnectedDevices() -> list[SensorProfile]` to get connected BLE Devi
119
119
  bleDevices = SensorControllerInstance.getConnectedDevices()
120
120
  ```
121
121
 
122
+ ## 10. Terminate
123
+
124
+ ```python
125
+ SensorControllerInstance.terminate()
126
+
127
+ def terminate():
128
+ SensorControllerInstance.terminate()
129
+ exit()
130
+
131
+ def main():
132
+ signal.signal(signal.SIGINT, lambda signal, frame: terminate())
133
+ time.sleep(30)
134
+ SensorControllerInstance.terminate()
135
+
136
+ Please call terminate when exit main() or press Ctrl+C
137
+ ```
138
+
122
139
  # SensorProfile methods:
123
140
 
124
141
  ## 1. Initalize
125
142
  Please register callbacks for SensorProfile
126
143
  ```python
127
- sensorProfile = sensorControllerInstance.requireSensor(bleDevice)
144
+ sensorProfile = SensorControllerInstance.requireSensor(bleDevice)
128
145
 
129
146
  # register callbacks
130
147
  def on_state_changed(sensor, newState):
@@ -150,15 +167,15 @@ sensorProfile.onDataCallback = on_data_callback
150
167
  ```
151
168
 
152
169
  ## 2. Connect device
153
- Use `async def connect() -> bool` to connect.
170
+ Use `def connect() -> bool` to connect.
154
171
  ```python
155
- success = await sensorProfile.connect()
172
+ success = sensorProfile.connect()
156
173
  ```
157
174
 
158
175
  ## 3. Disconnect
159
- Use `async def disconnect() -> bool` to disconnect.
176
+ Use `def disconnect() -> bool` to disconnect.
160
177
  ```python
161
- success = await sensorProfile.disconnect()
178
+ success = sensorProfile.disconnect()
162
179
  ```
163
180
 
164
181
 
@@ -189,12 +206,12 @@ bleDevice = sensorProfile.BLEDevice
189
206
  ```
190
207
 
191
208
  ## 6. Get device info of SensorProfile
192
- Use `async def deviceInfo() -> dict | None` to get device info of SensorProfile.
209
+ Use `def getDeviceInfo() -> dict | None` to get device info of SensorProfile.
193
210
 
194
211
  Please call after device in 'Ready' state, return None if it's not connected.
195
212
 
196
213
  ```python
197
- deviceInfo = await sensorProfile.deviceInfo()
214
+ deviceInfo = sensorProfile.getDeviceInfo()
198
215
 
199
216
  # deviceInfo has defines:
200
217
  # deviceInfo = {
@@ -214,11 +231,11 @@ Please call after device in 'Ready' state, return None if it's not connected.
214
231
 
215
232
 
216
233
  ## 7. Init data transfer
217
- Use `async def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
234
+ Use `def init(packageSampleCount: int, powerRefreshInterval: int) -> bool`.
218
235
 
219
236
  Please call after device in 'Ready' state, return True if init succeed.
220
237
  ```python
221
- success = await sensorProfile.init(5, 60*1000)
238
+ success = sensorProfile.init(5, 60*1000)
222
239
  ```
223
240
  packageSampleCount: set sample counts of SensorData.channelSamples in onDataCallback()
224
241
  powerRefreshInterval: callback period for onPowerChanged()
@@ -230,13 +247,13 @@ hasInited = sensorProfile.hasInited
230
247
  ```
231
248
 
232
249
  ## 9. DataNotify
233
- Use `async def startDataNotification() -> bool` to start data notification.
250
+ Use `def startDataNotification() -> bool` to start data notification.
234
251
 
235
252
  Please call if hasInited return True
236
253
  ### 9.1 Start data transfer
237
254
 
238
255
  ```python
239
- success = await sensorProfile.startDataNotification()
256
+ success = sensorProfile.startDataNotification()
240
257
  ```
241
258
 
242
259
  Data type list:
@@ -274,9 +291,9 @@ sensorProfile.onDataCallback = on_data_callback
274
291
  ```
275
292
 
276
293
  ### 9.2 Stop data transfer
277
- Use `async def stopDataNotification() -> bool` to stop data transfer.
294
+ Use `def stopDataNotification() -> bool` to stop data transfer.
278
295
  ```python
279
- success = await sensorProfile.stopDataNotification()
296
+ success = sensorProfile.stopDataNotification()
280
297
  ```
281
298
 
282
299
  ### 9.3 Check if it's data transfering
@@ -286,12 +303,12 @@ isDataTransfering = sensorProfile.isDataTransfering
286
303
  ```
287
304
 
288
305
  ## 10. Get battery level
289
- Use `async def batteryPower() -> int` to get battery level. Please call after device in 'Ready' state.
306
+ Use `def getBatteryLevel() -> int` to get battery level. Please call after device in 'Ready' state.
290
307
 
291
308
  ```python
292
- batteryPower = await sensorProfile.batteryPower()
309
+ batteryPower = sensorProfile.getBatteryLevel()
293
310
 
294
311
  # batteryPower is battery level returned, value ranges from 0 to 100, 0 means out of battery, while 100 means full.
295
312
  ```
296
313
 
297
- Please check SimpleTest function in App
314
+ Please check console.py in examples directory
@@ -8,7 +8,7 @@ with open(os.path.join(this_directory, 'README.md'), "r", encoding="utf-8") as f
8
8
 
9
9
  setup(
10
10
  name='sensor-sdk',
11
- version='0.0.1',
11
+ version='0.0.2',
12
12
  description='Python sdk for Synchroni',
13
13
  long_description=long_description,
14
14
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes