Chromium Code Reviews| Index: tools/battor_agent/battor_agent_bin.cc |
| diff --git a/tools/battor_agent/battor_agent_bin.cc b/tools/battor_agent/battor_agent_bin.cc |
| index 6a70127bc47381338b85e2f3fd53cdbf3aa86186..39114f640a1c042444ac2d6d565a63162efa7fac 100644 |
| --- a/tools/battor_agent/battor_agent_bin.cc |
| +++ b/tools/battor_agent/battor_agent_bin.cc |
| @@ -74,6 +74,7 @@ const char kUsage[] = |
| " StopTracing <optional file path>\n" |
| " SupportsExplicitClockSync\n" |
| " RecordClockSyncMarker <marker>\n" |
| + " Version\n" |
|
rnephew (Reviews Here)
2016/10/18 22:55:24
Since its a git hash and not version, should I cha
charliea (OOO until 10-5)
2016/10/18 23:46:29
I think "GetFirmwareGitHash" might be better, actu
rnephew (Reviews Here)
2016/10/19 18:23:47
Done.
|
| " Exit\n" |
| " Help\n" |
| "\n"; |
| @@ -200,6 +201,9 @@ class BattOrAgentBin : public BattOrAgent::Listener { |
| } |
| RecordClockSyncMarker(tokens[1]); |
| + } else if (cmd == "Version") { |
| + GetVersion(); |
| + PostRunNextCommand(); |
| } else if (cmd == "Exit" || std::cin.eof()) { |
| ui_thread_message_loop_.task_runner()->PostTask( |
| FROM_HERE, ui_thread_run_loop_.QuitClosure()); |
| @@ -215,6 +219,21 @@ class BattOrAgentBin : public BattOrAgent::Listener { |
| base::Bind(&BattOrAgentBin::RunNextCommand, base::Unretained(this))); |
| } |
| + void GetVersion() { |
| + io_thread_.task_runner()->PostTask( |
| + FROM_HERE, |
| + base::Bind(&BattOrAgent::GetVersion, base::Unretained(agent_.get()))); |
| + } |
| + |
| + void OnGetVersionComplete(const int version, BattOrError error) override { |
| + if (error == BATTOR_ERROR_NONE) |
| + std::cout << version << endl; |
| + else |
| + HandleError(error); |
| + |
| + PostRunNextCommand(); |
| + } |
| + |
| void StartTracing() { |
| io_thread_.task_runner()->PostTask( |
| FROM_HERE, |