srne-mqtt/misc/test_bleuart.py

19 lines
393 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2023-01-07 17:24:41 +00:00
from srnemqtt import MAC, construct_request, write
from srnemqtt.feasycom_ble import BTLEUart
with BTLEUart(MAC, timeout=1) as x:
print(x)
write(x, construct_request(0x0E, words=3))
x.read(3, timeout=1)
print(x.read(6, timeout=0.01))
x.read(2, timeout=0.01)
print(x.timeout)
# x.timeout = 2
# print(x.read())
# print(x.read(1))