Description
Describe the request
We can use the USB serial number to know that a board has changed COM port, for example after an upload, or when it swaps to bootloader mode after a double-tap on the reset button.
Currently the discovery returns this information:
{
"eventType": "list",
"ports": [
{
"address": "/dev/ttyACM0",
"label": "/dev/ttyACM0",
"properties": {
"pid": "0x804e",
"vid": "0x2341",
"serialNumber": "EBEABFD6514D32364E202020FF10181E"
},
"protocol": "serial",
"protocolLabel": "Serial Port (USB)"
}
]
}
we may extend the result by adding an extra field hardwareId
that is populated when we have an hardware identification number available, for example for USB serial ports we can use the USB Serial Number:
{
"eventType": "list",
"ports": [
{
"address": "/dev/ttyACM0",
"label": "/dev/ttyACM0",
"hardwareId": "EBEABFD6514D32364E202020FF10181E",
"properties": {
"pid": "0x804e",
"vid": "0x2341",
"serialNumber": "EBEABFD6514D32364E202020FF10181E"
},
"protocol": "serial",
"protocolLabel": "Serial Port (USB)"
}
]
}
This change may require an update to the Pluggable Discovery specification.
Describe the current behavior
When a board changes the port after a reset, there is no reliable way to determine if the new port belongs to the same board.
With this proposal implemented the IDE may exploit the hardwareId
field to reselect the correct port automatically.
Arduino CLI version
Operating system
N/A
Operating system version
N/A
Additional context
cc @pnndra @kittaakos @per1234 @umbynos
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details