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

Unified Diff: tools/battor_agent/battor_connection_impl.cc

Issue 1991403002: [battor agent] Fix the init sequence so it retries inits instead of resets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up and ready for a 2nd review Created 4 years, 6 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_connection_impl.cc
diff --git a/tools/battor_agent/battor_connection_impl.cc b/tools/battor_agent/battor_connection_impl.cc
index cc113a982906f354db84011fe34451bed2c0327e..787c8e0247864844ff133292238e716212779129 100644
--- a/tools/battor_agent/battor_connection_impl.cc
+++ b/tools/battor_agent/battor_connection_impl.cc
@@ -4,6 +4,8 @@
#include "tools/battor_agent/battor_connection_impl.h"
+#include <iostream>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
@@ -181,6 +183,10 @@ void BattOrConnectionImpl::ReadMessage(BattOrMessageType type) {
BeginReadBytes(message_max_bytes - already_read_buffer_.size());
}
+void BattOrConnectionImpl::CancelReadMessage() {
+ io_handler_->CancelRead(device::serial::ReceiveError::TIMEOUT);
+}
+
void BattOrConnectionImpl::Flush() {
io_handler_->Flush();
already_read_buffer_.clear();

Powered by Google App Engine
This is Rietveld 408576698