Browse Source

eps_dissector updated

vishnuprasath 4 months ago
parent
commit
64cb074e2e
1 changed files with 15 additions and 5 deletions
  1. 15 5
      Dissector/eps_dissector.lua

+ 15 - 5
Dissector/eps_dissector.lua

@@ -8,6 +8,7 @@
 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)
@@ -29,19 +30,21 @@ local f_btry_temp_sns_rd = ProtoField.uint8("PowerSystemData.btry_temp_sns_rd",
 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_pv_cnt, f_mppt_cnt, f_op_conv_cnt, f_btry_cnt, f_btry_temp_sns_cnt, f_chnl_cnt,
+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 
+    f_btry_temp_sns_rd, f_chnl_state, f_volt_rail_cur_value, f_chnl_ovr_cur_flg,eps_hardware_data 
 }
 
 for i=1,data3 do
 
-     offset = offset+8
+     --offset = offset+8
     local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "Power System Data")
-
+	
+    subtree:add(f_tim,buffer(offset,4):le_uint())
+    offset = offset+8
     -- dissect pv_cnt
     local pv_cnt = buffer(offset, 1):le_uint()
     subtree:add(f_pv_cnt, pv_cnt)
@@ -148,6 +151,13 @@ end
     local hrm_btry_mode_info = buffer(offset, 1):le_uint()
     subtree:add(f_hrm_btry_mode_info, hrm_btry_mode_info)
     offset = offset + 1  
+
+    for i=1 ,36 do
+	subtree:add(eps_hardware_data,buffer(offset,1):le_uint())
+	offset=offset+1
+    end
+
+
 end