diff --git a/src/connection/web_ble_connection.js b/src/connection/web_ble_connection.js index 1b30cae..dad7c86 100644 --- a/src/connection/web_ble_connection.js +++ b/src/connection/web_ble_connection.js @@ -9,6 +9,7 @@ class WebBleConnection extends Connection { this.gattServer = null; this.rxCharacteristic = null; this.txCharacteristic = null; + this.init(); } static async open() { @@ -35,11 +36,8 @@ class WebBleConnection extends Connection { return null; } - // create connection and initialize it - const connection = new WebBleConnection(device); - await connection.init(); + return new WebBleConnection(device); - return connection; } async init() {