Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mavgen WLua: Updates to displayed field values in Wireshark #896

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

shancock884
Copy link
Contributor

As a follow up to #856, this PR proposes some updates to the decoding and displaying of Mavlink fields in Wireshark:

- Convert some units into more readable values (appended to the original, so raw value is still shown), e.g.:

lon (int32_t) [degE7]: -25922213 (-2.5922213 deg)

More converted units can be added, by adding to the unit_decoder_mapping lookup table.

- Show value of bitmask fields in HEX_DEC format, and pad bitfields to a multiple of 4 to match hex, e.g.:

flags (EKF_STATUS_FLAGS): 0x033f (831)
  .... .... ...1 = EKF_ATTITUDE: True
... (etc) ...
  .0.. .... .... = EKF_UNINITIALIZED: False

- Append local date/time to μs fields if it represents a unix time, or display time in seconds, unless < 1s, e.g.:

time_unix_usec (uint64_t) [us]: 1694287362375871 (2023-09-09 20:22:42.375871 BST)
time_usec (uint32_t) [us]: 937785569 (937.785569 s)

- In header, show system id as DEC, and MAV_COMPONENT as enum, e.g.:

System id: 1
Component id: MAV_COMP_ID_AUTOPILOT1 (1)

- Decode command parameters on MISSION_ITEM messages, e.g.:

param1: Land Options (NAV_VTOL_LAND_OPTIONS): NAV_VTOL_LAND_OPTIONS_DEFAULT (0)
param2 (float): 0
param3: Approach Altitude (float) m: 0
param4: Yaw (float) deg: 0
x: Latitude (int32_t): 514775152
y: Longitude (int32_t): -25939161
z: Ground Altitude (float) m: 0

Previously this was only done for COMMAND_LONG/INT messages, but not for MISSION_ITEM(_INT) messages.

- Added 2 new automated test cases to demonstrate/check the unit decoding and MISSION_ITEM_INT fields.

Use lookup table to convert degE7, rad, rad/s units for display
Values are appended to display - raw value is not overwritten

Show value of bitmask fields in HEX_DEC format
Even when no enum is linked (as for TERRAIN_REQUEST.mask)
Including for the compatibility flags in message header
Pad bitfields to a multiple of 4 to match hex

Append readable date/time to time_usec fields if it represents a unix time
Otherwise display time in seconds, unless its < 1s

In header, show system id as DEC, and MAV_COMPONENT as enum

Decode command parameters on MISSION_ITEM messages

Correct field name and datatype for x,y,z on MISSION and COMMAND INT messages

Add test cases to show unit decoding and MISSION_ITEM_INT fields

Fix spurious ENUM_END lines showing up in the disection
@peterbarker peterbarker merged commit 6e81a59 into ArduPilot:master Dec 27, 2023
12 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

@shancock884 shancock884 deleted the wlua-show-decoded-values branch December 28, 2023 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants