Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: tools/battor_agent/battor_agent_bin.cc

Issue 2390893002: [BattOr] Make BattOr able to return firmware version. (Closed)
Patch Set: fix compiling error Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/battor_agent/battor_agent.cc ('k') | tools/battor_agent/battor_agent_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « tools/battor_agent/battor_agent.cc ('k') | tools/battor_agent/battor_agent_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698