diff --git a/.gitignore b/.gitignore index 22641d8c..c3e66490 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ lib dist es .tmp +misc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..158c0064 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v14.16.0 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..93d98070 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,40 @@ +# Changelog +All notable changes to this project will be documented in this file. + +## [2.11.0] - 2022-09-27 +The main goal of this release is to improve support for the Web Serial API on ChromeOS. +Other platforms should not be affected. + +### Changed +- When using Web Serial API, the interactions between the client library + (as an example, the Arduino `arduino-chromeos-uploader` libray) has been simplified. +- A new parameter `dialogCustomizations` has been added to the upload functionality. It's used + to provide custom confirmation dialogs when using the Web Serial API. + It has no effect with other daemons. + +### Removed +- `cdcReset` functionality, now it's embedded in the `upload` functionality + in the Web Serial daemon. +### Changed + +## [2.10.1] - 2022-09-08 + +### Changed +- Fixed a bug released in 2.9.1 caused by the wrong assumption that the build filename is always at the end of the command line. This fix makes the library backward compatible with older ESP boards. + +## *DEPRECATED* [2.9.1] - 2022-09-06 +### Added +- Added support for ESP32 boards + +## [2.9.0] - 2022-06-06 +### Added +- Added support for "Arduino RP2040 Connect" board +### Changed +- Improved support for Chrome's Web Serial API on ChromeOS. Other operating systems should not be affected. +- Simplified the communication with the Web Serial API via a messaging system which simulates + the [postMessage](https://developer.chrome.com/docs/extensions/reference/runtime/#method-Port-postMessage) function available in the Chrome App Daemon (see `chrome-app-daemon.js`). + +## [2.8.0] - 2022-03-21 +### Added +- Added support (still in Beta) for Chrome's Web Serial API on ChromeOS. + Other operating systems should not be affected. diff --git a/LICENSE.txt b/LICENSE.txt index dab1f246..2a9bcdab 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,7 @@ This file includes licensing information for arduino-create-agent-js-client. Copyright (c) 2018 -Authors: Alberto Iannaccone, Stefania Mellai, Gabriele Destefanis +Authors: Alberto Iannaccone, Stefania Mellai, Gabriele Destefanis, Christian Sarnataro The software is released under the GNU General Public License, which covers the main body of the arduino-create-agent-js-client code. The terms of this license can be found at: diff --git a/README.md b/README.md index 2cceba97..3f03870d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ # arduino-create-agent-js-client JS module providing discovery of the [Arduino Create Agent](https://github.com/arduino/arduino-create-agent) and communication with it +## Changelog +See [CHANGELOG.md](https://github.com/arduino/arduino-create-agent-js-client/blob/HEAD/CHANGELOG.md) for more details. + ## Installation ```bash diff --git a/demo/app.jsx b/demo/app.jsx index 92c6ba7d..1de7aa89 100644 --- a/demo/app.jsx +++ b/demo/app.jsx @@ -27,6 +27,8 @@ import V2 from './v2/v2.jsx'; const chromeExtensionID = 'hfejhkbipnickajaidoppbadcomekkde'; +const isChromeOs = () => window.navigator.userAgent.indexOf(' CrOS ') !== -1; + const scrollToBottom = (target) => { if (target) { target.scrollTop = target.scrollHeight; // eslint-disable-line no-param-reassign @@ -151,6 +153,17 @@ class App extends React.Component { } } + requestDevicePermission = () => { + if ('serial' in navigator) { + navigator.serial.requestPort([{ usbVendorId: 0x2341 }]).then((port) => { + daemon.devicesList.next({ + serial: [port], + network: [] + }); + }); + } + }; + showError(err) { this.setState({ error: err }); scrollToBottom(document.body); @@ -275,8 +288,10 @@ class App extends React.Component {
-

Connected Devices

- +
+

Connected Devices

+ { isChromeOs() && } +
serial: