Skip to content

Adjust pluggable monitor spec re: DESCRIBE command response to match library behavior #1738

Closed
@per1234

Description

@per1234

Describe the problem

The pluggable monitor specification states:

https://arduino.github.io/arduino-cli/dev/pluggable-monitor-specification/#describe-command

The enum types must have a list of possible values

The example response shown in the specification also uses values key names, so I don't think it is only a matter of incorrect formatting of "values"

🐛 github.com/arduino/pluggable-monitor-protocol-handler.monitor.PortParameterDescriptor.Values has a field tag value of value, instead of the specification compliant values:

https://github.com/arduino/pluggable-monitor-protocol-handler/blob/3dee1f8eddeb94f728c66645ec748da0501340e6/message.go#L38

To reproduce

$ git clone https://github.com/arduino/pluggable-monitor-protocol-handler

$ cd pluggable-monitor-protocol-handler/dummy-monitor/

$ git log -1 --oneline
3dee1f8 (HEAD -> main, origin/main, origin/HEAD) Merge pull request arduino/pluggable-monitor-protocol-handler#12 from per1234/issue-forms

$ go build

$ ./dummy-monitor
HELLO 1 "Arduino IDE"
{
  "eventType": "hello",
  "message": "OK",
  "protocolVersion": 1
}
DESCRIBE
{
  "eventType": "describe",
  "message": "OK",
  "port_description": {
    "protocol": "test",
    "configuration_parameters": {
      "echo": {
        "label": "echo",
        "type": "enum",
        "value": [
          "on",
          "off"
        ],
        "selected": "on"
      },
      "speed": {
        "label": "Baudrate",
        "type": "enum",
        "value": [
          "9600",
          "19200",
          "38400",
          "57600",
          "115200"
        ],
        "selected": "9600"
      }
    }
  }
}

🐛 There are non-compliant key names:

  • port_description.configuration_parameters.echo.value
  • port_description.configuration_parameters.speed.value

Expected behavior

DESCRIBE command response is specification compliant.

'github.com/arduino/pluggable-monitor-protocol-handler' version

3dee1f8

Additional context

No response

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

Activity

added
topic: codeRelated to content of the project itself
type: imperfectionPerceived defect in any part of project
on May 18, 2022
cmaglie

cmaglie commented on May 23, 2022

@cmaglie
Member

🤦🏼

We already have everything out using value.
Maybe it's better to "fix" the specification instead, because if someone already implemented a monitor: he surely used value instead of values otherwise arduino-cli won't accept it.

per1234

per1234 commented on May 23, 2022

@per1234
ContributorAuthor

Thanks for the response @cmaglie. I had the same feeling, but decided it was better to report the issue from the perspective of the specification being canonical and anything which doesn't match the specification being non-compliant.

Since the resolution will be done by changing the specification content hosted in the arduino/arduino-cli repository, I have now transferred the issue there.

added
topic: documentationRelated to documentation for the project
and removed
topic: codeRelated to content of the project itself
on May 23, 2022
changed the title [-]`DESCRIBE` command response is not specification compliant[/-] [+]Adjust pluggable monitor spec re: `DESCRIBE` command response to match library behavior[/+] on May 23, 2022
self-assigned this
on May 29, 2022
added a commit that references this issue on Jun 3, 2022
82edc83

2 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Adjust pluggable monitor spec re: `DESCRIBE` command response to match library behavior · Issue #1738 · arduino/arduino-cli