Browse Source

changes in all module dissector and adding pcap for FTM

priyadharsan 3 months ago
parent
commit
7050a1af9e

+ 110 - 91
Dissector/adcs_dissector.lua

@@ -157,10 +157,10 @@ function adcs_dissector_0(buffer, pinfo, tree, adcs_protocol, offset, num_of_ins
     fss_sram_current_field
     }
     
-    
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0,  num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     -- Dissect status
      local status = buffer(offset, 1):le_uint()
     subtree:add(status_field, status)
@@ -214,10 +214,11 @@ 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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     for i = 0,  num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     local operation_status = buffer(offset, 1):le_uint()
     subtree:add(f_operation_status, operation_status)
     offset = offset + 1
@@ -265,10 +266,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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+  
     for i = 0,  num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     local operation_status = buffer(offset, 1):le_uint()
     subtree:add(f_operation_status, operation_status)
     offset = offset + 1
@@ -319,10 +320,10 @@ adcs_protocol.fields = {
     f_magnetorquer_current,
     f_cube_star_mcu_temp }
 
-   -- local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 3")
+   local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do 
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -358,10 +359,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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1: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
     
@@ -396,10 +397,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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
   for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
         -- Operation Status (1 bytes, unsigned)
         subtree:add(f_operation_status, buffer(offset, 1):le_uint())
         offset = offset + 1
@@ -559,10 +560,11 @@ adcs_protocol.fields = {
     f_rate_sensor_failure
 }
 
-  --local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 6")
+  local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
   
   for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1: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())
@@ -726,10 +728,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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1: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
 
@@ -787,10 +789,10 @@ adcs_protocol.fields = { f_operation_status,
     f_css_ad_value_10
  }
 
---local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 8")
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1: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
 
@@ -834,10 +836,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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
@@ -884,10 +886,10 @@ adcs_protocol.fields = {
     f_fss_detection_result
 }
 
---local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 10")
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -935,10 +937,10 @@ adcs_protocol.fields = {
     f_z_axis_nadir_vector
 }
 
---local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 11")
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -991,10 +993,10 @@ adcs_protocol.fields = {
     f_nadir_detection_result
 }
 
---local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 12")
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -1041,10 +1043,10 @@ adcs_protocol.fields = {
     f_magnetic_field_z
 }
 
---local subtree = tree:add(adcs_protocol, buffer(),"ADCS queue id 13")
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
     subtree:add(f_operation_status, buffer(offset, 1):le_uint())
     offset = offset + 1  -- Update offset
 
@@ -1085,9 +1087,10 @@ function adcs_dissector_32(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     adcs_protocol.fields = {
         f_op_status, f_epoch_time, f_eci_x_velocity, f_eci_y_velocity, f_eci_z_velocity
     }
-for i = 1, num_of_instance do
+    local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+for i = 0, num_of_instance - 1 do
     -- Add the operation data subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+    local subtree = subtree1: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)
@@ -1114,23 +1117,6 @@ for i = 1, num_of_instance do
     offset = offset + 2
 end
 end
---------------------------------------------------------------------------------------------------------------------------------------
-
-
--- Define the dissector function for the Nadir Sensor Data
-
-
-
-
-
--------------------------------------------------------------------------------------------------------------------------
-
-
-
----------------------------------------------------------------------------------------------
-
-
---
 ----------------------------------------------------------------------------------------------------------------
 function adcs_dissector_31(buffer, pinfo, tree, adcs_protocol, offset, num_of_instance)
     -- Define ProtoFields for each field in the structure
@@ -1144,9 +1130,12 @@ function adcs_dissector_31(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     adcs_protocol.fields = {
         f_op_status, f_epoch_time, f_eci_x_coord, f_eci_y_coord, f_eci_z_coord
     }
-	for i = 1, num_of_instance do
+    
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
+	for i = 0, num_of_instance - 1 do
     -- Add the operation data coordinates subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+    local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
     -- dissect operation status (1 byte, UINT)
     local op_status = buffer(offset, 1):le_uint()
@@ -1193,10 +1182,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_x_coord, f_y_coord, f_z_coord
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1226,7 +1217,6 @@ adcs_protocol.fields = {
 end
 ----------------------------------------------------------------------------------------------------------------------------------
 
--- wrong number 29
 
 -- Define the dissector function for the new structure
 function adcs_dissector_22(buffer, pinfo, tree, adcs_protocol, offset, num_of_instance)
@@ -1243,10 +1233,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_roll_angle, f_pitch_angle, f_yaw_angle
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-   for i = 1, num_of_instance do
+   for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1297,10 +1289,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_innovation_x, f_innovation_y, f_innovation_z
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1,num_of_instance do
+    for i = 0,num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1349,10 +1343,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_x_gyro_bias, f_y_gyro_bias, f_z_gyro_bias
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1401,11 +1397,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_q1_error, f_q2_error, f_q3_error
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1454,10 +1451,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_x_magnetic_field, f_y_magnetic_field, f_z_magnetic_field
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1506,11 +1505,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_geo_longitude, f_geo_latitude, f_geo_altitude
 }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1602,11 +1602,13 @@ function adcs_dissector_20(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
         f_est_attitude_q1, f_est_attitude_q2, f_est_attitude_q3, 
         f_catalogue_number, f_x_centroid, f_y_centroid, f_sample_period
     }
+    
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
     -- Loop through the data (data3 could represent the number of iterations or packets to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1756,10 +1758,11 @@ local f_z_magnetorquer_time = ProtoField.int16("MagnetorquerData.z_magnetorquer_
 adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_x_magnetorquer_time, f_y_magnetorquer_time, f_z_magnetorquer_time
 }
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
-for i = 1,num_of_instance do
+for i = 0,num_of_instance - 1 do
     -- Add the new structure data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+    local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1803,10 +1806,11 @@ local f_wheel_speed = ProtoField.uint16("ReactionWheelData.wheel_speed_", "Measu
 adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_num_reaction_wheels, f_wheel_speed
 }
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
-for i = 1,num_of_instance do
+for i = 0,num_of_instance - 1 do
     -- Add the new structure data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+    local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1852,10 +1856,12 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_num_reaction_wheels,f_wheel_speed_cmd
 }
 
-for i = 1, num_of_instance do
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
+for i = 0, num_of_instance - 1 do
 
     -- Add the new structure data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+    local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1880,7 +1886,6 @@ for i = 1, num_of_instance do
     end
 end
 end
------------------------------------------------------------------------------------------------------------------
 
 --------------------------------------------------------------------------------------------------------
 --2.2.1.2.15	ADCS_HM_FINE_EST_ANG_RATES 14-19
@@ -1899,9 +1904,11 @@ adcs_protocol.fields = {
     f_op_status, f_epoch_time, f_x_angular_rate, f_y_angular_rate, f_z_angular_rate
 }
 
-for i = 1, num_of_instance do
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
+for i = 0, num_of_instance - 1 do
     -- Add the Fine Estimated Angular Rates data as a subtree
-    local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+    local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
     -- dissect operation status (1 byte)
     local op_status = buffer(offset, 1):le_uint()
@@ -1945,11 +1952,13 @@ function adcs_dissector_12(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     adcs_protocol.fields = {
         f_op_status, f_epoch_time, f_x_rate_temp, f_y_rate_temp, f_z_rate_temp
     }
+    
+    local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
     -- Loop to process multiple data3 (if needed, as per your structure)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the data structure as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -1994,10 +2003,12 @@ function adcs_dissector_11(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
         f_op_status, f_epoch_time, f_mcu_temp, f_mag_temp, f_red_mag_temp
     }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop to process multiple data3 (if needed, as per your structure)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the data structure as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2039,10 +2050,10 @@ 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 subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
     
     for i = 0, num_of_instance - 1 do
-	local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+	local subtree = subtree1: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
@@ -2080,10 +2091,12 @@ function adcs_dissector_18(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
         f_op_status, f_epoch_time, f_est_rate_x, f_est_rate_y, f_est_rate_z
     }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2127,11 +2140,13 @@ function adcs_dissector_17(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
     adcs_protocol.fields = {
         f_op_status, f_epoch_time, f_raw_rate_x, f_raw_rate_y, f_raw_rate_z
     }
+    
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
 
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2173,10 +2188,12 @@ function adcs_dissector_16(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
         f_op_status, f_epoch_time, f_measured_rate_x, f_measured_rate_y, f_measured_rate_z
     }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()
@@ -2222,10 +2239,12 @@ function adcs_dissector_15(buffer, pinfo, tree, adcs_protocol, offset, num_of_in
         f_op_status, f_epoch_time, f_raw_mag_x, f_raw_mag_y, f_raw_mag_z
     }
 
+local subtree1 = tree:add(adcs_protocol, buffer(), "ADCS")
+
     -- Loop through the data (num_of_instance represents the number of instances to dissect)
-    for i = 1, num_of_instance do
+    for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
-        local subtree = tree:add(adcs_protocol, buffer(), "INSTANCE" ..i)
+        local subtree = subtree1:add(adcs_protocol, buffer(), "INSTANCE " ..i)
 
         -- dissect operation status (1 byte)
         local op_status = buffer(offset, 1):le_uint()

+ 2 - 3
Dissector/bcon.lua

@@ -61,14 +61,13 @@ BCON_PROTOCOL.fields = {
     f_rx_freq, f_symb_freq, f_mod, f_roll_off, f_rand_enb, f_cc_enb, f_ors_enb, 
     f_crc_enb, f_dc_filter_enb, f_manchester_coding_en
 }
-local subtree = tree:add(BCON_PROTOCOL, buffer(), "bcon")
+local subtree = tree:add(BCON_PROTOCOL, buffer(), "BEACON")
 
 -- dissect bcon_msg
---for i=1,18 do
+
 local bcon_msg = buffer(offset, 18):string()
 subtree:add(f_bcon_msg, bcon_msg)
 offset = offset + 18
---end
 
 
 -- dissect utc_tim

+ 25 - 38
Dissector/eps_dissector.lua

@@ -38,122 +38,124 @@ HM_TM_dissector.fields = { f_tim ,f_pv_cnt, f_mppt_cnt, f_op_conv_cnt, f_btry_cn
     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
+local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "EPS")
+
+for i = 0,data3 - 1 do
 
      --offset = offset+8
-    local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "Power System Data")
+    local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "Instance "..i)
 	
-    subtree:add(f_tim,buffer(offset,4):le_uint())
+    subtree1: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)
+    subtree1:add(f_pv_cnt, pv_cnt)
     offset = offset + 1
 
     -- dissect mppt_cnt
     local mppt_cnt = buffer(offset, 1):le_uint()
-    subtree:add(f_mppt_cnt, mppt_cnt)
+    subtree1:add(f_mppt_cnt, mppt_cnt)
     offset = offset + 1
 
     -- dissect op_conv_cnt
     local op_conv_cnt = buffer(offset, 1):le_uint()
-    subtree:add(f_op_conv_cnt, op_conv_cnt)
+    subtree1:add(f_op_conv_cnt, op_conv_cnt)
     offset = offset + 1
 
     -- dissect btry_cnt
     local btry_cnt = buffer(offset, 1):le_uint()
-    subtree:add(f_btry_cnt, btry_cnt)
+    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()
-    subtree:add(f_btry_temp_sns_cnt, btry_temp_sns_cnt)
+    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()
-    subtree:add(f_chnl_cnt, chnl_cnt)
+    subtree1:add(f_chnl_cnt, chnl_cnt)
     offset = offset + 1
 
     -- dissect volt_rail_cnt
     local volt_rail_cnt = buffer(offset, 1):le_uint()
-    subtree:add(f_volt_rail_cnt, volt_rail_cnt)
+    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("<d", buffer(offset, 2):le_uint())
         local pv_volt = buffer(offset, 2):le_uint()
-        subtree:add(f_pv_volt_rd, pv_volt)
+        subtree1:add(f_pv_volt_rd, pv_volt)
         offset = offset + 2
 end
 for i=1, pv_cnt do 
 -- dissect pv_cur_rd 
         local pv_cur = buffer(offset, 2):le_uint()
-        subtree:add(f_pv_cur_rd, pv_cur)
+        subtree1:add(f_pv_cur_rd, pv_cur)
         offset = offset + 2
 end
 
 --for i=1, mppt_cnt do 
  -- dissect mppt_volt_rd 
         local mppt_volt = buffer(offset, 2):le_uint()
-        subtree:add(f_mppt_volt_rd, mppt_volt)
+        subtree1:add(f_mppt_volt_rd, mppt_volt)
         offset = offset + 2
 --end
 --for i=1, mppt_cnt do 
 -- dissect mppt_cur_rd 
         local mppt_cur = buffer(offset, 2):le_uint()
-        subtree:add(f_mppt_cur_rd, mppt_cur)
+        subtree1:add(f_mppt_cur_rd, mppt_cur)
         offset = offset + 2
 --end
 
 for i=1 ,op_conv_cnt do 
 -- dissect op_conv_volt_rd (array of uint16, loop through based on op_conv_cnt)
         local op_conv_volt = buffer(offset, 2):le_uint()
-        subtree:add(f_op_conv_volt_rd, op_conv_volt)
+        subtree1:add(f_op_conv_volt_rd, op_conv_volt)
         offset = offset + 2
 end
  -- dissect tot_btry_volt_rd
     	local tot_btry_volt_rd = buffer(offset, 2):le_uint()
-    	subtree:add(f_tot_btry_volt_rd, tot_btry_volt_rd)
+    	subtree1:add(f_tot_btry_volt_rd, tot_btry_volt_rd)
     	offset = offset + 2
 -- dissect tot_btry_cur_rd
     	local tot_btry_cur_rd = buffer(offset, 2):le_uint()
-    	subtree:add(f_tot_btry_cur_rd, tot_btry_cur_rd)
+    	subtree1:add(f_tot_btry_cur_rd, tot_btry_cur_rd)
     	offset = offset + 2
 for i=1, btry_temp_sns_cnt do
 -- dissect btry_temp_sns_rd (array of uint8, loop through based on btry_temp_sns_cnt)
         local btry_temp = buffer(offset, 1):le_uint()
-        subtree:add(f_btry_temp_sns_rd, btry_temp)
+        subtree1:add(f_btry_temp_sns_rd, btry_temp)
         offset = offset + 1
 end
 
 for i=1, chnl_cnt do
 -- dissect chnl_state (array of uint8, loop through based on chnl_cnt)  
         local chnl_state_value = buffer(offset, 1):le_uint()
-        subtree:add(f_chnl_state, chnl_state_value)
+        subtree1:add(f_chnl_state, chnl_state_value)
         offset = offset + 1
 end 
 for i=1, volt_rail_cnt do
 -- volt_rail_cur_value
         local volt_rail_value = buffer(offset, 2):le_uint()
-        subtree:add(f_volt_rail_cur_value, volt_rail_value)
+        subtree1:add(f_volt_rail_cur_value, volt_rail_value)
         offset = offset + 1
 end
 for i=1,volt_rail_cnt do
 -- dissect chnl_ovr_cur_flg (array of uint8, loop through based on chnl_cnt)
         local chnl_ovr_cur_flg_value = buffer(offset, 1):le_uint()
-        subtree:add(f_chnl_ovr_cur_flg, chnl_ovr_cur_flg_value)
+        subtree1:add(f_chnl_ovr_cur_flg, chnl_ovr_cur_flg_value)
         offset = offset + 1
 end
 
   -- dissect hrm_btry_mode_info
     local hrm_btry_mode_info = buffer(offset, 1):le_uint()
-    subtree:add(f_hrm_btry_mode_info, hrm_btry_mode_info)
+    subtree1: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())
+	subtree1:add(eps_hardware_data,buffer(offset,1):le_uint())
 	offset=offset+1
     end
 
@@ -162,18 +164,3 @@ end
 	
 
 end
-
-    
-
-    
-
-   
-
-    
-
-    
-
-    
- 
-
-    

+ 1 - 1
Dissector/ftci_dissector.lua

@@ -40,7 +40,7 @@ function ftci_dissector(buffer, pinfo, tree, FTCI_protocol, offset)
     -- Loop through the data instances
    -- for i = 1, num_of_instance do
         -- Add the new structure data as a subtree
-        local subtree = tree:add( FTCI_protocol, buffer(), "File Transfer Protocol")
+        local subtree = tree:add( FTCI_protocol, buffer(), "FTCI")
 
         -- dissect CONTROL FIELD 1 (1 byte)
 	local w=0

+ 1 - 1
Dissector/ftds_dissector.lua

@@ -21,7 +21,7 @@ ftds_protocol.fields = {
     f_data_bytes
 }
 
-local subtree = tree:add(ftds_protocol, buffer(),"FTDS_PROTOCOL")
+local subtree = tree:add(ftds_protocol, buffer(),"FTDS")
 
 local control_field = buffer(offset, 1):le_uint()
     subtree:add(f_control_field, control_field)

+ 1 - 1
Dissector/ftfci_dissector.lua

@@ -25,7 +25,7 @@ function ftfci_dissector(buffer, pinfo, tree, FTFCI_protocol, offset)
     }
 
     -- Add the new structure data as a subtree
-    local subtree = tree:add(FTFCI_protocol, buffer(), "File Transfer Control Information (FTFCI)")
+    local subtree = tree:add(FTFCI_protocol, buffer(), "FTFCI")
 
     -- dissect CONTROL FIELD 1 (1 byte)
     local control_field1 = buffer(offset, 1):le_uint()

+ 1 - 1
Dissector/ftsr_dissector.lua

@@ -12,7 +12,7 @@ local f_missing_segment_seq = ProtoField.bytes("ftsr_protocol.missing_segment_se
 -- Add the fields to the protocol
 ftsr_protocol.fields = { f_session_id, f_status_code, f_reserved, f_missing_count, f_suspend_timeout_or_sct_db, f_missing_segment_seq }
 
-    local subtree = tree:add(ftsr_protocol, buffer(), "FTSR_PROTOCOL")
+    local subtree = tree:add(ftsr_protocol, buffer(), "FTSR")
 
     -- Parse the CONTROL FIELD (1 byte)
     local control_field = buffer(offset, 1):le_uint()

+ 7 - 7
Dissector/hm_dissector.lua

@@ -70,25 +70,25 @@ TC_TM_PROTOCOL.fields = { f_sub_mod_id, f_Queue_id, f_num_of_instance, f_Health_
      len = len - 4
      if submodule_id == 0  then
      	require("eps_dissector")
-      	dissect_power_system_data(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, tm_len, num_of_instance)
+      	dissect_power_system_data(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, tm_len, num_of_instance)
      elseif submodule_id == 1  then
      	require("adcs_dissector")
-      	adcs_dissector(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, num_of_instance, queue_id)
+      	adcs_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, num_of_instance, queue_id)
      elseif submodule_id == 3  then
         require("uhf_dissector")
-        UHF_DISSECTOR(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, tm_len, num_of_instance)
+        UHF_DISSECTOR(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, tm_len, num_of_instance)
      elseif submodule_id == 4 then
          require("sensor_dissector")
-         sensor_dissector(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, num_of_instance, queue_id)
+         sensor_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, num_of_instance, queue_id)
      elseif submodule_id == 5 then
         require("obc_dissector")
-        obc_dissector(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, num_of_instance)     
+        obc_dissector(buffer, pinfo, subtree, 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)
+       sband_dissectors(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, num_of_instance)
      elseif submodule_id == 6 then 
        require("error_handler_dissector")
-       error_handler_dissector(buffer, pinfo, subtree1, TC_TM_PROTOCOL, offset, num_of_instance)
+       error_handler_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, num_of_instance)
      else
        
          for i = 0, len - 1 do

+ 5 - 2
Dissector/obc_dissector.lua

@@ -1,4 +1,4 @@
-function obc_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset, instance)
+function obc_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, offset, instance)
   
   local f_timestamp1 = ProtoField.uint64("TC_TM_PROTOCOL.timestamp1", "Timestamp", base.DEC)
   local f_fsm_state = ProtoField.uint8("TC_TM_PROTOCOL.fsm_state", "Fsm State", base.DEC)
@@ -18,8 +18,11 @@ TC_TM_PROTOCOL.fields = {
     f_timestamp1, f_fsm_state, f_num_resets,f_io_error, f_sys_error, f_cpu_until, f_iram_rem_heap,
     f_eram_rem_heap, f_uptime, f_reset_cause, f_task_count, f_ipc_fail_cntr
 }
+
+local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "OBC")
+
 for i=0, instance-1 do
-  local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "HEALTH METRIC DATA OBC")
+  local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "Instance "..i)
    -- dissect timestamp 
    local data1
      --for i=0, 8 do

+ 37 - 36
Dissector/sband_dissector.lua

@@ -45,61 +45,62 @@ function sband_dissectors(buffer, pinfo, tree, TC_TM_PROTOCOL, offset, instance)
     }
 
 
+  local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "SBAND")
 
 
     -- Now the loop for iterating over instances
     for i = 0, instance - 1 do
-        local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "HEALTH METRIC DATA SBAND")
+        local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "Instance " ..i)
 
         -- Offset for the different structs in s_sband_periodic_tm
         
         -- Dissect the s_sband_cmn_tm structure
-        subtree:add(f_timestamp2, buffer(offset, 8):le_uint64())
+        subtree1:add(f_timestamp2, buffer(offset, 8):le_uint64())
         offset = offset + 8 
-        subtree:add(f_temp_mcu, buffer(offset, 4):le_uint())  -- 4 bytes for int32
+        subtree1:add(f_temp_mcu, buffer(offset, 4):le_uint())  -- 4 bytes for int32
         offset = offset + 4
-        subtree:add(f_temp_fpga, buffer(offset, 4):le_uint()) -- 4 bytes for int32
+        subtree1:add(f_temp_fpga, buffer(offset, 4):le_uint()) -- 4 bytes for int32
         offset = offset + 4
-        subtree:add(f_temp_xcvr, buffer(offset, 4):le_uint()) -- 4 bytes for int32
+        subtree1:add(f_temp_xcvr, buffer(offset, 4):le_uint()) -- 4 bytes for int32
         offset = offset + 4
         
         local data = buffer(offset, 4):le_uint()  -- First 4 bytes for z_vel
         local data1 = buffer(offset + 4, 4):le_uint() -- Next 4 bytes for z_vel
         local data3 = string.unpack("d", string.pack("<II", data1, data))
-        subtree:add(f_volt_vint, data3 )
+        subtree1:add(f_volt_vint, data3 )
         offset = offset + 8
        
         data = buffer(offset, 4):le_uint()  -- First 4 bytes for z_vel
         data1 = buffer(offset + 4, 4):le_uint() -- Next 4 bytes for z_vel
         data3 = string.unpack("d", string.pack("<II", data1, data))
-        subtree:add(f_volt_vaux, data3 )
+        subtree1:add(f_volt_vaux, data3 )
         offset = offset + 8
         
         
         data = buffer(offset, 4):le_uint()  -- First 4 bytes for z_vel
         data1 = buffer(offset + 4, 4):le_uint() -- Next 4 bytes for z_vel
         data3 = string.unpack("d", string.pack("<II", data1, data))
-        subtree:add(f_volt_vbram, data3 )
+        subtree1:add(f_volt_vbram, data3 )
         offset = offset + 8
         
         
         data = buffer(offset, 4):le_uint()  -- First 4 bytes for z_vel
         data1 = buffer(offset + 4, 4):le_uint() -- Next 4 bytes for z_vel
         data3 = string.unpack("d", string.pack("<II", data1, data))
-        subtree:add(f_volt_vpint, data3 )
+        subtree1:add(f_volt_vpint, data3 )
         offset = offset + 8
         
         data = buffer(offset, 4):le_uint()  -- First 4 bytes for z_vel
         data1 = buffer(offset + 4, 4):le_uint() -- Next 4 bytes for z_vel
         data3 = string.unpack("d", string.pack("<II", data1, data))
-        subtree:add(f_volt_vpaux, data3 )
+        subtree1:add(f_volt_vpaux, data3 )
         offset = offset + 8
         
         
         data = buffer(offset, 4):le_uint()  -- First 4 bytes for z_vel
         data1 = buffer(offset + 4, 4):le_uint() -- Next 4 bytes for z_vel
         data3 = string.unpack("d", string.pack("<II", data1, data))
-        subtree:add(f_volt_vpdro, data3 )
+        subtree1:add(f_volt_vpdro, data3 )
         offset = offset + 8
        
 
@@ -107,59 +108,59 @@ function sband_dissectors(buffer, pinfo, tree, TC_TM_PROTOCOL, offset, instance)
         -- Handle the RX structure
         print("Recv chnl : 1")
 
-        subtree:add(f_rx_cfg_frames, buffer(offset, 4):le_uint())  -- 4 bytes for uint32
+        subtree1:add(f_rx_cfg_frames, buffer(offset, 4):le_uint())  -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_cfg_detected, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_cfg_detected, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_cfg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
+        subtree1:add(f_rx_cfg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
         offset = offset + 4
-        subtree:add(f_rx_avg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
+        subtree1:add(f_rx_avg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
         offset = offset + 4
-        subtree:add(f_rx_cfg_freqerr, buffer(offset, 4):le_uint()) -- 4 bytes for int32
+        subtree1:add(f_rx_cfg_freqerr, buffer(offset, 4):le_uint()) -- 4 bytes for int32
         offset = offset + 4
-        subtree:add(f_rx_cfg_carrier_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_cfg_carrier_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_frame_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_frame_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_sir_min, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_sir_min, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_sir_max, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_sir_max, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_bch_block_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_bch_block_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_bch_err_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_bch_err_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
         
-        --subtree:add(f_recv_chnl,2)  -- 4 bytes for uint32
+        --subtree1:add(f_recv_chnl,2)  -- 4 bytes for uint32
         
         print("Recv chnl - 2")
-        subtree:add(f_rx_cfg_frames, buffer(offset, 4):le_uint())  -- 4 bytes for uint32
+        subtree1:add(f_rx_cfg_frames, buffer(offset, 4):le_uint())  -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_cfg_detected, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_cfg_detected, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_cfg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
+        subtree1:add(f_rx_cfg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
         offset = offset + 4
-        subtree:add(f_rx_avg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
+        subtree1:add(f_rx_avg_rssi, buffer(offset, 4):le_float())  -- 4 bytes for float (f32)
         offset = offset + 4
-        subtree:add(f_rx_cfg_freqerr, buffer(offset, 4):le_uint()) -- 4 bytes for int32
+        subtree1:add(f_rx_cfg_freqerr, buffer(offset, 4):le_uint()) -- 4 bytes for int32
         offset = offset + 4
-        subtree:add(f_rx_cfg_carrier_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_cfg_carrier_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_frame_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_frame_lock, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_sir_min, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_sir_min, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_sir_max, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_sir_max, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_bch_block_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_bch_block_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
-        subtree:add(f_rx_bch_err_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        subtree1:add(f_rx_bch_err_cnt, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         offset = offset + 4
 
         -- Dissect the s_sband_tx_tm structure
-        --subtree:add(f_tx_cfg_frames, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
+        --subtree1:add(f_tx_cfg_frames, buffer(offset, 4):le_uint()) -- 4 bytes for uint32
         --offset = offset + 4
-        --subtree:add(f_tx_cfg_pwr_rfl, buffer(offset, 4):le_float()) -- 4 bytes for float (f32)
+        --subtree1:add(f_tx_cfg_pwr_rfl, buffer(offset, 4):le_float()) -- 4 bytes for float (f32)
         --offset = offset + 4
         
         

+ 16 - 16
Dissector/sensor_dissector.lua

@@ -80,7 +80,7 @@ local f_epoch_time = ProtoField.uint32("psm.epoch_time", "Epoch Time")
 
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_vbus_voltage, f_vshunt_voltage, f_current, f_power, f_epoch_time }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 0 ")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     for i = 0,  num_of_instance - 1 do
     local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i)
     
@@ -115,7 +115,7 @@ local f_epoch_time = ProtoField.uint32("psm.epoch_time", "Epoch Time")
 
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_vbus_voltage, f_vshunt_voltage, f_current, f_power, f_epoch_time }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 1")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     for i = 0,  num_of_instance - 1 do
     local subtree1 = subtree:add(sensor_protocol, buffer(), "INSTANCE "..i)
     
@@ -147,7 +147,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 2")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -176,7 +176,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 3")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -205,7 +205,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 4")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -235,7 +235,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 5")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -264,7 +264,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 6")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -294,7 +294,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 7")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -323,7 +323,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 8")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -352,7 +352,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 9")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -383,7 +383,7 @@ local f_temp_epoch_time = ProtoField.uint32("sensor_protocol.temp_epoch_time", "
 -- Add the fields to the protocol
 sensor_protocol.fields = { f_temperature, f_temp_epoch_time }
 
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 10")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
      -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -413,7 +413,7 @@ function sensor_dissector_11(buffer, pinfo, tree, sensor_protocol, offset, num_o
     sensor_protocol.fields = { 
         f_voltage, f_current, f_adm_epoch_time
     }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 11")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -449,7 +449,7 @@ function sensor_dissector_12(buffer, pinfo, tree, sensor_protocol, offset, num_o
     sensor_protocol.fields = { 
         f_voltage, f_current, f_adm_epoch_time
     }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 12")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -483,7 +483,7 @@ function sensor_dissector_13(buffer, pinfo, tree, sensor_protocol, offset, num_o
     sensor_protocol.fields = { 
         f_voltage, f_current, f_adm_epoch_time
     }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 13")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -517,7 +517,7 @@ function sensor_dissector_14(buffer, pinfo, tree, sensor_protocol, offset, num_o
     sensor_protocol.fields = { 
         f_temperature, f_dt_epoch_time
     }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 14")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 0, num_of_instance - 1 do
         -- Add the new structure data as a subtree
@@ -545,7 +545,7 @@ function sensor_dissector_15(buffer, pinfo, tree, sensor_protocol, offset, num_o
     sensor_protocol.fields = { 
         f_temperature, f_dt_epoch_time
     }
-local subtree = tree:add(sensor_protocol, buffer(), "SENSOR QUEUE ID 15")
+local subtree = tree:add(sensor_protocol, buffer(), "SENSOR")
     -- Loop through the data (num_of_instance could represent the number of instances or packets to dissect)
     for i = 1, num_of_instance do
         -- Add the new structure data as a subtree

+ 19 - 15
Dissector/tc_tm_protocols.lua

@@ -187,8 +187,10 @@ function TC_dissector(buffer, pinfo, tree)
  
    local tc_id = buffer(offset, 1):le_uint() -- Read 1 byte for tc_id
    
-   if tc_id == 100 or tc_id == 105 or tc_id == 102 or tc_id == 103 then
-   pinfo.cols.protocol = "FTM"
+   if tc_id == 100 or tc_id == 102 or tc_id == 103 then
+   pinfo.cols.protocol = "FTM(UL)"
+   elseif tc_id == 105 then
+   pinfo.cols.protocol = "FTM(DL)"
    else
    pinfo.cols.protocol = "TELECOMMAND"
    end
@@ -240,23 +242,23 @@ end
           else
               if tc_id == 621 then
                  	require("hm_dissector")
-                	data = HM_TC_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset)
+                	data = HM_TC_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, offset)
                 	offset = offset + tc_len  
 		elseif tc_id == 100 then
                 	require("ftci_dissector")
-			ftci_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset)
+			ftci_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, offset)
                 	offset = offset + tc_len 
 		elseif tc_id == 103 then
                 	require("ftfci_dissector")
-			ftfci_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset)
+			ftfci_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, offset)
                 	offset = offset + tc_len 
 		elseif tc_id == 102 then
                  	require("ftds_dissector")
-                 	ftds_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset)
+                 	ftds_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, offset)
                  	offset = offset + tc_len
 		elseif tc_id == 105 then
                  	require("ftsr_dissector")
-          		ftsr_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, offset)
+          		ftsr_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, offset)
                  	offset = offset + tc_len
                  else
 	              for i=0,tc_len - 1 do
@@ -463,8 +465,10 @@ function TM_dissector(buffer, pinfo, tree)  -- OBC to GS
 
     tm_id = magic
     
-    if tm_id == 104 or tm_id == 101 or tm_id == 106 or tm_id == 107 then
-   pinfo.cols.protocol = "FTM"
+   if tm_id == 104 or tm_id == 106 or tm_id == 107 then
+   pinfo.cols.protocol = "FTM(DL)"
+   elseif tm_id == 101 then
+   pinfo.cols.protocol = "FTM(UL)"
    else
    pinfo.cols.protocol = "TELEMETRY"
    end
@@ -492,29 +496,29 @@ function TM_dissector(buffer, pinfo, tree)  -- OBC to GS
       if tm_id == 621 or  tm_id == 815 or  tm_id == 104 or  tm_id == 107 or  tm_id == 101 or  tm_id == 106 then
       			if tm_id == 621  then
       				require("hm_dissector")
-        			array = HM_TM_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, add, tm_len)
+        			array = HM_TM_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, add, tm_len)
         			add = add + tm_len
 
  			      elseif tm_id == 815  then
  				      require("bcon")
-        			bcon_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, add, tm_len)
+        			bcon_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, add, tm_len)
         			add = add + tm_len
 
 			       elseif tm_id == 104 then
                 			require("ftci_dissector")
-					ftci_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, add)
+					ftci_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, add)
                 			add = add + tm_len 
 			       elseif tm_id == 107 then
                 			require("ftfci_dissector")
-					ftfci_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, add)
+					ftfci_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, add)
                 			add = add + tm_len
 			        elseif tm_id == 101 then 
           				require("ftsr_dissector")
-          				ftsr_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, add)
+          				ftsr_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, add)
         				add = add + tm_len
 				   elseif tm_id == 106 then 
           				require("ftds_dissector")
-                 			ftds_dissector(buffer, pinfo, subtree, TC_TM_PROTOCOL, add)
+                 			ftds_dissector(buffer, pinfo, tree, TC_TM_PROTOCOL, add)
         				add = add + tm_len
 				end
 

+ 25 - 23
Dissector/uhf_dissector.lua

@@ -49,112 +49,114 @@ HM_TM_dissector.fields = {
     f_custom1
 }
 
+local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "UHF")
+
 -- For your dissection function (within a loop structure)
-for i=1, data3 do
+for i = 0, data3 - 1 do
     --offset = offset + 8
-    local subtree = tree:add(TC_TM_PROTOCOL, buffer(), "UHF")
+    local subtree1 = subtree:add(TC_TM_PROTOCOL, buffer(), "Instance "..i)
 	
     local a = buffer(offset, 1):le_uint()
-    subtree:add(f_cnt_hk_str, a)
+    subtree1:add(f_cnt_hk_str, a)
     offset = offset + 1
     
     local b = buffer(offset, 4):le_uint()
-    subtree:add(f_timestamp, b)
+    subtree1:add(f_timestamp, b)
     offset = offset + 4
     b = buffer(offset, 4):le_uint()
-    subtree:add(f_timestamp, b)
+    subtree1:add(f_timestamp, b)
     offset = offset + 4
 
     -- dissect uptime
     local uptime = buffer(offset, 4):le_uint()
-    subtree:add(f_uptime, uptime)
+    subtree1:add(f_uptime, uptime)
     offset = offset + 4
 
     -- dissect uarto_rx_count
     local uarto_rx_count = buffer(offset, 4):le_uint()
-    subtree:add(f_uarto_rx_count, uarto_rx_count)
+    subtree1:add(f_uarto_rx_count, uarto_rx_count)
     offset = offset + 4
 
     -- dissect uart1_rx_count
     local uart1_rx_count = buffer(offset, 4):le_uint()
-    subtree:add(f_uart1_rx_count, uart1_rx_count)
+    subtree1:add(f_uart1_rx_count, uart1_rx_count)
     offset = offset + 4
 
     -- dissect rx_mode
     local rx_mode = buffer(offset, 1):le_uint()
-    subtree:add(f_rx_mode, rx_mode)
+    subtree1:add(f_rx_mode, rx_mode)
     offset = offset + 1
 
     -- dissect tx_mode
     local tx_mode = buffer(offset, 1):le_uint()
-    subtree:add(f_tx_mode, tx_mode)
+    subtree1:add(f_tx_mode, tx_mode)
     offset = offset + 1
 
     -- dissect adc (array of int16, loop through based on 10 elements)
     for j = 1, 10 do
         local adc_value = buffer(offset, 2):le_int()
-        subtree:add(f_adc, adc_value)
+        subtree1:add(f_adc, adc_value)
         offset = offset + 2
     end
 
     -- dissect last_rssi
     local last_rssi = buffer(offset, 1):le_int()
-    subtree:add(f_last_rssi, last_rssi)
+    subtree1:add(f_last_rssi, last_rssi)
     offset = offset + 1
 
     -- dissect last_lqi
     local last_lqi = buffer(offset, 1):le_uint()
-    subtree:add(f_last_lqi, last_lqi)
+    subtree1:add(f_last_lqi, last_lqi)
     offset = offset + 1
 
     -- dissect last_freqest
     local last_freqest = buffer(offset, 1):le_int()
-    subtree:add(f_last_freqest, last_freqest)
+    subtree1:add(f_last_freqest, last_freqest)
     offset = offset + 1
 
     -- dissect Pkt_sent
     local pkt_sent = buffer(offset, 4):le_uint()
-    subtree:add(f_pkt_sent, pkt_sent)
+    subtree1:add(f_pkt_sent, pkt_sent)
     offset = offset + 4
 
     -- dissect cs_count
     local cs_count = buffer(offset, 4):le_uint()
-    subtree:add(f_cs_count, cs_count)
+    subtree1:add(f_cs_count, cs_count)
     offset = offset + 4
 
     -- dissect Pkt_good
     local pkt_good = buffer(offset, 4):le_uint()
-    subtree:add(f_pkt_good, pkt_good)
+    subtree1:add(f_pkt_good, pkt_good)
     offset = offset + 4
 
     -- dissect Pkt_rejected_checksum
     local pkt_rejected_checksum = buffer(offset, 4):le_uint()
-    subtree:add(f_pkt_rejected_checksum, pkt_rejected_checksum)
+    subtree1:add(f_pkt_rejected_checksum, pkt_rejected_checksum)
     offset = offset + 4
 
     -- dissect Pkt_rejected_reserved
     local pkt_rejected_reserved = buffer(offset, 4):le_uint()
-    subtree:add(f_pkt_rejected_reserved, pkt_rejected_reserved)
+    subtree1:add(f_pkt_rejected_reserved, pkt_rejected_reserved)
     offset = offset + 4
 
     -- dissect Pkt_rejected_other
     local pkt_rejected_other = buffer(offset, 4):le_uint()
-    subtree:add(f_pkt_rejected_other, pkt_rejected_other)
+    subtree1:add(f_pkt_rejected_other, pkt_rejected_other)
     offset = offset + 4
 
     -- dissect reserved0
     local reserved0 = buffer(offset, 4):le_uint()
-    subtree:add(f_reserved0, reserved0)
+    subtree1:add(f_reserved0, reserved0)
     offset = offset + 4
 
     -- dissect customo
     --local customo = buffer(offset, 4):le_uint()
-    --subtree:add(f_customo, customo)
+    --subtree1:add(f_customo, customo)
     --offset = offset + 4
 
     -- dissect custom1
     --local custom1 = buffer(offset, 4):le_uint()
-    --subtree:add(f_custom1, custom1)
+    --subtree1:add(f_custom1, custom1)
     --offset = offset + 4
 
     -- (continue for any other fields you want to dissect, e.g., reserved1 if needed)

+ 3 - 1
pcaps/Readme.txt

@@ -6,4 +6,6 @@
 # sband  -   6779
 # uhf    -   6779
 # obc    -   6779
-# beacon -   6779
+# beacon -   6779
+# ftsr_ul, ftci_ul, ftcci_ul, ftds_ul - 6779
+# ftsr_dl, ftci_dl, ftcci_dl, ftds_dl - 6779

BIN
pcaps/ftci_dl, ftsr_dl, ftcci_ul, ftds_ul.pcapng


BIN
pcaps/ftci_ul, ftsr_ul, ftcci_ul, ftds_ul.pcapng