12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- -- Define the dissector function for the new structure
- function tm_get_adcs_est_rate(buffer, pinfo, tree, adcs_est_angular_rate, offset)
- -- Define ProtoFields for the new structure fields
- local f_x_angular_rate = ProtoField.double("adcs_est_angular_rate.f_x_angular_rate", "X Angular Rate", base.DEC)
- local f_y_angular_rate = ProtoField.double("adcs_est_angular_rate.f_y_angular_rate", "Y Angular Rate", base.DEC)
- local f_z_angular_rate = ProtoField.double("adcs_est_angular_rate.f_z_angular_rate", "Z Angular Rate", base.DEC)
- -- Add the fields to the protocol
- adcs_est_angular_rate.fields = {
- f_x_angular_rate, f_y_angular_rate, f_z_angular_rate
- }
- local subtree = tree:add(adcs_est_angular_rate, buffer(), "ADCS ESTIMATED ANGULAR RATES")
-
- 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))
- offset = offset + 8
- -- dissect commanded pitch angle (2 bytes)
- local y_angular_rate = buffer(offset, 8):le_float()
- subtree:add(f_y_angular_rate, y_angular_rate):set_text(string.format("Rate Sensor Y : %0.6f", y_angular_rate))
- offset = offset + 8
- -- dissect commanded yaw angle (2 bytes)
- 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
|