--tm id - 398 function tm_get_comms_tm_info(buffer, pinfo, tree, comms_tm_prop, offset) -- Define ProtoFields for the structure local f_temp_psu = ProtoField.int16("comms_tm_prop.temp_psu", "Temperature PSU", base.DEC) local f_temp_mcu = ProtoField.int16("comms_tm_prop.temp_mcu", "Temperature MCU", base.DEC) local f_temp_fpga = ProtoField.int16("comms_tm_prop.temp_fpga", "Temperature FPGA", base.DEC) local f_temp_xcvr = ProtoField.int16("comms_tm_prop.temp_xcvr", "Temperature Transceiver", base.DEC) local f_temp_lna = ProtoField.int16("comms_tm_prop.temp_lna", "Temperature LNA", base.DEC) local f_temp_pa = ProtoField.int16("comms_tm_prop.temp_pa", "Temperature PA", base.DEC) local f_volt_vin = ProtoField.uint16("comms_tm_prop.volt_vin", "Voltage Input (Vin)", base.DEC) local f_volt_3v3 = ProtoField.uint16("comms_tm_prop.volt_3v3", "Voltage 3.3V Rail", base.DEC) local f_volt_1v8 = ProtoField.uint16("comms_tm_prop.volt_1v8", "Voltage 1.8V Rail", base.DEC) local f_volt_1v0 = ProtoField.uint16("comms_tm_prop.volt_1v0", "Voltage 1.0V Rail", base.DEC) local f_volt_pa = ProtoField.uint16("comms_tm_prop.volt_pa", "Voltage PA", base.DEC) local f_cur_vin = ProtoField.int16("comms_tm_prop.cur_vin", "Current Input (Vin)", base.DEC) local f_cur_3v3 = ProtoField.int16("comms_tm_prop.cur_3v3", "Current 3.3V Rail", base.DEC) local f_cur_1v8 = ProtoField.int16("comms_tm_prop.cur_1v8", "Current 1.8V Rail", base.DEC) local f_cur_1v0 = ProtoField.int16("comms_tm_prop.cur_1v0", "Current 1.0V Rail", base.DEC) local f_cur_pa = ProtoField.int16("comms_tm_prop.cur_pa", "Current PA", base.DEC) local f_power_vin = ProtoField.uint16("comms_tm_prop.power_vin", "Power Input (Vin)", base.DEC) local f_power_3v3 = ProtoField.uint16("comms_tm_prop.power_3v3", "Power 3.3V Rail", base.DEC) local f_power_1v8 = ProtoField.uint16("comms_tm_prop.power_1v8", "Power 1.8V Rail", base.DEC) local f_power_1v0 = ProtoField.uint16("comms_tm_prop.power_1v0", "Power 1.0V Rail", base.DEC) local f_power_pa = ProtoField.uint16("comms_tm_prop.power_pa", "Power PA", base.DEC) local f_rsvd = ProtoField.uint16("comms_tm_prop.rsvd", "Reserved", base.DEC) -- Add fields to the protocol comms_tm_prop.fields = { f_temp_psu, f_temp_mcu, f_temp_fpga, f_temp_xcvr, f_temp_lna, f_temp_pa, f_volt_vin, f_volt_3v3, f_volt_1v8, f_volt_1v0, f_volt_pa, f_cur_vin, f_cur_3v3, f_cur_1v8, f_cur_1v0, f_cur_pa, f_power_vin, f_power_3v3, f_power_1v8, f_power_1v0, f_power_pa, f_rsvd } -- Add a subtree for the structure local subtree = tree:add(comms_tm_prop, buffer(), "TM GET COMMS TM INFO") -- Dissect each field subtree:add_le(f_temp_psu, buffer(offset, 2)):set_text(string.format("Temperature PSU: %d °C", buffer(offset, 2):le_int())) offset = offset + 2 subtree:add_le(f_temp_mcu, buffer(offset, 2)):set_text(string.format("Temperature MCU: %d °C", buffer(offset, 2):le_int())) offset = offset + 2 subtree:add_le(f_temp_fpga, buffer(offset, 2)):set_text(string.format("Temperature FPGA: %d °C", buffer(offset, 2):le_int())) offset = offset + 2 subtree:add_le(f_temp_xcvr, buffer(offset, 2)):set_text(string.format("Temperature Transceiver: %d °C", buffer(offset, 2):le_int())) offset = offset + 2 subtree:add_le(f_temp_lna, buffer(offset, 2)):set_text(string.format("Temperature LNA: %d °C", buffer(offset, 2):le_int())) offset = offset + 2 subtree:add_le(f_temp_pa, buffer(offset, 2)):set_text(string.format("Temperature PA: %d °C", buffer(offset, 2):le_int())) offset = offset + 2 subtree:add_le(f_volt_vin, buffer(offset, 2)):set_text(string.format("Voltage Vint: %.6f V", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_volt_3v3, buffer(offset, 2)):set_text(string.format("Voltage vaux: %.6f V", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_volt_1v8, buffer(offset, 2)):set_text(string.format("Voltage vbram: %.6f V", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_volt_1v0, buffer(offset, 2)):set_text(string.format("Voltage vpint: %.6f V", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_volt_pa, buffer(offset, 2)):set_text(string.format("Voltage vpaux: %.6f V", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_cur_vin, buffer(offset, 2)):set_text(string.format("Current Vin: %.6f A", buffer(offset, 2):le_int() / 100)) offset = offset + 2 subtree:add_le(f_cur_3v3, buffer(offset, 2)):set_text(string.format("Current 3.3V: %.6f A", buffer(offset, 2):le_int() / 100)) offset = offset + 2 subtree:add_le(f_cur_1v8, buffer(offset, 2)):set_text(string.format("Current 1.8V: %.6f A", buffer(offset, 2):le_int() / 100)) offset = offset + 2 subtree:add_le(f_cur_1v0, buffer(offset, 2)):set_text(string.format("Current 1.0V: %.6f A", buffer(offset, 2):le_int() / 100)) offset = offset + 2 subtree:add_le(f_cur_pa, buffer(offset, 2)):set_text(string.format("Current PA: %.6f A", buffer(offset, 2):le_int() / 100)) offset = offset + 2 subtree:add_le(f_power_vin, buffer(offset, 2)):set_text(string.format("Power Vin: %.6f W", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_power_3v3, buffer(offset, 2)):set_text(string.format("Power 3.3V: %.6f W", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_power_1v8, buffer(offset, 2)):set_text(string.format("Power 1.8V: %.6f W", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_power_1v0, buffer(offset, 2)):set_text(string.format("Power 1.0V: %.6f W", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_power_pa, buffer(offset, 2)):set_text(string.format("Power PA: %.6f W", buffer(offset, 2):le_uint() / 100)) offset = offset + 2 subtree:add_le(f_rsvd, buffer(offset, 2)):set_text(string.format("Reserved : %.6f", buffer(offset, 2):le_uint() / 100) ) offset = offset + 2 end