From 982518403c6d8e43f5b3a86a78b0da1abe496b2f Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Thu, 4 Nov 2021 10:43:01 -0500 Subject: [PATCH] fix logging --- content/novastar.qplug | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/content/novastar.qplug b/content/novastar.qplug index bea856a..62209bc 100644 --- a/content/novastar.qplug +++ b/content/novastar.qplug @@ -745,19 +745,19 @@ if (Controls) then return dump .. hex .. string.rep( " ", 8 - len % 8 ) .. asc end - function processResponse(data) - local response = "" - for k,v in pairs(data) do - response = response .. string.pack("B", v) - end - print("Processing Packet") - print(hex_dump(response)) + -- function processResponse(data) + -- local response = "" + -- for k,v in pairs(data) do + -- response = response .. string.pack("B", v) + -- end + -- print("Processing Packet") + -- print(hex_dump(response)) - if data == getCmdString(NovaStar.Response.Connected) then - print("Successful Connection Response Received") - NovaStar.setStatus(0,"Connected - " .. Properties['IP Address'].Value) - end - end + -- if data == getCmdString(NovaStar.Response.Connected) then + -- print("Successful Connection Response Received") + -- NovaStar.setStatus(0,"Connected - " .. Properties['IP Address'].Value) + -- end + -- end NovaStar.socket.Connected = function() print("TCP Connection Established to NovaStar @ " .. Properties['IP Address'].Value) @@ -773,7 +773,11 @@ if (Controls) then NovaStar.socket.Data = function () print("Reading " .. NovaStar.socket.BufferLength .. " Bytes") local data = NovaStar.socket:Read(NovaStar.socket.BufferLength); - processResponse(data) + print(hex_dump(data)) + if data == getCmdString(NovaStar.Response.Connected) then + print("Successful Connection Response Received") + NovaStar.setStatus(0,"Connected - " .. Properties['IP Address'].Value) + end end NovaStar.socket.Closed = function()