mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
detect ble disconnect
This commit is contained in:
parent
af6403bf6a
commit
c09ad0514c
1 changed files with 5 additions and 0 deletions
|
|
@ -42,6 +42,11 @@ class BleConnection extends Connection {
|
|||
|
||||
async init() {
|
||||
|
||||
// listen for ble disconnect
|
||||
this.bleDevice.addEventListener("gattserverdisconnected", () => {
|
||||
this.emit("disconnected");
|
||||
});
|
||||
|
||||
// connect to gatt server
|
||||
this.gattServer = await this.bleDevice.gatt.connect();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue