Browse Source

TO Add status condition for each TM

priyadharsan 2 months ago
parent
commit
37b0d22bc5

+ 23 - 2
Dissector/tm_adcs_get_est_attitude_angl.lua

@@ -15,8 +15,11 @@ adcs_estimated_angle.fields = {
 local subtree = tree:add(adcs_estimated_angle, buffer(), "ADCS ESTIMATED ANGLE")
 
         
-        offset = offset + 4
-
+         offset = offset + 3
+        local data = buffer(offset,1):le_int()
+        offset = offset + 1 
+    
+  if data == 0 then
         -- dissect commanded roll angle (2 bytes)
         local roll_angle = buffer(offset, 8):le_float()
         subtree:add(f_roll_angle, roll_angle):set_text(string.format("Roll Angle : %0.6f",roll_angle))
@@ -31,4 +34,22 @@ local subtree = tree:add(adcs_estimated_angle, buffer(), "ADCS ESTIMATED ANGLE")
         local yaw_angle = buffer(offset, 8):le_float()
         subtree:add(f_yaw_angle, yaw_angle):set_text(string.format("Yaw Angle : %0.6f",yaw_angle))
         offset = offset + 8
+        
+  elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 end

+ 28 - 4
Dissector/tm_adcs_state_cfg.lua

@@ -9,15 +9,39 @@ function tm_adcs_state_cfg(buffer, pinfo, tree, adcs_state_cfg, offset)
     -- Create the subtree for `auto_commissioning`
     local subtree = tree:add(adcs_state_cfg, buffer(), "TM GET ADCS STATE CFG")
     
-    offset = offset + 4
-
+     offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    
+    if data == 0 then
     -- Parse `Auto Commissioning Flag`
-    subtree:add(f_auto_comm_flag, buffer(offset, 1))
+    local value = buffer(offset, 1):le_uint()
+    if value == 0 then 
+    subtree:add(f_auto_comm_flag, value):set_text(string.format("Auto commissioning flag : True"))
+    else
+    subtree:add(f_auto_comm_flag, value):set_text(string.format("Auto commissioning flag : False"))
+    end
     offset = offset + 1
 
     -- Parse `FSM State`
     subtree:add(f_fsm_state, buffer(offset, 1))
     offset = offset + 1
 
-    return offset
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 end

+ 24 - 3
Dissector/tm_get_adcs_commanded_wheel_speed.lua

@@ -8,11 +8,15 @@ function tm_get_command_wheel_speed(buffer, pinfo, tree, command_wheel_speed, of
         f_num_wheels, f_wheel_speed
     }
 
+
     -- Add a subtree for the structure
     local subtree = tree:add(command_wheel_speed, buffer(), "Command Wheel Speed")
     
-    offset = offset + 4
-
+    offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    
+    if data == 0 then
     -- Dissect the number of reaction wheels (1 byte)
     local num_wheels = buffer(offset, 1):le_uint()
     subtree:add(f_num_wheels, num_wheels):set_text(string.format("Number of Reaction Wheels: %d", num_wheels))
@@ -25,5 +29,22 @@ function tm_get_command_wheel_speed(buffer, pinfo, tree, command_wheel_speed, of
         subtree:add(f_wheel_speed, wheel_speed):set_text(string.format("Commanded Wheel %d Speed : %d", i , wheel_speed))
         offset = offset + 2
     end
-
+    
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 end

+ 22 - 1
Dissector/tm_get_adcs_css_vector.lua

@@ -9,7 +9,11 @@ adcs_css.fields = { f_x_sun_vector, f_y_sun_vector, f_z_sun_vector }
 
 local subtree = tree:add(adcs_css, buffer(), "ADCS CSS VECTOR")
 
-    offset = offset + 4
+     offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    
+    if data == 0 then 
     -- X-axis Sun Vector  
     local x_sun_vector = buffer(offset, 4):le_float()  
     subtree:add(f_x_sun_vector, x_sun_vector):set_text(string.format(" X Sun Vector : %0.6f", x_sun_vector))  -- Add to subtree with scaling
@@ -25,4 +29,21 @@ local subtree = tree:add(adcs_css, buffer(), "ADCS CSS VECTOR")
     subtree:add(f_z_sun_vector, z_sun_vector):set_text(string.format(" Z Sun Vector : %0.6f", z_sun_vector))  -- Add to subtree with scaling
     offset = offset + 4  -- Update offset
     
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 end

+ 23 - 2
Dissector/tm_get_adcs_est_rate.lua

@@ -15,8 +15,11 @@ adcs_est_angular_rate.fields = {
 local subtree = tree:add(adcs_est_angular_rate, buffer(), "ADCS ESTIMATED ANGULAR RATES")
 
         
-        offset = offset + 4
-
+        offset = offset + 3
+        local data = buffer(offset,1):le_int()
+        offset = offset + 1 
+        
+  if data == 0 then 
         -- dissect commanded roll angle (2 bytes)
         local x_angular_rate = buffer(offset, 8):le_float()
         subtree:add(f_x_angular_rate, x_angular_rate):set_text(string.format("Rate Sensor X : %0.6f", x_angular_rate))
@@ -31,4 +34,22 @@ local subtree = tree:add(adcs_est_angular_rate, buffer(), "ADCS ESTIMATED ANGULA
         local z_angular_rate = buffer(offset, 8):le_float()
         subtree:add(f_z_angular_rate, z_angular_rate):set_text(string.format("Rate Sensor Z : %0.6f", z_angular_rate))
         offset = offset + 8
+        
+  elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 end

+ 22 - 1
Dissector/tm_get_adcs_fss_vector.lua

@@ -9,7 +9,10 @@ adcs_fss.fields = { fss_x_vector, fss_y_vector, fss_z_vector }
 
 local subtree = tree:add(adcs_fss, buffer(), "ADCS FSS VECTOR")
 
-    offset = offset + 4
+    offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    if data == 0 then
     -- X-axis Sun Vector  
     local x_vector = buffer(offset, 4):le_float()  
     subtree:add(fss_x_vector, x_vector):set_text(string.format(" FSS X Vector : %0.6f", x_vector))  -- Add to subtree with scaling
@@ -25,4 +28,22 @@ local subtree = tree:add(adcs_fss, buffer(), "ADCS FSS VECTOR")
     subtree:add(fss_z_vector, z_vector):set_text(string.format(" FSS Z Vector : %0.6f", z_vector))  -- Add to subtree with scaling
     offset = offset + 4  -- Update offset
     
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
+    
 end

+ 22 - 2
Dissector/tm_get_adcs_mag_field_vector.lua

@@ -13,8 +13,10 @@ adcs_magnetic_field.fields = {
 
 local subtree = tree:add(adcs_magnetic_field, buffer(), "ADCS MAGNETIC FIELD VECTOR")
     
-    offset = offset + 4
-	
+    offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    if data == 0 then
     -- X Axis Magnetic Field Vector (2 bytes, INT)
     local x_field = buffer(offset, 4):le_float()  -- Apply the scaling factor (RAWVAL * 0.01)
     subtree:add(f_magnetic_field_x, x_field):set_text(string.format("X Axis Magnetic Field Vector : %3.6f",x_field))
@@ -30,4 +32,22 @@ local subtree = tree:add(adcs_magnetic_field, buffer(), "ADCS MAGNETIC FIELD VEC
     subtree:add(f_magnetic_field_z, z_field):set_text(string.format("Z Axis Magnetic Field Vector : %3.6f",z_field))
     offset = offset + 4  -- Update offset
     
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
+    
 end

+ 22 - 2
Dissector/tm_get_adcs_rw_speed_measure.lua

@@ -11,8 +11,11 @@ function tm_get_adcs_rw_speed_measure(buffer, pinfo, tree, adcs_rw_speed_wheel,
     -- Add a subtree for the structure
     local subtree = tree:add(adcs_rw_speed_wheel, buffer(), "Reaction Wheel Speed Measure")
     
-    offset = offset + 4
-
+    offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    
+    if data == 0 then
     -- Dissect the number of reaction wheels (1 byte)
     local num_wheels = buffer(offset, 1):le_uint()
     subtree:add(f_num_wheels, num_wheels):set_text(string.format("Number of Reaction Wheels: %d", num_wheels))
@@ -25,5 +28,22 @@ function tm_get_adcs_rw_speed_measure(buffer, pinfo, tree, adcs_rw_speed_wheel,
         subtree:add(f_wheel_speed, wheel_speed):set_text(string.format("Measured Wheel %d Speed : %d", i , wheel_speed))
         offset = offset + 2
     end
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 
 end

+ 23 - 3
Dissector/tm_get_adcs_sensor_vector.lua

@@ -15,9 +15,12 @@ adcs_sensor_vector.fields = {
 local subtree = tree:add(adcs_sensor_vector, buffer(), "ADCS SENSOR VECTOR")
 
         
-        offset = offset + 4
-
-        -- dissect commanded roll angle (2 bytes)
+        offset = offset + 3
+        local data = buffer(offset,1):le_int()
+        offset = offset + 1 
+    
+    if data == 0 then
+       -- dissect commanded roll angle (2 bytes)
         local x_rate_measurement = buffer(offset, 8):le_float()
         subtree:add(f_x_rate_measurement, x_rate_measurement):set_text(string.format("Rate Sensor X : %0.6f", x_rate_measurement))
         offset = offset + 8
@@ -31,4 +34,21 @@ local subtree = tree:add(adcs_sensor_vector, buffer(), "ADCS SENSOR VECTOR")
         local z_rate_measurement = buffer(offset, 8):le_float()
         subtree:add(f_z_rate_measurement, z_rate_measurement):set_text(string.format("Rate Sensor Z : %0.6f", z_rate_measurement))
         offset = offset + 8
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 end

+ 24 - 6
Dissector/tm_get_adcs_state.lua

@@ -133,14 +133,14 @@ adcs_protocol.fields = {
     f_rate_sensor_failure
 }
 
-local subtree = tree:add(adcs_protocol, buffer(), "ADCS")
+local subtree = tree:add(adcs_protocol, buffer(), "TM GET ADCS CURRENT STATE")
   
  
-    --subtree:add(f_operation_status, buffer(offset, 1):le_uint())
-    --offset = offset + 1
-    --subtree:add(f_epoch_time, buffer(offset, 4):le_uint())
-    --offset = offset + 4
-
+    offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    
+    if data == 0 then
     -- Parse Attitude Estimation Mode (8 bits)
     subtree:add(f_attitude_estimation_mode, buffer(offset, 1):le_uint())
     offset = offset + 1
@@ -267,5 +267,23 @@ local data=buffer(offset, 1):le_uint()
     subtree:add(f_rate_sensor_failure, (data >> 1) & 0x01)  -- Rate Sensor Failure
 
     offset = offset + 1
+    
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
 
 end

+ 23 - 1
Dissector/tm_get_adcs_tle.lua

@@ -23,8 +23,12 @@ adcs_tle.fields = {
 
 local subtree = tree:add(adcs_tle, buffer(), "TM GET ADCS TLE")
 
-    offset = offset + 4
     
+    offset = offset + 3
+    local data = buffer(offset,1):le_int()
+    offset = offset + 1 
+    
+    if data == 0 then
     local data = buffer(offset,8):le_float()
     subtree:add(f_inclination, data):set_text(string.format("Inclination : %0.6f",data))
     offset = offset + 8
@@ -57,5 +61,23 @@ local subtree = tree:add(adcs_tle, buffer(), "TM GET ADCS TLE")
     subtree:add(f_epoch_time, data):set_text(string.format("Epoch time : %0.6f",data))
     offset = offset + 8
     
+    elseif data == -1 then
+    subtree:add(" ADCS operation failure ")
+    elseif data == -2 then
+    subtree:add(" TC TM error ")
+    elseif data == -3 then
+    subtree:add(" Interface error ")
+    elseif data == -4 then
+    subtree:add(" Id not support ")
+    elseif data == -5 then
+    subtree:add(" ADCS HW in invalid power state ")
+    elseif data == -6 then
+    subtree:add(" ADCS Semaphore take failure ")
+    elseif data == -6 then
+    subtree:add(" ADCS Operating Mode Mismatch error ")
+    elseif data == -6 then
+    subtree:add(" ADCS responded data is not in a valid range ")
+    end
+    
     
 end