tm_get_sdr_tmr_cfg.lua 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. function tm_get_sdr_tmr_cfg(buffer, pinfo, tree, sdr_tmr_cfg, offset)
  2. -- Define ProtoFields for the structure
  3. local f_beacon_enb_tmr = ProtoField.uint32("sdr_tmr_cfg.beacon_enb_tmr", "Beacon Enable Timer", base.DEC)
  4. local f_beacon_prd_tmr = ProtoField.uint32("sdr_tmr_cfg.beacon_prd_tmr", "Beacon Period Timer", base.DEC)
  5. local f_beacon_rep_tmr = ProtoField.uint32("sdr_tmr_cfg.beacon_rep_tmr", "Beacon Repetition Timer", base.DEC)
  6. local f_tx_data_rep_cnt = ProtoField.uint32("sdr_tmr_cfg.tx_data_rep_cnt", "TX Data Repetition Count", base.DEC)
  7. local f_sdr_tm_tx_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_tm_tx_tmr", "SDR TM TX Timer", base.DEC)
  8. local f_sdr_tx_on_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_tx_on_tmr", "SDR TX On Timer", base.DEC)
  9. local f_sdr_rx_on_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_rx_on_tmr", "SDR RX On Timer", base.DEC)
  10. local f_sdr_tm_read_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_tm_read_tmr", "SDR TM Read Timer", base.DEC)
  11. -- Add fields to the protocol
  12. sdr_tmr_cfg.fields = {
  13. f_beacon_enb_tmr,
  14. f_beacon_prd_tmr,
  15. f_beacon_rep_tmr,
  16. f_tx_data_rep_cnt,
  17. f_sdr_tm_tx_tmr,
  18. f_sdr_tx_on_tmr,
  19. f_sdr_rx_on_tmr,
  20. f_sdr_tm_read_tmr
  21. }
  22. -- Add a subtree for the structure
  23. local subtree = tree:add(sdr_tmr_cfg, buffer(), "TM GET SDR TMR CNFG")
  24. -- Dissect each field (4 bytes each)
  25. local beacon_enb_tmr = buffer(offset, 4):le_uint()
  26. subtree:add(f_beacon_enb_tmr, buffer(offset, 4)):set_text(string.format("Beacon Enable Timer: %d", beacon_enb_tmr))
  27. offset = offset + 4
  28. local beacon_prd_tmr = buffer(offset, 4):le_uint()
  29. subtree:add(f_beacon_prd_tmr, buffer(offset, 4)):set_text(string.format("Beacon Period Timer: %d", beacon_prd_tmr))
  30. offset = offset + 4
  31. local beacon_rep_tmr = buffer(offset, 4):le_uint()
  32. subtree:add(f_beacon_rep_tmr, buffer(offset, 4)):set_text(string.format("Beacon Repetition Timer: %d", beacon_rep_tmr))
  33. offset = offset + 4
  34. local tx_data_rep_cnt = buffer(offset, 4):le_uint()
  35. subtree:add(f_tx_data_rep_cnt, buffer(offset, 4)):set_text(string.format("TX Data Repetition Count: %d", tx_data_rep_cnt))
  36. offset = offset + 4
  37. local sdr_tm_tx_tmr = buffer(offset, 4):le_uint()
  38. subtree:add(f_sdr_tm_tx_tmr, buffer(offset, 4)):set_text(string.format("SDR TM TX Timer: %d", sdr_tm_tx_tmr))
  39. offset = offset + 4
  40. local sdr_tx_on_tmr = buffer(offset, 4):le_uint()
  41. subtree:add(f_sdr_tx_on_tmr, buffer(offset, 4)):set_text(string.format("SDR TX On Timer: %d", sdr_tx_on_tmr))
  42. offset = offset + 4
  43. local sdr_rx_on_tmr = buffer(offset, 4):le_uint()
  44. subtree:add(f_sdr_rx_on_tmr, buffer(offset, 4)):set_text(string.format("SDR RX On Timer: %d", sdr_rx_on_tmr))
  45. offset = offset + 4
  46. local sdr_tm_read_tmr = buffer(offset, 4):le_uint()
  47. subtree:add(f_sdr_tm_read_tmr, buffer(offset, 4)):set_text(string.format("SDR TM Read Timer: %d", sdr_tm_read_tmr))
  48. offset = offset + 4
  49. return offset
  50. end