UNPKG

node-aurora

Version:

Provides an interface to the Aurora Dreamband.

25 lines (15 loc) 732 B
'use strict'; var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs); var _util = require('./util'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = function (fwPath) { var _this = this; var fwVersion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var fwType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'app'; //TODO: this condition is for backwards compatibility var filename = fwType == 'app' ? 'aurora.hex' : 'aurora-' + fwType + '.hex'; return this.uploadFile(fwPath, filename).then(function () { return _this.flash(filename, fwVersion, fwType); }); };