diff --git a/dist/index.cjs.js b/dist/index.cjs.js index 08f1234..85953c5 100644 --- a/dist/index.cjs.js +++ b/dist/index.cjs.js @@ -199,9 +199,9 @@ class Updater { // send a packet // check for error // write file length - return new Promise((resolve, reject) => { + return new Promise(async (resolve, reject) => { // set mtu - this.bleObject.requestMtu(this.bleDeviceId, this._packetSize, (mtu) => { this._packetSize = mtu; }, () => { }); + this._packetSize = await this.bleObject.withPromises.requestMtu(this.bleDeviceId, this._packetSize); // start notify this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => { let dataView = new Uint8Array(rawData); diff --git a/dist/index.es.js b/dist/index.es.js index fadb034..8f525ba 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -197,9 +197,9 @@ class Updater { // send a packet // check for error // write file length - return new Promise((resolve, reject) => { + return new Promise(async (resolve, reject) => { // set mtu - this.bleObject.requestMtu(this.bleDeviceId, this._packetSize, (mtu) => { this._packetSize = mtu; }, () => { }); + this._packetSize = await this.bleObject.withPromises.requestMtu(this.bleDeviceId, this._packetSize); // start notify this.bleObject.startNotification(this.bleDeviceId, this._updaterServiceUUID, this._updaterCommandCharacterisitcUUID, (rawData) => { let dataView = new Uint8Array(rawData); diff --git a/package.json b/package.json index 27a6781..dbb9158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "updaterweblibrary", - "version": "1.0.26", + "version": "1.0.27", "description": "OTA Updater App frontend library", "repository": { "type": "git",