These get LZ’d into the filesystem, so event @ ~50k, they’re only ~13k on disk after compression. Given the space in these boxes, I think we have more than enough room.
The compression is fairly good, and the only real reason it’s 50k is that it’s got LOTS of comments, along with a number of “tables” containing the Text-strings (Labels) for every type of Alarm trigger/change/status event.
I could strip these tables, and save most of the space, but you’d get very cryptic decodes in the log files. I put them in so folks didn’t need to re-read the reference manual for the API, and so I could add more features “down the road” in terms of Status Messages.
eg. “Mary unlocked the XXXX via Keypad YYYY” type stuff.
To give you an idea of what I mean, I have tables declared like:
--
-- The field on the end is for a future codebase.
--
EVENT_GROUP =
{["000"] = {"Zone is OK", ZONE_LABEL, false},
["001"] = {"Zone is Open", ZONE_LABEL, true},
["002"] = {"Zone is Tampered", ZONE_LABEL, true},
["003"] = {"Zone is in Fire Loop Trouble", ZONE_LABEL, true},
["004"] = {"Non-reportable Event", NON_REPORTABLE_EVENT_LABEL},
["005"] = {"User Code entered on Keypad", USER_LABEL},
["006"] = {"User/Card Access on door", nil},
["007"] = {"Bypass Programming Access", USER_LABEL},
["008"] = {"TX Delay Zone Alarm", ZONE_LABEL, true},
and then stuff like this:
[code] if (tmp == ZONE_LABEL) then
eventLabel = processZoneEvent(deviceId, eventNumber, EVENT_GROUP[eventGroup][3])
areaLabel = AREA_LABEL[areaNumber]
elseif (tmp == USER_LABEL) then
eventLabel = tmp[eventNumber]
areaLabel = AREA_LABEL[areaNumber]
-- TODO: Move this logic into the last parameter of my Table
-- and eliminate all this logic by making it table-driven.
if (eventNumber == "004" or eventNumber == "031") then
processAlarmStay(deviceId, areaNumber, true)
processAlarmArmed(deviceId, areaNumber, true)
elseif (eventNumber == "013" or eventNumber == "014" or eventNumber == "016" or eventNumber == "017") then
processAlarmStay(deviceId, areaNumber, false)
processAlarmArmed(deviceId, areaNumber, false)
elseif (eventNumber == "019" or eventNumber == "020") then
[/code]
The constants in the former, make it somewhat easier to “Decode” the latter without declaring a ton more constants (the latter with be changed to eliminate the if-then-else-end code blocks, and moved to Table-driven state-changes, after I’ve gotten the kinks out of the basic operation.
For those interested, the upload limit for UPnP files is definitely specified by MCV and team. The limit is outlined in the first line of [tt]/www/cgi-bin/cmh/upload_upnp_file.sh[/tt]
#!/usr/bin/haserl --upload-limit=50