-- frame formate is not clearly give ,code needs some changes -- Define the dissector function function dissect_power_system_data(buffer, pinfo, tree,HM_TM_dissector, offset, len,data3) -- Define ProtoFields for each field in the structure local f_tim = ProtoField.uint32("PowerSystemData.tim", "Time", base.DES) local f_pv_cnt = ProtoField.uint8("PowerSystemData.pv_cnt", "PV Count", base.DES) local f_mppt_cnt = ProtoField.uint8("PowerSystemData.mppt_cnt", "MPPT Count", base.DES) local f_op_conv_cnt = ProtoField.uint8("PowerSystemData.op_conv_cnt", "Operating Converter Count", base.DES) local f_btry_cnt = ProtoField.uint8("PowerSystemData.btry_cnt", "Battery Count", base.DES) local f_btry_temp_sns_cnt = ProtoField.uint8("PowerSystemData.btry_temp_sns_cnt", "Battery Temperature Sensor Count", base.DES) local f_chnl_cnt = ProtoField.uint8("PowerSystemData.chnl_cnt", "Channel Count", base.DES) local f_volt_rail_cnt = ProtoField.uint8("PowerSystemData.volt_rail_cnt", "Voltage Rail Count", base.DES) local f_tot_btry_volt_rd = ProtoField.uint16("PowerSystemData.tot_btry_volt_rd", "Total Battery Voltage", base.DES) local f_tot_btry_cur_rd = ProtoField.uint16("PowerSystemData.tot_btry_cur_rd", "Total Battery Current", base.DES) local f_hrm_btry_mode_info = ProtoField.uint8("PowerSystemData.hrm_btry_mode_info", "Harmonic Battery Mode Info", base.DES) -- Fields for arrays (treated as ProtoFields with array index) local f_pv_volt_rd = ProtoField.uint16("PowerSystemData.pv_volt_rd", "PV Voltage Reading", base.DES) local f_pv_cur_rd = ProtoField.uint16("PowerSystemData.pv_cur_rd", "PV Current Reading", base.DES) local f_mppt_volt_rd = ProtoField.uint16("PowerSystemData.mppt_volt_rd", "MPPT Voltage Reading", base.DES) local f_mppt_cur_rd = ProtoField.uint16("PowerSystemData.mppt_cur_rd", "MPPT Current Reading", base.DES) local f_op_conv_volt_rd = ProtoField.uint16("PowerSystemData.op_conv_volt_rd", "Operating Converter Voltage", base.DES) local f_btry_temp_sns_rd = ProtoField.uint8("PowerSystemData.btry_temp_sns_rd", "Battery Temperature Sensor Readings", base.DES) local f_chnl_state = ProtoField.uint8("PowerSystemData.chnl_state", "Channel State", base.DES) local f_volt_rail_cur_value = ProtoField.uint8("PowerSystemData.volt_rail_cur_value", "Voltage Rail Current Value", base.DES) local f_chnl_ovr_cur_flg = ProtoField.uint8("PowerSystemData.chnl_ovr_cur_flg", "Channel Over Current Flag", base.DES) local eps_hardware_data = ProtoField.uint8("PowerSystemData.eps", "eps_hardware_data", base.DES) -- Add the fields to the protocol HM_TM_dissector.fields = { f_tim ,f_pv_cnt, f_mppt_cnt, f_op_conv_cnt, f_btry_cnt, f_btry_temp_sns_cnt, f_chnl_cnt, f_volt_rail_cnt, f_tot_btry_volt_rd, f_tot_btry_cur_rd, f_hrm_btry_mode_info, f_pv_volt_rd, f_pv_cur_rd, f_mppt_volt_rd, f_mppt_cur_rd, f_op_conv_volt_rd, f_btry_temp_sns_rd, f_chnl_state, f_volt_rail_cur_value, f_chnl_ovr_cur_flg,eps_hardware_data } local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "EPS") for i = 0,data3 - 1 do --offset = offset+8 local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "Instance "..i) subtree1:add(f_tim,buffer(offset,4):le_uint()) offset = offset+8 -- dissect pv_cnt local pv_cnt = buffer(offset, 1):le_uint() subtree1:add(f_pv_cnt, pv_cnt) offset = offset + 1 -- dissect mppt_cnt local mppt_cnt = buffer(offset, 1):le_uint() subtree1:add(f_mppt_cnt, mppt_cnt) offset = offset + 1 -- dissect op_conv_cnt local op_conv_cnt = buffer(offset, 1):le_uint() subtree1:add(f_op_conv_cnt, op_conv_cnt) offset = offset + 1 -- dissect btry_cnt local btry_cnt = buffer(offset, 1):le_uint() subtree1:add(f_btry_cnt, btry_cnt) offset = offset + 1 -- dissect btry_temp_sns_cnt local btry_temp_sns_cnt = buffer(offset, 1):le_uint() subtree1:add(f_btry_temp_sns_cnt, btry_temp_sns_cnt) offset = offset + 1 -- dissect chnl_cnt local chnl_cnt = buffer(offset, 1):le_uint() subtree1:add(f_chnl_cnt, chnl_cnt) offset = offset + 1 -- dissect volt_rail_cnt local volt_rail_cnt = buffer(offset, 1):le_uint() subtree1:add(f_volt_rail_cnt, volt_rail_cnt) offset = offset + 1 ------------------------------------------------------------------------------------------------------------ for i=1, pv_cnt do -- dissect pv_volt_rd --local pv_volt = string.unpack("