(1.0.30) bump

This commit is contained in:
2025-12-01 18:40:16 +00:00
parent e5ce96adcf
commit a7d5880057
3 changed files with 9 additions and 5 deletions

6
dist/index.cjs.js vendored
View File

@@ -175,9 +175,12 @@ class Updater {
}
async sendNextPacket() {
let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize);
this._fileProgress += this._packetSize;
// this._fileProgress += this._packetSize;
return new Promise((resolve, reject) => {
this.bleObject.writeWithoutResponse(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => {
console.log("Wrote");
console.log(packet.length);
this._fileProgress += packet.length;
resolve(true);
}, (error) => {
this._fileProgress -= this._packetSize;
@@ -205,7 +208,6 @@ class Updater {
this._packetSize = mtu;
this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => {
let dataView = new Uint8Array(rawData);
console.log(dataView);
if (dataView[0] == 1) {
// send file
this.sendNextPacket();

6
dist/index.es.js vendored
View File

@@ -173,9 +173,12 @@ class Updater {
}
async sendNextPacket() {
let packet = this.file.slice(this._fileProgress, this._fileProgress + this._packetSize);
this._fileProgress += this._packetSize;
// this._fileProgress += this._packetSize;
return new Promise((resolve, reject) => {
this.bleObject.writeWithoutResponse(this.bleDeviceId, this._updaterServiceUUID, this._updateFileCharacteristicUUID, packet.buffer, () => {
console.log("Wrote");
console.log(packet.length);
this._fileProgress += packet.length;
resolve(true);
}, (error) => {
this._fileProgress -= this._packetSize;
@@ -203,7 +206,6 @@ class Updater {
this._packetSize = mtu;
this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => {
let dataView = new Uint8Array(rawData);
console.log(dataView);
if (dataView[0] == 1) {
// send file
this.sendNextPacket();