Browse Source

adcs_dissector updated

vishnuprasath 4 months ago
parent
commit
fa1fc8da4e
1 changed files with 51 additions and 36 deletions
  1. 51 36
      Dissector/adcs_dissector.lua

+ 51 - 36
Dissector/adcs_dissector.lua

@@ -157,9 +157,10 @@ function adcs_dissector_0(buffer, pinfo, tree, adcs_protocol, offset, num_of_ins
     fss_sram_current_field
     }
     
-    local subtree = tree:add(adcs_protocol, buffer(), "ADCS queue id 0")
+    
     
     for i = 0,  num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     -- Dissect status
      local status = buffer(offset, 1):le_uint()
     subtree:add(status_field, status)
@@ -213,9 +214,10 @@ function adcs_dissector_1(buffer, pinfo, tree, adcs_protocol, offset, num_of_ins
     f_5v_current,
     f_vbat_current  
     }
-    local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 1")
+    --local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 1")
     
     for i = 0,  num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     local operation_status = buffer(offset, 1):le_uint()
     subtree:add(f_operation_status, operation_status)
     offset = offset + 1
@@ -263,9 +265,10 @@ function adcs_dissector_2(buffer, pinfo, tree, adcs_protocol, offset, num_of_ins
     f_rw_current_2,
     f_rw_current_3
 }
-    local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 2")
+   -- local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 2")
     
     for i = 0,  num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     local operation_status = buffer(offset, 1):le_uint()
     subtree:add(f_operation_status, operation_status)
     offset = offset + 1
@@ -316,9 +319,10 @@ adcs_protocol.fields = {
     f_magnetorquer_current,
     f_cube_star_mcu_temp }
 
-    local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 3")
+   -- local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 3")
     
     for i = 0, num_of_instance - 1 do 
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -354,9 +358,10 @@ function adcs_dissector_4(buffer, pinfo, tree, adcs_protocol, offset, num_of_ins
 -- Add the fields to the protocol
 adcs_protocol.fields = { f_operation_status, f_epoch_time, f_mcu_temperature, f_magnetometer_temperature, f_redundant_magnetometer_temperature }
 
-    local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 4")
+   -- local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 4")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())  -- 1 bytes for Operation Status (UINT)
     offset = offset + 1
     
@@ -391,9 +396,10 @@ function adcs_dissector_5(buffer, pinfo, tree, adcs_protocol, offset, num_of_ins
 -- Add the fields to the protocol
 adcs_protocol.fields = { f_operation_status, f_epoch_time, f_raw_mag_x, f_raw_mag_y, f_raw_mag_z }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 5")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 5")
 
   for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
         -- Operation Status (1 bytes, unsigned)
         subtree:add(f_operation_status, buffer(offset, 1):le_uint())
         offset = offset + 1
@@ -553,9 +559,10 @@ adcs_protocol.fields = {
     f_rate_sensor_failure
 }
 
-  local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 6")
+  --local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 6")
   
   for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1
     subtree:add(f_epoch_time, buffer(offset, 4):le_uint())
@@ -719,9 +726,10 @@ local f_z_sun_vector = ProtoField.float("adcs_protocol.z_sun_vector", "Z Sun Vec
 -- Register fields to the protocol
 adcs_protocol.fields = { f_operation_status, f_epoch_time, f_x_sun_vector, f_y_sun_vector, f_z_sun_vector }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 7")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 7")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())  -- 1 byte for Operation Status
     offset = offset + 1  -- Update offset
 
@@ -779,9 +787,10 @@ adcs_protocol.fields = { f_operation_status,
     f_css_ad_value_10
  }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 8")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 8")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())  -- 1 byte for Operation Status
     offset = offset + 1  -- Update offset
 
@@ -825,9 +834,10 @@ adcs_protocol.fields = {
     f_operation_status, f_epoch_time,
     f_sun_x, f_sun_y, f_sun_z }
     
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 9")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 9")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
@@ -874,9 +884,10 @@ adcs_protocol.fields = {
     f_fss_detection_result
 }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 10")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 10")
     
     for i = 0, num_of_instance - 1 do
+local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -924,9 +935,10 @@ adcs_protocol.fields = {
     f_z_axis_nadir_vector
 }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 11")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 11")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -979,9 +991,10 @@ adcs_protocol.fields = {
     f_nadir_detection_result
 }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 12")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 12")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -1028,9 +1041,10 @@ adcs_protocol.fields = {
     f_magnetic_field_z
 }
 
-local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 13")
+--local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 13")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -1073,8 +1087,7 @@ function adcs_dissector_32(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     }
 for i = 1, num_of_instance do
     -- Add the operation data subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_32")
-
+    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
     -- dissect operation status (1 byte, UINT)
     local op_status = buffer(offset, 1):le_uint()
     subtree:add(f_op_status, op_status)
@@ -1133,7 +1146,7 @@ function adcs_dissector_31(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     }
 	for i = 1, num_of_instance do
     -- Add the operation data coordinates subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_31")
+    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
     -- dissect operation status (1 byte, UINT)
     local op_status = buffer(offset, 1):le_uint()
@@ -1183,7 +1196,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_30")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1233,7 +1246,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
    for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_22")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1287,7 +1300,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1,num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_29")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1339,7 +1352,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_28")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1392,7 +1405,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_27")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1444,7 +1457,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_14")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1497,7 +1510,7 @@ adcs_protocol.fields = {
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_26")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1593,7 +1606,7 @@ function adcs_dissector_20(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_20")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1746,7 +1759,7 @@ adcs_protocol.fields = {
 
 for i = 1,num_of_instance do
     -- Add the new structure data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_25")
+    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1793,7 +1806,7 @@ adcs_protocol.fields = {
 
 for i = 1,num_of_instance do
     -- Add the new structure data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_24")
+    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1842,7 +1855,7 @@ adcs_protocol.fields = {
 for i = 1, num_of_instance do
 
     -- Add the new structure data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_23")
+    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1888,7 +1901,7 @@ adcs_protocol.fields = {
 
 for i = 1, num_of_instance do
     -- Add the Fine Estimated Angular Rates data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_19")
+    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1936,7 +1949,7 @@ function adcs_dissector_12(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop to process multiple data3 (if needed, as per your structure)
     for i = 1, num_of_instance do
         -- Add the data structure as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_12")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1984,7 +1997,7 @@ function adcs_dissector_11(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop to process multiple data3 (if needed, as per your structure)
     for i = 1, num_of_instance do
         -- Add the data structure as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_11")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2026,9 +2039,11 @@ function adcs_dissector_21(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
 -- Add the fields to the protocol
 adcs_protocol.fields = { f_operation_status, f_epoch_time, f_mcu_temperature, f_magnetometer_temperature, f_redundant_magnetometer_temperature }
 
-    local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 21")
+    --local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 21")
     
     for i = 0, num_of_instance - 1 do
+	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())  -- 1 bytes for Operation Status (UINT)
     offset = offset + 1
     
@@ -2068,7 +2083,7 @@ function adcs_dissector_18(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_18")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2116,7 +2131,7 @@ function adcs_dissector_17(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_17")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2161,7 +2176,7 @@ function adcs_dissector_16(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_16")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2210,7 +2225,7 @@ function adcs_dissector_15(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "adcs_qid_15")
+        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()