function tm_sband_get_feature_select(buffer, pinfo, tree, sband_get_feature_select, offset) -- Define ProtoFields local f_crc16 = ProtoField.uint16("sband_get_feature_select.Crc16", "Crc16", base.HEX) local f_reserve_0 = ProtoField.uint16("sband_get_feature_select.Reserve_0", "Reserve_0", base.HEX) local f_more_xmt_mod = ProtoField.uint8("sband_get_feature_select.MoreXmtMod", "MoreXmtMod", base.DEC) local f_xmt_offset_mod = ProtoField.uint8("sband_get_feature_select.XmtOffsetMod", "XmtOffsetMod", base.DEC) local f_rs_mode = ProtoField.uint8("sband_get_feature_select.RsMode", "RsMode", base.DEC) local f_xmt_ch0_en = ProtoField.uint8("sband_get_feature_select.XmtCh0_En", "XmtCh0_En", base.DEC) local f_xmt_ch1_en = ProtoField.uint8("sband_get_feature_select.XmtCh1_En", "XmtCh1_En", base.DEC) local f_rcv_ch0_en = ProtoField.uint8("sband_get_feature_select.RcvCh0_En", "RcvCh0_En", base.DEC) local f_rcv_ch1_en = ProtoField.uint8("sband_get_feature_select.RcvCh1_En", "RcvCh1_En", base.DEC) local f_rcv_ch0_gain_max = ProtoField.uint8("sband_get_feature_select.RcvCh0_GainMax", "RcvCh0_GainMax", base.DEC) local f_rcv_ch1_gain_max = ProtoField.uint8("sband_get_feature_select.RcvCh1_GainMax", "RcvCh1_GainMax", base.DEC) local f_disable_xmt_symb_freq_change = ProtoField.uint8("sband_get_feature_select.DisableXmtSymbFreqChange", "DisableXmtSymbFreqChange", base.DEC) local f_disable_rcv_symb_freq_change = ProtoField.uint8("sband_get_feature_select.DisableRcvSymbFreqChange", "DisableRcvSymbFreqChange", base.DEC) local f_disable_xmt_up_sampling = ProtoField.uint8("sband_get_feature_select.DisableXmtUpSampling", "DisableXmtUpSampling", base.DEC) local f_reserve_1 = ProtoField.uint32("sband_get_feature_select.Reserve_1", "Reserve_1", base.HEX) local f_xmt_symb_freq = ProtoField.uint16("sband_get_feature_select.XmtSymbFreq", "XmtSymbFreq", base.HEX) local f_rcv_symb_freq = ProtoField.uint16("sband_get_feature_select.RcvSymbFreq", "RcvSymbFreq", base.HEX) local f_reserve_3 = ProtoField.uint32("sband_get_feature_select.Reserve_3", "Reserve_3", base.HEX) -- Register the fields in the protocol sband_get_feature_select.fields = { f_crc16, f_reserve_0, f_more_xmt_mod, f_xmt_offset_mod, f_rs_mode, f_xmt_ch0_en, f_xmt_ch1_en, f_rcv_ch0_en, f_rcv_ch1_en, f_rcv_ch0_gain_max, f_rcv_ch1_gain_max, f_disable_xmt_symb_freq_change, f_disable_rcv_symb_freq_change, f_disable_xmt_up_sampling, f_reserve_1, f_xmt_symb_freq, f_rcv_symb_freq, f_reserve_3 } -- Create the subtree for tm_sband_get_feature_select local subtree = tree:add(sband_get_feature_select, buffer(), "TM SBAND GET FEATURE SELECT") -- Parse the 16-bit `Crc16` subtree:add(f_crc16, buffer(offset, 2)) offset = offset + 2 -- Parse the 10-bit `Reserve_0` local value local data = buffer(offset, 2):le_uint() value = data & 0x3ff subtree:add(f_reserve_0, value) -- Parse `MoreXmtMod` (1 bit) value = (data >> 10) & 1 subtree:add(f_more_xmt_mod,value) -- Parse `XmtOffsetMod` (1 bit) value = (data >> 11) & 1 subtree:add(f_xmt_offset_mod, value) -- Parse `RsMode` (4 bits) value = (data >> 12) & 0xf000 subtree:add(f_rs_mode, value) offset = offset + 2 data = buffer(offset , 4):le_uint() value = data & 1 subtree:add(f_xmt_ch0_en, value) -- Parse `XmtCh1_En` (1 bit) value = (data >> 1) & 1 subtree:add(f_xmt_ch1_en, value) -- Parse `RcvCh0_En` (1 bit) value = (data >> 2) & 1 subtree:add(f_rcv_ch0_en, value ) -- Parse `RcvCh1_En` (1 bit) value = (data >> 3) & 1 subtree:add(f_rcv_ch1_en, value) -- Parse `RcvCh0_GainMax` (1 bit) value = (data >> 4) & 1 subtree:add(f_rcv_ch0_gain_max, value) -- Parse `RcvCh1_GainMax` (1 bit) value = (data >> 5) & 1 subtree:add(f_rcv_ch1_gain_max, value) -- Parse `DisableXmtSymbFreqChange` (1 bit) value = (data >> 6) & 1 subtree:add(f_disable_xmt_symb_freq_change, value) -- Parse `DisableRcvSymbFreqChange` (1 bit) value = (data >> 7) & 1 subtree:add(f_disable_rcv_symb_freq_change, value) -- Parse `DisableXmtUpSampling` (1 bit) value = (data >> 8) & 1 subtree:add(f_disable_xmt_up_sampling, value) -- Parse `Reserve_1` (23 bits) value = (data >> 9) & 0x03ffffff subtree:add(f_reserve_1, value) offset = offset + 4 -- Parse `XmtSymbFreq` (16 bits) subtree:add(f_xmt_symb_freq, buffer(offset, 2):le_uint()) offset = offset + 2 -- Parse `RcvSymbFreq` (16 bits) subtree:add(f_rcv_symb_freq, buffer(offset, 2):le_uint()) offset = offset + 2 -- Parse `Reserve_3` (32 bits) subtree:add(f_reserve_3, buffer(offset, 4):le_uint()) offset = offset + 4 end