tm_adcs_state_cfg.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. function tm_adcs_state_cfg(buffer, pinfo, tree, adcs_state_cfg, offset)
  2. -- Define ProtoFields
  3. local f_auto_comm_flag = ProtoField.uint8("adcs_state_cfg.auto_comm_flag", "Auto Commissioning Flag", base.DEC)
  4. local f_fsm_state = ProtoField.uint8("adcs_state_cfg.fsm_state", "FSM State", base.DEC)
  5. -- Register the fields in the protocol
  6. adcs_state_cfg.fields = {f_auto_comm_flag, f_fsm_state}
  7. -- Create the subtree for `auto_commissioning`
  8. local subtree = tree:add(adcs_state_cfg, buffer(), "TM GET ADCS STATE CFG")
  9. offset = offset + 3
  10. local data = buffer(offset,1):le_int()
  11. offset = offset + 1
  12. if data == 0 then
  13. -- Parse `Auto Commissioning Flag`
  14. local value = buffer(offset, 1):le_uint()
  15. if value == 0 then
  16. subtree:add(f_auto_comm_flag, value):set_text(string.format("Auto commissioning flag : True"))
  17. else
  18. subtree:add(f_auto_comm_flag, value):set_text(string.format("Auto commissioning flag : False"))
  19. end
  20. offset = offset + 1
  21. -- Parse `FSM State`
  22. subtree:add(f_fsm_state, buffer(offset, 1))
  23. offset = offset + 1
  24. elseif data == -1 then
  25. subtree:add(" ADCS operation failure ")
  26. elseif data == -2 then
  27. subtree:add(" TC TM error ")
  28. elseif data == -3 then
  29. subtree:add(" Interface error ")
  30. elseif data == -4 then
  31. subtree:add(" Id not support ")
  32. elseif data == -5 then
  33. subtree:add(" ADCS HW in invalid power state ")
  34. elseif data == -6 then
  35. subtree:add(" ADCS Semaphore take failure ")
  36. elseif data == -6 then
  37. subtree:add(" ADCS Operating Mode Mismatch error ")
  38. elseif data == -6 then
  39. subtree:add(" ADCS responded data is not in a valid range ")
  40. end
  41. end