Skip to content

Commit

Permalink
allow firmware version to be specified
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Jan 30, 2024
1 parent bdcc79a commit 364b2c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/apploader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Node.js library with utilities to handle using the app loader from node.js */

var DEVICEID = "BANGLEJS2";
var VERSION = "2v11";
var MINIFY = true; // minify JSON?
var BASE_DIR = __dirname + "/../..";
var APPSDIR = BASE_DIR+"/apps/";
Expand All @@ -27,13 +28,16 @@ var language; // Object of translations

/* call with {
DEVICEID:"BANGLEJS/BANGLEJS2"
VERSION:"2v20"
language: undefined / "lang/de_DE.json"
} */
exports.init = function(options) {
if (options.DEVICEID) {
DEVICEID = options.DEVICEID;
device.id = options.DEVICEID;
}
if (options.VERSION)
VERSION = options.VERSION;
if (options.language) {
language = JSON.parse(require("fs").readFileSync(BASE_DIR+"/"+options.language));
}
Expand Down Expand Up @@ -93,7 +97,7 @@ exports.getAppFiles = function(app) {
var getFileOptions = {
fileGetter : fileGetter,
settings : SETTINGS,
device : { id : DEVICEID },
device : { id : DEVICEID, version : VERSION },
language : language
};
var uploadOptions = {
Expand Down

0 comments on commit 364b2c1

Please sign in to comment.