MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / parse

Method parse

source/MaaAdbControlUnit/General/Connection.cpp:18–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18bool Connection::parse(const json::value& config)
19{
20 static const json::array kDefaultConnectArgv = {
21 "{ADB}",
22 "connect",
23 "{ADB_SERIAL}",
24 };
25 static const json::array kDefaultKillServerArgv = {
26 "{ADB}",
27 "kill-server",
28 };
29 static const json::array kDefaultTestConnectionArgv = {
30 "{ADB}",
31 "-s",
32 "{ADB_SERIAL}",
33 "get-state",
34 };
35 // 使用 cat 等待 stdin,最轻量的长期挂起命令
36 static const json::array kDefaultMonitorArgv = {
37 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "cat",
38 };
39
40 return parse_command("Connect", config, kDefaultConnectArgv, connect_argv_)
41 && parse_command("KillServer", config, kDefaultKillServerArgv, kill_server_argv_)
42 && parse_command("TestConnection", config, kDefaultTestConnectionArgv, test_connection_argv_)
43 && parse_command("Monitor", config, kDefaultMonitorArgv, monitor_argv_);
44}
45
46bool Connection::connect()
47{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected