flandre/test/testDevice.py

33 lines
663 B
Python
Raw Normal View History

2025-02-26 16:22:09 +08:00
import time
from pathlib import Path
from nodes.Device import Device
def test1():
d = Device()
d.setup()
d.connect()
d.enable()
print(d.setfile(
Path('/home/lambda/source/scarlet/flandre/config/device/AA256,U=30,M=PWI,S=(256 1502).txt').read_text()))
d.disable()
d.disconnect()
def test2():
d = Device()
d.setup()
# d.connect()
# d.enable()
# d.setfile(Path('/home/lambda/source/scarlet/flandre/config/device/AA256,U=30,M=PWI,S=(256 1502).txt').read_text())
# time.sleep(2)
2025-03-24 11:50:13 +08:00
r = d.get_data()
print(r.__len__())
2025-02-26 16:22:09 +08:00
# d.disable()
# d.disconnect()
if __name__ == '__main__':
test2()