From 90b8e08946ccfc8b53466b9d5122d3f3b37692a0 Mon Sep 17 00:00:00 2001 From: chopster44 Date: Sun, 30 Nov 2025 12:02:21 +0000 Subject: [PATCH] actually count up file progress --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 88d6397..cf7d5a5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -212,6 +212,7 @@ export default class Updater { return new Promise((resolve, reject) => { this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => { + this._fileProgress += this._packetSize; resolve(true); }, (error) => { @@ -246,7 +247,7 @@ export default 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 if (this._fileProgress >= this._fileSize) {