Agent does not properly update 'IsOpen' Port State #936
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
The current version of the agent does not appear to update the
IsOpen
state of serial ports. This is set to false by default on adding a new port, but does not appear to be updated when a port is opened, or closed.This is evident with the latest arduino-create-agent-js-client, which checks this value to determine whether or not to actively close the serial port before attempting to upload a new program via serial. Since this is always false, opening the monitor first effectively prevents the client from uploading anything, as it just skips the close step.
The check is handled inside the method that handles closing the monitor, so invoking it directly also has no effect. The user either has to close all ports forcibly, or directly issue a command to the agent.
To reproduce
list
& observe the 'IsOpen' property is falseopen /dev/MyDeviceXYZ 9600 timed
IsOpen
is still falseExpected behavior
As far as I understand (based on the behavior of the JS sdk) opening the serial port to a board should mark the
IsOpen
property as true, and closing it should mark it as false.I presume such updates could be performed in https://github.com/arduino/arduino-create-agent/blob/main/serialport.go#L270, and https://github.com/arduino/arduino-create-agent/blob/main/serialport.go#L349, using the current
serialPorts
.Arduino Create Agent version
1.4
Operating system
macOS
Operating system version
14.4
Browser
Chrome, Firefox
Browser version
respecitvely 123.0.6312.124, 124.0.2
Additional context
arm64 setup
Issue checklist
The text was updated successfully, but these errors were encountered: