Closed
Description
Describe the problem
According to the Pluggable Discovery Specification, the LIST
command:
https://arduino.github.io/arduino-cli/dev/pluggable-discovery-specification/#list-command
returns a list of the available ports at the moment of the call.
[...]
Theports
field contains a list of the available ports.
My interpretation of this is that, except in the case of an error state, the command return should always contain a ports
field, even if it is empty. This is the behavior of the other discovery tools I checked (mdns-discovery, teensy-discovery).
🐛 dfu-discovery's LIST
command return does not contain a ports
field when no DFU ports are discovered. This might cause problems for consumers of the tool's output that assume the field will be present.
To reproduce
$ dfu-discovery
HELLO 1 "foo"
{
"eventType": "hello",
"message": "OK",
"protocolVersion": 1
}
START
{
"eventType": "start",
"message": "OK",
"protocolVersion": 1
}
LIST
{
"event": "list"
}
🐛
Expected behavior
LIST
{
"event": "list",
"ports": []
}
dfu-discovery version
Operating system
Windows
Operating system version
11
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest version
- My report contains all necessary details