Set internal connected flag before emitting event
This commit is contained in:
1 parent
e156b0536c
commit
82a33691d3
2 files changed
+2
-2
No files matched your search
@@ -51,8 +51,8 @@ class BLESession extends JSONRPCWebSocket {
|
||||
this.sendRemoteRequest('connect', {peripheralId: id})
|
||||
.then(() => {
|
||||
log.info('should have connected');
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
|
||||
this._connected = true;
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
|
||||
this._connectCallback();
|
||||
})
|
||||
.catch(e => {
|
||||
|
||||
+1
-1
@@ -53,8 +53,8 @@ class BTSession extends JSONRPCWebSocket {
|
||||
this.sendRemoteRequest('connect', {peripheralId: id})
|
||||
.then(() => {
|
||||
log.info('should have connected');
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
|
||||
this._connected = true;
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
|
||||
this._connectCallback();
|
||||
})
|
||||
.catch(e => {
|
||||
|
||||
Reference in new issue
Block a user