12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- function tm_get_sdr_tmr_cfg(buffer, pinfo, tree, sdr_tmr_cfg, offset)
- -- Define ProtoFields for the structure
- local f_beacon_enb_tmr = ProtoField.uint32("sdr_tmr_cfg.beacon_enb_tmr", "Beacon Enable Timer", base.DEC)
- local f_beacon_prd_tmr = ProtoField.uint32("sdr_tmr_cfg.beacon_prd_tmr", "Beacon Period Timer", base.DEC)
- local f_beacon_rep_tmr = ProtoField.uint32("sdr_tmr_cfg.beacon_rep_tmr", "Beacon Repetition Timer", base.DEC)
- local f_tx_data_rep_cnt = ProtoField.uint32("sdr_tmr_cfg.tx_data_rep_cnt", "TX Data Repetition Count", base.DEC)
- local f_sdr_tm_tx_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_tm_tx_tmr", "SDR TM TX Timer", base.DEC)
- local f_sdr_tx_on_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_tx_on_tmr", "SDR TX On Timer", base.DEC)
- local f_sdr_rx_on_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_rx_on_tmr", "SDR RX On Timer", base.DEC)
- local f_sdr_tm_read_tmr = ProtoField.uint32("sdr_tmr_cfg.sdr_tm_read_tmr", "SDR TM Read Timer", base.DEC)
- -- Add fields to the protocol
- sdr_tmr_cfg.fields = {
- f_beacon_enb_tmr,
- f_beacon_prd_tmr,
- f_beacon_rep_tmr,
- f_tx_data_rep_cnt,
- f_sdr_tm_tx_tmr,
- f_sdr_tx_on_tmr,
- f_sdr_rx_on_tmr,
- f_sdr_tm_read_tmr
- }
- -- Add a subtree for the structure
- local subtree = tree:add(sdr_tmr_cfg, buffer(), "TM GET SDR TMR CNFG")
- -- Dissect each field (4 bytes each)
- local beacon_enb_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_beacon_enb_tmr, buffer(offset, 4)):set_text(string.format("Beacon Enable Timer: %d", beacon_enb_tmr))
- offset = offset + 4
- local beacon_prd_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_beacon_prd_tmr, buffer(offset, 4)):set_text(string.format("Beacon Period Timer: %d", beacon_prd_tmr))
- offset = offset + 4
- local beacon_rep_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_beacon_rep_tmr, buffer(offset, 4)):set_text(string.format("Beacon Repetition Timer: %d", beacon_rep_tmr))
- offset = offset + 4
- local tx_data_rep_cnt = buffer(offset, 4):le_uint()
- subtree:add(f_tx_data_rep_cnt, buffer(offset, 4)):set_text(string.format("TX Data Repetition Count: %d", tx_data_rep_cnt))
- offset = offset + 4
- local sdr_tm_tx_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_sdr_tm_tx_tmr, buffer(offset, 4)):set_text(string.format("SDR TM TX Timer: %d", sdr_tm_tx_tmr))
- offset = offset + 4
- local sdr_tx_on_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_sdr_tx_on_tmr, buffer(offset, 4)):set_text(string.format("SDR TX On Timer: %d", sdr_tx_on_tmr))
- offset = offset + 4
- local sdr_rx_on_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_sdr_rx_on_tmr, buffer(offset, 4)):set_text(string.format("SDR RX On Timer: %d", sdr_rx_on_tmr))
- offset = offset + 4
- local sdr_tm_read_tmr = buffer(offset, 4):le_uint()
- subtree:add(f_sdr_tm_read_tmr, buffer(offset, 4)):set_text(string.format("SDR TM Read Timer: %d", sdr_tm_read_tmr))
- offset = offset + 4
- return offset
- end
|