Browse Source

HM_update

vishnuprasath 4 months ago
parent
commit
3280c4bffa
1 changed files with 20 additions and 21 deletions
  1. 20 21
      Dissector/hm_dissector.lua

+ 20 - 21
Dissector/hm_dissector.lua

@@ -48,42 +48,41 @@ local f_Health_Data = ProtoField.uint8("TC_TM_PROTOCOL.Health_Data", "Health Dat
 -- Add the fields to the protocol
 TC_TM_PROTOCOL.fields = { f_sub_mod_id, f_Queue_id, f_num_of_instance, f_Health_Data }
 
-local len1 = 0
    --local info_display
    local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "HEALTH_METRIC_DATA")
   
      --dissect submodule_id
-     local data1 = buffer(offset,1):le_uint()
-     subtree1:add(f_sub_mod_id , data1)
+     local submodule_id = buffer(offset,1):le_uint()
+     subtree1:add(f_sub_mod_id , submodule_id)
      offset = offset + 1
      
      --dissect queue_id
-     local data2 = buffer(offset,1):le_uint()
-     subtree1:add(f_Queue_id, data2)
+     local queue_id = buffer(offset,1):le_uint()
+     subtree1:add(f_Queue_id, queue_id)
      offset = offset + 1
      
      --dissect f_num_of_instance
-     local data3 = buffer(offset,2):le_uint()
-     subtree1:add(f_num_of_instance, data3)
+     local num_of_instance = buffer(offset,2):le_uint()
+     subtree1:add(f_num_of_instance, num_of_instance)
       offset = offset + 2  
       
      --dissect Health_Data
-     len =len - 3
-     if data1 == 5 then
-       require("obc_dissector")
-       
-        
-         obc_dissector(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, data3)
-
-     
-     elseif data1 == 2 then 
+     len = len - 4
+     if submodule_id == 0  then
+     	require("eps_dissector")
+      	dissect_power_system_data(buffer, pinfo, tree, TC_TM_PROTOCOL, offset, tm_len, num_of_instance)
+     elseif submodule_id == 3  then
+        require("uhf_dissector")
+      UHF_DISSECTOR(buffer, pinfo, tree, TC_TM_PROTOCOL, offset, tm_len, num_of_instance)
+     elseif submodule_id == 5 then
+        require("obc_dissector")
+        obc_dissector(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, num_of_instance)     
+     elseif submodule_id == 2 then 
        require("sband_dissector")
+       sband_dissectors(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, num_of_instance)
+     else
        
-       sband_dissectors(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, data3)
-     
-      else
-       
-         for i=0, len-1 do
+         for i = 0, len - 1 do
          local data4 = buffer(offset,1):le_uint()
          subtree1:add(f_Health_Data, data4)
          offset = offset + 1