mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-06 06:43:54 +00:00
add testdata to the client
This commit is contained in:
parent
6306a845c7
commit
66e0ede4c0
3 changed files with 145 additions and 4 deletions
12
bw_client.py
12
bw_client.py
|
|
@ -79,13 +79,17 @@ try:
|
|||
bwClient = TCPClient()
|
||||
if bwClient.connect(ip, port):
|
||||
|
||||
testFile = open(paths.TEST_PATH + "testdata.txt", "r")
|
||||
|
||||
while 1:
|
||||
|
||||
for i in range(0, 5): # todo implement real data receive
|
||||
time.sleep(1)
|
||||
print("Alarm Nr #" + str(i))
|
||||
for testData in testFile:
|
||||
|
||||
bwPacket = Decoder.decode("ZVEI1: 12345")
|
||||
if (len(testData.rstrip(' \t\n\r')) == 0) or ("#" in testData[0]):
|
||||
continue
|
||||
|
||||
logging.debug("Test: %s", testData)
|
||||
bwPacket = Decoder.decode(testData)
|
||||
|
||||
if bwPacket:
|
||||
bwPacket.printInfo()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue