(1.0.30) bump
This commit is contained in:
6
dist/index.cjs.js
vendored
6
dist/index.cjs.js
vendored
@@ -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
6
dist/index.es.js
vendored
@@ -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();
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user