mirror of
https://github.com/jwetzell/q-sys-plugin-novastar.git
synced 2026-09-10 06:29:33 +00:00
fix logging
This commit is contained in:
+17
-13
@@ -745,19 +745,19 @@ if (Controls) then
|
|||||||
return dump .. hex .. string.rep( " ", 8 - len % 8 ) .. asc
|
return dump .. hex .. string.rep( " ", 8 - len % 8 ) .. asc
|
||||||
end
|
end
|
||||||
|
|
||||||
function processResponse(data)
|
-- function processResponse(data)
|
||||||
local response = ""
|
-- local response = ""
|
||||||
for k,v in pairs(data) do
|
-- for k,v in pairs(data) do
|
||||||
response = response .. string.pack("B", v)
|
-- response = response .. string.pack("B", v)
|
||||||
end
|
-- end
|
||||||
print("Processing Packet")
|
-- print("Processing Packet")
|
||||||
print(hex_dump(response))
|
-- print(hex_dump(response))
|
||||||
|
|
||||||
if data == getCmdString(NovaStar.Response.Connected) then
|
-- if data == getCmdString(NovaStar.Response.Connected) then
|
||||||
print("Successful Connection Response Received")
|
-- print("Successful Connection Response Received")
|
||||||
NovaStar.setStatus(0,"Connected - " .. Properties['IP Address'].Value)
|
-- NovaStar.setStatus(0,"Connected - " .. Properties['IP Address'].Value)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
NovaStar.socket.Connected = function()
|
NovaStar.socket.Connected = function()
|
||||||
print("TCP Connection Established to NovaStar @ " .. Properties['IP Address'].Value)
|
print("TCP Connection Established to NovaStar @ " .. Properties['IP Address'].Value)
|
||||||
@@ -773,7 +773,11 @@ if (Controls) then
|
|||||||
NovaStar.socket.Data = function ()
|
NovaStar.socket.Data = function ()
|
||||||
print("Reading " .. NovaStar.socket.BufferLength .. " Bytes")
|
print("Reading " .. NovaStar.socket.BufferLength .. " Bytes")
|
||||||
local data = NovaStar.socket:Read(NovaStar.socket.BufferLength);
|
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
|
end
|
||||||
|
|
||||||
NovaStar.socket.Closed = function()
|
NovaStar.socket.Closed = function()
|
||||||
|
|||||||
Reference in New Issue
Block a user