Skip to content

get firmware version as parameter + close serial befor uploading #154

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

Merged
merged 4 commits into from
Jun 3, 2019
Merged
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
14 changes: 7 additions & 7 deletions demo/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ const handleBootloaderMode = (e, port) => {
daemon.setBootloaderMode(port);
};

const handleUpdateFirmware = (e, boardId, port, wifiModule) => {
const handleUpdateFirmware = (e, boardId, port, firmwareVersion) => {
e.preventDefault();
if (![firmwareUpdater.updateStatusEnum.NOPE, firmwareUpdater.updateStatusEnum.DONE, firmwareUpdater.updateStatusEnum.ERROR].includes(firmwareUpdater.updating.getValue().status)) {
return;
}
firmwareUpdater.updateFirmware(boardId, port, wifiModule);
firmwareUpdater.updateFirmware(boardId, port, firmwareVersion);
firmwareUpdater.updatingDone.subscribe(() => {
console.log('Firmware updated successfully!');
});

firmwareUpdater.updatingError.subscribe(update => {
console.log('Something went wrong when trying to update the firmware');
console.error(update.err);
Expand Down Expand Up @@ -197,10 +197,10 @@ class App extends React.Component {
close
</a> - <a href="#" onClick={(e) => handleBootloaderMode(e, device.Name)}>
bootloader mode
</a> - <a href="#" onClick={(e) => handleUpdateFirmware(e, 'mkrwifi1010', device.Name, 'wifiNina')}>
Wifi NINA update firmware
</a> - <a href="#" onClick={(e) => handleUpdateFirmware(e, 'mkr1000', device.Name, 'wifi101')}>
Wifi 101 update firmware
</a> - <a href="#" onClick={(e) => handleUpdateFirmware(e, 'mkrwifi1010', device.Name, '1.2.1')}>
MKR WiFi 1010 update firmware
</a> - <a href="#" onClick={(e) => handleUpdateFirmware(e, 'mkr1000', device.Name, '19.4.4')}>
MKR1000 update firmware
</a>
</li>);

Expand Down
22 changes: 8 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arduino-create-agent-js-client",
"version": "2.2.5",
"version": "2.2.6",
"description": "JS module providing discovery of the Arduino Create Plugin and communication with it",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -33,7 +33,7 @@
"cross-env": "^5.2.0",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-react": "^7.13.0",
"html-webpack-plugin": "^3.2.0",
"lodash": "^4.17.11",
Expand Down
4 changes: 3 additions & 1 deletion src/chrome-app-daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
*/

import { interval } from 'rxjs';
import { distinctUntilChanged, filter, startWith, takeUntil } from 'rxjs/operators';
import {
distinctUntilChanged, filter, startWith, takeUntil
} from 'rxjs/operators';

import Daemon from './daemon';

Expand Down
Loading