Description
Describe the problem
Please align the props in the output of the board list --format json
and board list --watch --format json
commands. They're different. It does not cause any problems, and maybe it's by design, but I am using the gRPC API, mock my request responses from JSON from the CLI output, and do not understand the difference between them:
arduino-cli/rpc/cc/arduino/cli/commands/v1/board.proto
Lines 190 to 197 in f850706
{
"type": "add",
"address": "/dev/cu.usbmodem14101",
"label": "/dev/cu.usbmodem14101",
"protocol": "serial",
"protocol_label": "Serial Port (USB)",
"properties": {
"pid": "0x0043",
"serialNumber": "75830303934351618212",
"vid": "0x2341"
},
"boards": [
{
"name": "Arduino Uno",
"fqbn": "arduino:avr:uno"
}
]
}
I understand that the --format json
output of a command cannot always be the same as the JSON of gRPC request/response, but why not keep them the same if feasible? Thanks!
To reproduce
./arduino-cli board list --format json
[
{
"port": {
"address": "/dev/cu.Bluetooth-Incoming-Port",
"label": "/dev/cu.Bluetooth-Incoming-Port",
"protocol": "serial",
"protocol_label": "Serial Port"
}
},
{
"matching_boards": [
{
"name": "Arduino Uno",
"fqbn": "arduino:avr:uno"
}
],
"port": {
"address": "/dev/cu.usbmodem14101",
"label": "/dev/cu.usbmodem14101",
"protocol": "serial",
"protocol_label": "Serial Port (USB)",
"properties": {
"pid": "0x0043",
"serialNumber": "75830303934351618212",
"vid": "0x2341"
}
}
}
]
./arduino-cli board list --watch --format json
{
"type": "add",
"address": "/dev/cu.Bluetooth-Incoming-Port",
"label": "/dev/cu.Bluetooth-Incoming-Port",
"protocol": "serial",
"protocol_label": "Serial Port",
"properties": {}
}
{
"type": "add",
"address": "/dev/cu.usbmodem14101",
"label": "/dev/cu.usbmodem14101",
"protocol": "serial",
"protocol_label": "Serial Port (USB)",
"properties": {
"pid": "0x0043",
"serialNumber": "75830303934351618212",
"vid": "0x2341"
},
"boards": [
{
"name": "Arduino Uno",
"fqbn": "arduino:avr:uno"
}
]
}
Expected behavior
-
Both JSON outputs have
matching_boards
property and notboards
: -
There is a
port
property for theaddress
,label
, and others: -
type
should beeventType
:
Arduino CLI version
source code 0.0.0-git
f850706
Operating system
macOS
Operating system version
11.6.5
Additional context
No response
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