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.detectto take in an optionalserial_overrideparameter - 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_overrideandget_serial_overridemethods similar to these, but with just a string value - Pass the
get_serial_overrideoutput in via thedetectcall 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.jsonfile 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.