ConfigHWIDs: decode MAVn_DEVID parameters to human-readable strings - #3762
Open
Greninja44 wants to merge 1 commit into
Open
ConfigHWIDs: decode MAVn_DEVID parameters to human-readable strings#3762Greninja44 wants to merge 1 commit into
Greninja44 wants to merge 1 commit into
Conversation
ArduPilot added MAVn_DEVID params identifying which serial/network/ CAN/scripting device a MAVLink channel's MAVn_* params apply to. Add a devid lookup table so the HW ID page shows names like SERIAL1, NET_P1, CAN_D1_UC_S1 instead of a raw number. Fixes ArduPilot#3761
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ArduPilot recently added
MAVn_DEVIDparameters (see ArduPilot/ardupilot#29762) which identify which serial/USB/network/CAN/scripting device a MAVLink channel'sMAVn_*parameters correspond to. The HW ID page didn't know about this new parameter family, so those rows fell through to the IMU device-type decode and showed a meaningless raw number instead of a readable name.This adds a
mavlink_devidlookup (matching the naming used by ArduPilot/MAVProxy:SERIAL1,USB0,NET_P1,CAN_D1_UC_S1,SCR_SDEV1, etc.) and wires it into the existingDeviceInfo.DevTypedecode path used by the HW ID grid, following the same pattern already used for compass/IMU/baro/airspeed device types.Fixes #3761
Mapping added
Unrecognized values fall back to the raw number, consistent with how the other device-type enums already behave.
Test plan
MissionPlannerTests/Utilities/DeviceInfoTests.cscovering all 19 mappings plus the unrecognized-value fallback.Device.cs/DeviceInfo.csunmodified) that all 19 mappings, the unknown-value fallback, and the pre-existing compass/IMU/baro/airspeed/UAVCAN decode paths are unaffected.