| 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..3c83d677417d6172b2aa0e3b7adfc1ac510d7c79 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"
|
| + " GetFirmwareGitHash\n"
|
| " Exit\n"
|
| " Help\n"
|
| "\n";
|
| @@ -200,6 +201,9 @@ class BattOrAgentBin : public BattOrAgent::Listener {
|
| }
|
|
|
| RecordClockSyncMarker(tokens[1]);
|
| + } else if (cmd == "GetFirmwareGitHash") {
|
| + GetFirmwareGitHash();
|
| + return;
|
| } else if (cmd == "Exit" || std::cin.eof()) {
|
| ui_thread_message_loop_.task_runner()->PostTask(
|
| FROM_HERE, ui_thread_run_loop_.QuitClosure());
|
| @@ -215,6 +219,23 @@ class BattOrAgentBin : public BattOrAgent::Listener {
|
| base::Bind(&BattOrAgentBin::RunNextCommand, base::Unretained(this)));
|
| }
|
|
|
| + void GetFirmwareGitHash() {
|
| + io_thread_.task_runner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&BattOrAgent::GetFirmwareGitHash,
|
| + base::Unretained(agent_.get())));
|
| + }
|
| +
|
| + void OnGetFirmwareGitHashComplete(const std::string& firmware_git_hash,
|
| + BattOrError error) override {
|
| + if (error == BATTOR_ERROR_NONE)
|
| + std::cout << firmware_git_hash << endl;
|
| + else
|
| + HandleError(error);
|
| +
|
| + PostRunNextCommand();
|
| + }
|
| +
|
| void StartTracing() {
|
| io_thread_.task_runner()->PostTask(
|
| FROM_HERE,
|
|
|