From c20c0b02cf4903c0e2a2b53b24d4ebb1d524b61f Mon Sep 17 00:00:00 2001 From: chopster44 Date: Mon, 1 Dec 2025 20:47:55 +0000 Subject: [PATCH] (1.0.33) bump --- dist/index.cjs.js | 8 ++++---- dist/index.es.js | 8 ++++---- package.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dist/index.cjs.js b/dist/index.cjs.js index fd57cd9..05eb1ee 100644 --- a/dist/index.cjs.js +++ b/dist/index.cjs.js @@ -206,12 +206,12 @@ class Updater { this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => { let dataView = new Uint8Array(rawData); console.log(dataView); - if (dataView[0] == 1) { + if (dataView[0] == 1 && dataView.length == 1) { // send file this.sendNextPacket(); progressCallback(`MTU: ${this._packetSize}; Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)}%), ${this._fileProgress} / ${this._fileSize}`); } - else if (dataView[0] == 2) { + else if (dataView[0] == 2 && dataView.length == 1) { // done logic console.log(`progress >= filesize: ${this._fileProgress} vs ${this._fileSize}`); if (this._fileProgress >= (this._fileSize - this._packetSize)) { @@ -234,12 +234,12 @@ class Updater { this._fileProgress = 0; } } - else if (dataView[0] == 15) { + else if (dataView[0] == 15 && dataView.length == 1) { // error cmd progressCallback(`Error on remote: ${this._fileProgress} / ${this._fileSize}`); reject("Error on remote"); } - else if (dataView[0] == 0) { + else if (dataView[0] == 0 && dataView.length == 1) { // ignore no command progressCallback(`Board is on`); } diff --git a/dist/index.es.js b/dist/index.es.js index 18b4f83..4700700 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -204,12 +204,12 @@ class Updater { this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => { let dataView = new Uint8Array(rawData); console.log(dataView); - if (dataView[0] == 1) { + if (dataView[0] == 1 && dataView.length == 1) { // send file this.sendNextPacket(); progressCallback(`MTU: ${this._packetSize}; Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)}%), ${this._fileProgress} / ${this._fileSize}`); } - else if (dataView[0] == 2) { + else if (dataView[0] == 2 && dataView.length == 1) { // done logic console.log(`progress >= filesize: ${this._fileProgress} vs ${this._fileSize}`); if (this._fileProgress >= (this._fileSize - this._packetSize)) { @@ -232,12 +232,12 @@ class Updater { this._fileProgress = 0; } } - else if (dataView[0] == 15) { + else if (dataView[0] == 15 && dataView.length == 1) { // error cmd progressCallback(`Error on remote: ${this._fileProgress} / ${this._fileSize}`); reject("Error on remote"); } - else if (dataView[0] == 0) { + else if (dataView[0] == 0 && dataView.length == 1) { // ignore no command progressCallback(`Board is on`); } diff --git a/package.json b/package.json index 4ce156b..c2cb8c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "updaterweblibrary", - "version": "1.0.32", + "version": "1.0.33", "description": "OTA Updater App frontend library", "repository": { "type": "git",