function tm_adcs_state_cfg(buffer, pinfo, tree, adcs_state_cfg, offset) -- Define ProtoFields local f_auto_comm_flag = ProtoField.uint8("adcs_state_cfg.auto_comm_flag", "Auto Commissioning Flag", base.DEC) local f_fsm_state = ProtoField.uint8("adcs_state_cfg.fsm_state", "FSM State", base.DEC) -- Register the fields in the protocol adcs_state_cfg.fields = {f_auto_comm_flag, f_fsm_state} -- Create the subtree for `auto_commissioning` local subtree = tree:add(adcs_state_cfg, buffer(), "TM GET ADCS STATE CFG") offset = offset + 3 local data = buffer(offset,1):le_int() offset = offset + 1 if data == 0 then -- Parse `Auto Commissioning Flag` local value = buffer(offset, 1):le_uint() if value == 0 then subtree:add(f_auto_comm_flag, value):set_text(string.format("Auto commissioning flag : True")) else subtree:add(f_auto_comm_flag, value):set_text(string.format("Auto commissioning flag : False")) end offset = offset + 1 -- Parse `FSM State` subtree:add(f_fsm_state, buffer(offset, 1)) offset = offset + 1 elseif data == -1 then subtree:add(" ADCS operation failure ") elseif data == -2 then subtree:add(" TC TM error ") elseif data == -3 then subtree:add(" Interface error ") elseif data == -4 then subtree:add(" Id not support ") elseif data == -5 then subtree:add(" ADCS HW in invalid power state ") elseif data == -6 then subtree:add(" ADCS Semaphore take failure ") elseif data == -6 then subtree:add(" ADCS Operating Mode Mismatch error ") elseif data == -6 then subtree:add(" ADCS responded data is not in a valid range ") end end