added control app update message for better performance

This commit is contained in:
Mikayla
2024-10-04 02:33:26 +00:00
parent 35bbd14cbc
commit 966ca94775
7 changed files with 100 additions and 14 deletions

View File

@@ -550,6 +550,11 @@ function pocket.comms(version, nic, sv_watchdog, api_watchdog, nav)
if self.api.linked then _send_api(CRDN_TYPE.API_GET_UNIT, { unit }) end
end
-- coordinator get control app data
function public.api__get_control()
if self.api.linked then _send_api(CRDN_TYPE.API_GET_CTRL, {}) end
end
-- send a facility command
---@param cmd FAC_COMMAND command
---@param option any? optional option options for the optional options (like waste mode)
@@ -702,6 +707,10 @@ function pocket.comms(version, nic, sv_watchdog, api_watchdog, nav)
if _check_length(packet, 12) and type(packet.data[1]) == "number" and iocontrol.get_db().units[packet.data[1]] then
iocontrol.record_unit_data(packet.data)
end
elseif packet.type == CRDN_TYPE.API_GET_CTRL then
if _check_length(packet, #iocontrol.get_db().units) then
iocontrol.record_control_data(packet.data)
end
else _fail_type(packet) end
else
log.debug("discarding coordinator SCADA_CRDN packet before linked")