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

6
dist/index.es.js vendored
View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "updaterweblibrary", "name": "updaterweblibrary",
"version": "1.0.29", "version": "1.0.30",
"description": "OTA Updater App frontend library", "description": "OTA Updater App frontend library",
"repository": { "repository": {
"type": "git", "type": "git",