I’ve taken some time to look at that part of the codebase. The main relevant points are that the Detector
is stateless (so things need to be passed in directly, or determined dynamically), and the settings are managed by the ArduPilotManager
.
Accordingly, what makes the most sense to me would be
- Modify
Detector.detect
to take in an optionalserial_override
parameter - Allow that to flow through to
detect_serial_flight_controllers
, in which caseplatform = Platform.GenericSerial if port.device == serial_override else Detector.detect_serial_platform(port)
- Create
set_serial_override
andget_serial_override
methods similar to these, but with just a string value - Pass the
get_serial_override
output in via thedetect
call inArduPilotManager.available_boards
- A nice frontend interface can come later (likely integrated as part of the
BoardChangeDialog
) - in the interim the value can be manually added to theconfigs/ardupilot-manager/settings.json
file via the File Browser page.
Note: these changes would need to be done together with the existing pull request change, because otherwise non-USB options won’t be considered at all.