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

Unified Diff: tools/battor_agent/battor_agent.cc

Issue 2622003005: [BattOr] Initialize BattOr before getting firmware git hash. (Closed)
Patch Set: Created 3 years, 11 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
Index: tools/battor_agent/battor_agent.cc
diff --git a/tools/battor_agent/battor_agent.cc b/tools/battor_agent/battor_agent.cc
index 2a1d7d7aa02bc67ab93cc6333410c3e9d0f46f5c..54e348dfac634176cf8de9ee255de3a5d22192ae 100644
--- a/tools/battor_agent/battor_agent.cc
+++ b/tools/battor_agent/battor_agent.cc
@@ -198,7 +198,7 @@ void BattOrAgent::OnConnectionOpened(bool success) {
PerformAction(Action::SEND_CURRENT_SAMPLE_REQUEST);
return;
case Command::GET_FIRMWARE_GIT_HASH:
- PerformAction(Action::SEND_GIT_HASH_REQUEST);
+ PerformAction(Action::SEND_INIT);
charliea (OOO until 10-5) 2017/01/12 17:05:49 I think that, before this line, you want num_init_
rnephew (Reviews Here) 2017/01/12 17:53:21 Done.
return;
case Command::INVALID:
NOTREACHED();
@@ -305,6 +305,10 @@ void BattOrAgent::OnMessageRead(bool success,
switch (last_action_) {
case Action::READ_INIT_ACK:
+ if (command_ == Command::GET_FIRMWARE_GIT_HASH) {
charliea (OOO until 10-5) 2017/01/12 17:05:50 note that the current location of this circumvents
rnephew (Reviews Here) 2017/01/12 17:53:21 Done.
+ PerformAction(Action::SEND_GIT_HASH_REQUEST);
+ return;
+ }
if (!IsAckOfControlCommand(type, BATTOR_CONTROL_MESSAGE_TYPE_INIT,
*bytes)) {
if (num_init_attempts_++ < kMaxInitAttempts) {
« no previous file with comments | « no previous file | tools/battor_agent/battor_agent_unittest.cc » ('j') | tools/battor_agent/battor_agent_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698