diff --git a/dist/index.cjs.js b/dist/index.cjs.js index cd9bdb1..c787704 100644 --- a/dist/index.cjs.js +++ b/dist/index.cjs.js @@ -177,6 +177,7 @@ class Updater { let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize); return new Promise((resolve, reject) => { this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => { + this._fileProgress += this._packetSize; resolve(true); }, (error) => { reject(error); @@ -205,7 +206,7 @@ class Updater { if (dataView[0] == 1) { // send file await this.sendNextPacket(); - progressCallback(`Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)})`); + progressCallback(`Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)}), ${this._fileProgress} / ${this._fileSize}`); } else if (dataView[0] == 2) { // done logic diff --git a/dist/index.es.js b/dist/index.es.js index f04eb23..6e2038e 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -175,6 +175,7 @@ class Updater { let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize); return new Promise((resolve, reject) => { this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => { + this._fileProgress += this._packetSize; resolve(true); }, (error) => { reject(error); @@ -203,7 +204,7 @@ class Updater { if (dataView[0] == 1) { // send file await this.sendNextPacket(); - progressCallback(`Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)})`); + progressCallback(`Sending (${Math.floor((this._fileProgress * 100) / this._fileSize)}), ${this._fileProgress} / ${this._fileSize}`); } else if (dataView[0] == 2) { // done logic diff --git a/package.json b/package.json index 5fc93c2..c269d6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "updaterweblibrary", - "version": "1.0.16", + "version": "1.0.17", "description": "OTA Updater App frontend library", "repository": { "type": "git",