Code:
-- Channel
if DSSLastCommand == "FA07" then
DSSLastResponse = DSSLastResponse .. SerialValue
if strlen(DSSLastResponse) == 8 then
-- 00CC hex should be 204 decimal
DSSChannel = format ("%d", tonumber(strsub(DSSLastResponse,3,6), 16))
TriggerEvent("DSSOSD",203,"Channel", DSSChannel)
end
-- Strength
elseif DSSLastCommand == "FA10" then
DSSLastResponse = DSSLastResponse .. SerialValue
if strlen(DSSLastResponse) == 6 then
-- 58 hex should be 88 decimal
DSSStrength = format ("%d", tonumber(strsub(DSSLastResponse,3,4), 16))
TriggerEvent("DSSOSD",203,"Strength", DSSStrength)
DSSLastResponse = ""
end
-- DateTime
elseif DSSLastCommand == "FA11" then
DSSLastResponse = DSSLastResponse .. SerialValue
if strlen(DSSLastResponse) == 18 then
--s = CLng("&H" & Mid(LastResponse, 5, 2)) & "/" & _
--CLng("&H" & Mid(LastResponse, 7, 2)) & "/" & _
--Year(Now) & " " & _
--CLng("&H" & Mid(LastResponse, 9, 2)) & ":" & _
--CLng("&H" & Mid(LastResponse, 11, 2)) & ":" & _
--CLng("&H" & Mid(LastResponse, 13, 2))
-- DSSDateTime = format ("%s", strsub(DSSLastResponse,5,14))
DSSDateTime = tonumber(strsub(DSSLastResponse,5,6), 16) .. "/"
DSSDateTime = DSSDateTime .. tonumber(strsub(DSSLastResponse,7,8), 16) .. " "
DSSDateTime = DSSDateTime .. format("%02d", tonumber(strsub(DSSLastResponse,9,10), 16)) .. ":"
DSSDateTime = DSSDateTime .. format("%02d", tonumber(strsub(DSSLastResponse,11,12), 16)) .. ":"
DSSDateTime = DSSDateTime .. format("%02d", tonumber(strsub(DSSLastResponse,13,14), 16))
TriggerEvent("DSSOSD",203,"Time", DSSDateTime)
DSSLastResponse = ""
end
-- Ignore everything else
else
DSSLastResponse = ""
end
The full GML file at