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

Unified Diff: tools/battor_agent/battor_agent.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
Index: tools/battor_agent/battor_agent.cc
diff --git a/tools/battor_agent/battor_agent.cc b/tools/battor_agent/battor_agent.cc
index 6fc6ea17983b09ed662e617b9906fc6c3dbc2f94..3c4456fb051e3051b2ae1c70a93f390747269629 100644
--- a/tools/battor_agent/battor_agent.cc
+++ b/tools/battor_agent/battor_agent.cc
@@ -159,6 +159,12 @@ void BattOrAgent::RecordClockSyncMarker(const std::string& marker) {
PerformAction(Action::REQUEST_CONNECTION);
}
+int BattOrAgent::Version() {
+ DCHECK(thread_checker_.CalledOnValidThread());
charliea (OOO until 10-5) 2016/10/04 15:15:48 So after you make this look like: void BattOrAgen
+ return 1; // Actually return here.
+ return battor_eeprom_->version;
+}
+
void BattOrAgent::BeginConnect() {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -187,6 +193,8 @@ void BattOrAgent::OnConnectionOpened(bool success) {
case Command::RECORD_CLOCK_SYNC_MARKER:
PerformAction(Action::SEND_CURRENT_SAMPLE_REQUEST);
return;
+ case Command::VERSION:
+ return;
case Command::INVALID:
NOTREACHED();
}
@@ -530,6 +538,10 @@ void BattOrAgent::CompleteCommand(BattOrError error) {
FROM_HERE, base::Bind(&Listener::OnRecordClockSyncMarkerComplete,
base::Unretained(listener_), error));
break;
+ case Command::VERSION:
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&Listener::OnGetVersionComplete,
+ base::Unretained(listener_), error));
case Command::INVALID:
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698