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

Unified Diff: tools/battor_agent/battor_agent_bin.cc

Issue 2390893002: [BattOr] Make BattOr able to return firmware version. (Closed)
Patch Set: [BattOr] Make BattOr able to return firmware version. 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
« tools/battor_agent/battor_agent.cc ('K') | « tools/battor_agent/battor_agent.cc ('k') | no next file » | 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..687f53f6b544996a33631ef5b8b166609c3623db 100644
--- a/tools/battor_agent/battor_agent_bin.cc
+++ b/tools/battor_agent/battor_agent_bin.cc
@@ -200,6 +200,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 +218,20 @@ 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,
« tools/battor_agent/battor_agent.cc ('K') | « tools/battor_agent/battor_agent.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698