#51 usage of nic.receive and some cleanup

This commit is contained in:
Mikayla Fischler
2023-06-23 14:12:41 -04:00
parent ffac6996ed
commit 9073009eb0
4 changed files with 18 additions and 18 deletions

View File

@@ -178,13 +178,10 @@ function pocket.comms(version, nic, pkt_channel, svr_channel, crd_channel, range
---@param distance integer
---@return mgmt_frame|capi_frame|nil packet
function public.parse_packet(side, sender, reply_to, message, distance)
local s_pkt = nic.receive(side, sender, reply_to, message, distance)
local pkt = nil
local s_pkt = comms.scada_packet()
-- parse packet as generic SCADA packet
s_pkt.receive(side, sender, reply_to, message, distance)
if s_pkt.is_valid() then
if s_pkt then
-- get as SCADA management packet
if s_pkt.protocol() == PROTOCOL.SCADA_MGMT then
local mgmt_pkt = comms.mgmt_packet()