From ec6fa296bf50c11a2105fa17c3d220400df6309b Mon Sep 17 00:00:00 2001 From: Christian Sarnataro Date: Thu, 14 Jul 2022 15:08:04 +0200 Subject: [PATCH] Added sketch name when uploading via Web Serial API Daemon --- README.md | 6 ++++++ package.json | 2 +- src/web-serial-daemon.js | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb76634..23e3e44 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ # 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 +[2.9.1] - 2022-07-14 + +### Added +- Added the sketch name (as `filename`) when uploading a sketch with the Web Serial API Daemon + ## Changelog [2.9.0] - 2022-06-06 diff --git a/package.json b/package.json index 31636a9..bb40417 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arduino-create-agent-js-client", - "version": "2.9.0", + "version": "2.9.1", "description": "JS module providing discovery of the Arduino Create Plugin and communication with it", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/web-serial-daemon.js b/src/web-serial-daemon.js index d42d8ea..ce9bc46 100644 --- a/src/web-serial-daemon.js +++ b/src/web-serial-daemon.js @@ -227,6 +227,10 @@ export default class WebSerialDaemon extends Daemon { }); } + /** Probably this function will be removed, the CDC reset operation + * should not be invoked explicitly, but only as part + * of the upload process. + */ cdcReset({ fqbn, port }) { this.uploading.next({ status: this.UPLOAD_IN_PROGRESS, msg: 'CDC reset started' }); this.channel.postMessage({ @@ -254,7 +258,7 @@ export default class WebSerialDaemon extends Daemon { */ _upload(uploadPayload, uploadCommandInfo) { const { - board, port, commandline, data, pid, vid + board, port, commandline, data, pid, vid, filename } = uploadPayload; const extrafiles = uploadCommandInfo && uploadCommandInfo.files && Array.isArray(uploadCommandInfo.files) ? uploadCommandInfo.files : []; try { @@ -264,6 +268,7 @@ export default class WebSerialDaemon extends Daemon { data: { board, port, + filename, commandline, data, token: token.token,