2021-11-04 00:52:48 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2021-11-05 05:21:01 +00:00
|
|
|
from feasycom_ble import BTLEUart
|
|
|
|
from solar_ble import MAC, construct_request, write
|
2021-11-04 00:52:48 +00:00
|
|
|
|
2021-11-05 02:01:43 +00:00
|
|
|
with BTLEUart(MAC, timeout=1) as x:
|
2021-11-04 00:52:48 +00:00
|
|
|
|
2021-11-05 02:01:43 +00:00
|
|
|
print(x)
|
2021-11-04 00:52:48 +00:00
|
|
|
|
2021-11-05 02:01:43 +00:00
|
|
|
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)
|
2021-11-04 00:52:48 +00:00
|
|
|
|
2021-11-05 02:01:43 +00:00
|
|
|
# x.timeout = 2
|
2021-11-04 00:52:48 +00:00
|
|
|
|
2021-11-05 02:01:43 +00:00
|
|
|
# print(x.read())
|
|
|
|
# print(x.read(1))
|