Add disconnectExtensionSession and getPeripheralIsConnected

This commit is contained in:
Eric Rosenbaum 2018-06-27 14:21:11 -04:00 committed by Ray Schamp
parent 613a9f96c3
commit 6f5ff31eb3
5 changed files with 72 additions and 0 deletions
src/extensions/scratch3_microbit

View file

@ -128,6 +128,18 @@ class MicroBit {
this._ble.connectDevice(id);
}
disconnectSession () {
this._ble.disconnectSession();
}
getPeripheralIsConnected () {
let connected = false;
if (this._ble) {
connected = this._ble.getPeripheralIsConnected();
}
return connected;
}
/**
* @param {string} text - the text to display.
* @return {Promise} - a Promise that resolves when writing to device.