From 510aa6be06ead02906205b1b0450b7c5a5f10776 Mon Sep 17 00:00:00 2001 From: Katya Date: Wed, 29 Nov 2023 14:08:28 +0300 Subject: [PATCH] added test scripts --- Lua Tests.txt | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Lua Tests.txt diff --git a/Lua Tests.txt b/Lua Tests.txt new file mode 100644 index 0000000..6993adf --- /dev/null +++ b/Lua Tests.txt @@ -0,0 +1,36 @@ +require("LTEModules/1xGen_Test") +require("LTEModules/idiBusFormatter") +require("LTEModules/idiBusCommon") + +-- Line 0 +ibController = IdiBusController{device = "COM1", baudrate = 115200} +-- Line 1 +--ibController = IdiBusController(device = "COM2", baudrate = 115200) + +showIbPacket(StartTest_1xGen{controller = ibController, address = 2}) + +------------------------------------------------------------------------------------------------------ +require("LTEModules/idiBusFormatter") +require("LTEModules/idiBusCommon") + +iBController1 = IdiBusController +{ + -- Line 0 + device="COM1", + -- Line 1 + --device = "COM2", + baudrate=115200 +} +exampleRawIbPacket = { + address=2, + mmps=0x04, + dev=0, + channel=0, + comFunc=0, + data=byteArray({0x01, 0x4E, 0x20, 0x28, 0x01, 0x00, 0x01, 0x9C, 0x40, 0x28, 0x01, 0x01}) +} +local answer + iBController1:sendMasterMessage(exampleRawIbPacket) + answer = iBController1:getBufferAsBytes() + Logger:printLine("Answer:") + Logger:printLineAsHex(answer); Logger:print("\n") \ No newline at end of file