mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-28 23:30:22 -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/engine
|
@ -909,6 +909,20 @@ class Runtime extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
disconnectExtensionSession (extensionId) {
|
||||
if (this.extensionDevices[extensionId]) {
|
||||
this.extensionDevices[extensionId].disconnectSession();
|
||||
}
|
||||
}
|
||||
|
||||
getPeripheralIsConnected (extensionId) {
|
||||
let isConnected = false;
|
||||
if (this.extensionDevices[extensionId]) {
|
||||
isConnected = this.extensionDevices[extensionId].getPeripheralIsConnected();
|
||||
}
|
||||
return isConnected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the function associated with the given opcode.
|
||||
* @param {!string} opcode The opcode to look up.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue