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)
    r = d.get_data()
    print(r.__len__())
    # d.disable()
    # d.disconnect()


if __name__ == '__main__':
    test2()
