wait for mtu to be agreed
This commit is contained in:
@@ -239,9 +239,9 @@ export default class Updater {
|
||||
// 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: number) => { 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: ArrayBuffer): void => {
|
||||
|
||||
Reference in New Issue
Block a user