Skip to content

Added sketch name when uploading via Web Serial API Daemon #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 6 additions & 1 deletion src/web-serial-daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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 {
Expand All @@ -264,6 +268,7 @@ export default class WebSerialDaemon extends Daemon {
data: {
board,
port,
filename,
commandline,
data,
token: token.token,
Expand Down