Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arduino/go-serial-utils
A golang library with a bunch of procedures to handle serial ports on Arduino (and compatible) boards.
https://github.com/arduino/go-serial-utils
Last synced: 16 days ago
JSON representation
A golang library with a bunch of procedures to handle serial ports on Arduino (and compatible) boards.
- Host: GitHub
- URL: https://github.com/arduino/go-serial-utils
- Owner: arduino
- License: other
- Created: 2024-02-07T14:17:44.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-02-07T14:29:40.000Z (9 months ago)
- Last Synced: 2024-10-08T09:51:55.416Z (about 1 month ago)
- Language: Go
- Size: 16.6 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## go-serial-utils: a golang library with a bunch of procedures to handle serial ports on Arduino (and compatible) boards.
### Board reset
To reset a board you must use the `Reset` method.
```go
Reset(portToTouch string, wait bool, dryRun bool, portsMapper PortsMapper, cb *ResetProgressCallbacks) (string, error)
````Reset` will reset a board using the 1200 bps port-touch and waits for the bootloader port that is returned.
Both reset and wait are optional:
- if `portToTouch` is the empty string "" the reset will be skipped
- if `wait` is false waiting will be skipped
If `wait` is true, this function will wait for a new port to appear after the reset and returns it. If a new port can not be detected or if the `wait` parameter is `false`, then the empty string is returned.If `dryRun` is set to `true` this function will only emulate the port reset without actually performing it, this is useful to mockup for unit-testing and CI. In dryRun mode if the `portToTouch` ends with `"999"` and `wait` is `true`, the function will return a new "mocked" bootloader port as `portToTouch+"0"`.
`portMapper` is a method called to obtain the current serial port list. If `portMapper` is `nil` the default internal port mapper will be used.
`cb` is a struct defining a bunch of callback functions called during the reset operation to provide progress feedback to the caller.
## Security
If you think you found a vulnerability or other security-related bug in this project, please read our
[security policy](https://github.com/arduino/go-paths-helper/security/policy) and report the bug to our Security Team 🛡️
Thank you!e-mail contact: [email protected]