24 lines
508 B
Python
24 lines
508 B
Python
from time import sleep
|
|
|
|
import yaml
|
|
|
|
from transport.serial import Transport
|
|
|
|
config_name = "config.yml"
|
|
|
|
with open(config_name) as f:
|
|
config = yaml.load(f, Loader=yaml.FullLoader)
|
|
|
|
|
|
connector = Transport(config["writer"]["transport"])
|
|
|
|
commands_list = ['GET_A', 'GET_B', 'GET_C', 'GET_NORESP', 'INVALID_CMD']
|
|
|
|
while (True):
|
|
for cmd in commands_list:
|
|
print('Write: ' + cmd)
|
|
connector.writeline(cmd)
|
|
|
|
sleep(0.5)
|
|
print("Response: "+connector.readline())
|
|
sleep(1)
|