(1.0.33) bump

This commit is contained in:
2025-12-01 20:47:55 +00:00
parent 46bd6f7161
commit c20c0b02cf
3 changed files with 9 additions and 9 deletions

8
dist/index.cjs.js vendored
View File

@@ -206,12 +206,12 @@ class Updater {
this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => { this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => {
let dataView = new Uint8Array(rawData); let dataView = new Uint8Array(rawData);
console.log(dataView); console.log(dataView);
if (dataView[0] == 1) { if (dataView[0] == 1 && dataView.length == 1) {
// send file // send file
this.sendNextPacket(); this.sendNextPacket();
progressCallback(`MTU: ${this._packetSize}; Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)}%), ${this._fileProgress} / ${this._fileSize}`); 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 // done logic
console.log(`progress >= filesize: ${this._fileProgress} vs ${this._fileSize}`); console.log(`progress >= filesize: ${this._fileProgress} vs ${this._fileSize}`);
if (this._fileProgress >= (this._fileSize - this._packetSize)) { if (this._fileProgress >= (this._fileSize - this._packetSize)) {
@@ -234,12 +234,12 @@ class Updater {
this._fileProgress = 0; this._fileProgress = 0;
} }
} }
else if (dataView[0] == 15) { else if (dataView[0] == 15 && dataView.length == 1) {
// error cmd // error cmd
progressCallback(`Error on remote: ${this._fileProgress} / ${this._fileSize}`); progressCallback(`Error on remote: ${this._fileProgress} / ${this._fileSize}`);
reject("Error on remote"); reject("Error on remote");
} }
else if (dataView[0] == 0) { else if (dataView[0] == 0 && dataView.length == 1) {
// ignore no command // ignore no command
progressCallback(`Board is on`); progressCallback(`Board is on`);
} }

8
dist/index.es.js vendored
View File

@@ -204,12 +204,12 @@ class Updater {
this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => { this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => {
let dataView = new Uint8Array(rawData); let dataView = new Uint8Array(rawData);
console.log(dataView); console.log(dataView);
if (dataView[0] == 1) { if (dataView[0] == 1 && dataView.length == 1) {
// send file // send file
this.sendNextPacket(); this.sendNextPacket();
progressCallback(`MTU: ${this._packetSize}; Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)}%), ${this._fileProgress} / ${this._fileSize}`); 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 // done logic
console.log(`progress >= filesize: ${this._fileProgress} vs ${this._fileSize}`); console.log(`progress >= filesize: ${this._fileProgress} vs ${this._fileSize}`);
if (this._fileProgress >= (this._fileSize - this._packetSize)) { if (this._fileProgress >= (this._fileSize - this._packetSize)) {
@@ -232,12 +232,12 @@ class Updater {
this._fileProgress = 0; this._fileProgress = 0;
} }
} }
else if (dataView[0] == 15) { else if (dataView[0] == 15 && dataView.length == 1) {
// error cmd // error cmd
progressCallback(`Error on remote: ${this._fileProgress} / ${this._fileSize}`); progressCallback(`Error on remote: ${this._fileProgress} / ${this._fileSize}`);
reject("Error on remote"); reject("Error on remote");
} }
else if (dataView[0] == 0) { else if (dataView[0] == 0 && dataView.length == 1) {
// ignore no command // ignore no command
progressCallback(`Board is on`); progressCallback(`Board is on`);
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "updaterweblibrary", "name": "updaterweblibrary",
"version": "1.0.32", "version": "1.0.33",
"description": "OTA Updater App frontend library", "description": "OTA Updater App frontend library",
"repository": { "repository": {
"type": "git", "type": "git",