arduino-create-agent
arduino-create-agent copied to clipboard
Refactor
This project would probably benefit from a refactor.
We could organize the code in different packages:
main: starts things up, manage the daemonization
server: manage the http and websocket server
StartServer
: start a http and https server and serves the requests
discovery: searches for serial and network ports
Loop
: starts a Loop updating the list of ports found
monitor: dialogues with serial and network ports
Open
: open a port to communicate, returns a channel where you can push info
Close
: close a port to stop communicating
program: upload a sketch on a board connected to a port
Program
: program a port
The Discovery/Monitor/Upload "separation of responsibilities" is followed in the Java IDE too.
To increase the amount of code reuse, one suggestion that was proposed in the past, was to create a set of command-line tools for dealing with each step, so the Java IDE and the Web IDE can both connect to these tools via stdin/stdout. Currently we do that only for the "Upload" part (because we already have avrdude
and bossac
).
@matteosuppo @mastrolinux Is there any plan to proceed on this refactor? It would be really useful to the frontend, since the logic to handle this stuff is crazy.
Yes, most of these features are now in the arduino-cli project. We should be able to integrate them here within the next 2 months.
Cool. Maybe we should migrate to jira issues then.