mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-06 19:41:51 -04:00
Add disconnectExtensionSession and getPeripheralIsConnected
This commit is contained in:
parent
613a9f96c3
commit
6f5ff31eb3
5 changed files with 72 additions and 0 deletions
src/extensions/scratch3_microbit
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue