actually count up file progress
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user