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

Unified Diff: tools/battor_agent/battor_agent_bin.cc

Issue 2390893002: [BattOr] Make BattOr able to return firmware version. (Closed)
Patch Set: 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..0e9d970d1ef9827ce1584699c3044f5a5e6d8482 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,21 @@ class BattOrAgentBin : public BattOrAgent::Listener {
base::Bind(&BattOrAgentBin::RunNextCommand, base::Unretained(this)));
}
+ void GetVersion() {
+ std::cout << "WOOP WOOP";
+// io_thread_.task_runner()->PostTask(
+// FROM_HERE,
+// base::Bind(&BattOrAgent::Version, 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