Add device-find, client-find server commands

Reviewed By: passy

Differential Revision: D36098171

fbshipit-source-id: f0d0bbefcafc57a6413f9ffe8da271419c0d4deb
This commit is contained in:
Andrey Goncharov
2022-05-10 05:13:24 -07:00
committed by Facebook GitHub Bot
parent 50111ef24b
commit 3dd7583fdc
2 changed files with 10 additions and 0 deletions

View File

@@ -340,6 +340,9 @@ export class FlipperServerImpl implements FlipperServer {
),
'get-config': async () => this.config,
'get-changelog': getChangelog,
'device-find': async (deviceSerial) => {
return this.devices.get(deviceSerial)?.info;
},
'device-list': async () => {
return Array.from(this.devices.values()).map((d) => d.info);
},
@@ -363,6 +366,9 @@ export class FlipperServerImpl implements FlipperServer {
}
device.sendCommand(command);
},
'client-find': async (clientId) => {
return this.server.connections.get(clientId)?.client;
},
'client-list': async () => {
return Array.from(this.server.connections.values()).map((c) => c.client);
},