(1.0.17) bump
This commit is contained in:
3
dist/index.cjs.js
vendored
3
dist/index.cjs.js
vendored
@@ -177,6 +177,7 @@ class Updater {
|
|||||||
let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize);
|
let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => {
|
this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => {
|
||||||
|
this._fileProgress += this._packetSize;
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
reject(error);
|
reject(error);
|
||||||
@@ -205,7 +206,7 @@ class Updater {
|
|||||||
if (dataView[0] == 1) {
|
if (dataView[0] == 1) {
|
||||||
// send file
|
// send file
|
||||||
await this.sendNextPacket();
|
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) {
|
else if (dataView[0] == 2) {
|
||||||
// done logic
|
// done logic
|
||||||
|
|||||||
3
dist/index.es.js
vendored
3
dist/index.es.js
vendored
@@ -175,6 +175,7 @@ class Updater {
|
|||||||
let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize);
|
let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => {
|
this.bleObject.write(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => {
|
||||||
|
this._fileProgress += this._packetSize;
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
reject(error);
|
reject(error);
|
||||||
@@ -203,7 +204,7 @@ class Updater {
|
|||||||
if (dataView[0] == 1) {
|
if (dataView[0] == 1) {
|
||||||
// send file
|
// send file
|
||||||
await this.sendNextPacket();
|
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) {
|
else if (dataView[0] == 2) {
|
||||||
// done logic
|
// done logic
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "updaterweblibrary",
|
"name": "updaterweblibrary",
|
||||||
"version": "1.0.16",
|
"version": "1.0.17",
|
||||||
"description": "OTA Updater App frontend library",
|
"description": "OTA Updater App frontend library",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Reference in New Issue
Block a user