Skip to content

ConfigHWIDs: decode MAVn_DEVID parameters to human-readable strings - #3762

Open
Greninja44 wants to merge 1 commit into
ArduPilot:masterfrom
Greninja44:fix/hwid-mavn-devid
Open

ConfigHWIDs: decode MAVn_DEVID parameters to human-readable strings#3762
Greninja44 wants to merge 1 commit into
ArduPilot:masterfrom
Greninja44:fix/hwid-mavn-devid

Conversation

@Greninja44

@Greninja44 Greninja44 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

ArduPilot recently added MAVn_DEVID parameters (see ArduPilot/ardupilot#29762) which identify which serial/USB/network/CAN/scripting device a MAVLink channel's MAVn_* 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_devid lookup (matching the naming used by ArduPilot/MAVProxy: SERIAL1, USB0, NET_P1, CAN_D1_UC_S1, SCR_SDEV1, etc.) and wires it into the existing DeviceInfo.DevType decode path used by the HW ID grid, following the same pattern already used for compass/IMU/baro/airspeed device types.

Fixes #3761

Mapping added

devid Name
0 Unknown
6 USB0
14–78 (+8) SERIAL1–SERIAL9
174–198 (+8) NET_P1–NET_P4
334 CAN_D1_UC_S1
414 CAN_D2_UC_S1
494 SCR_SDEV1
502 SCR_SDEV2

Unrecognized values fall back to the raw number, consistent with how the other device-type enums already behave.

Test plan

  • Added MissionPlannerTests/Utilities/DeviceInfoTests.cs covering all 19 mappings plus the unrecognized-value fallback.
  • Verified in an isolated harness (compiling the real Device.cs/DeviceInfo.cs unmodified) that all 19 mappings, the unknown-value fallback, and the pre-existing compass/IMU/baro/airspeed/UAVCAN decode paths are unaffected.

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
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.

Extend HW ID page to cover new MAVn_DEVID parameters

1 participant