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

Unified Diff: tools/battor_agent/battor_connection_impl.h

Issue 1970243002: [battor agent] Add option to log serial communication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@char_array_to_str
Patch Set: Explicitly cast serial::ReceiveError Created 4 years, 7 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
« no previous file with comments | « no previous file | tools/battor_agent/battor_connection_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_connection_impl.h
diff --git a/tools/battor_agent/battor_connection_impl.h b/tools/battor_agent/battor_connection_impl.h
index e0ce5a20ffaebed0e37b2a6aa95f98db490fe13b..0631451beda0a698f03c956d1dfa2fa8bc604965 100644
--- a/tools/battor_agent/battor_connection_impl.h
+++ b/tools/battor_agent/battor_connection_impl.h
@@ -5,6 +5,7 @@
#ifndef TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_
#define TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_IMPL_H_
+#include <fstream>
#include <vector>
#include "base/callback_forward.h"
@@ -75,6 +76,9 @@ class BattOrConnectionImpl
// Internal callback for when bytes are sent.
void OnBytesSent(int bytes_sent, device::serial::SendError error);
+ // Appends |str| to the serial log file if it exists.
+ void LogSerial(const std::string& str);
+
// The path of the BattOr.
std::string path_;
@@ -93,6 +97,8 @@ class BattOrConnectionImpl
scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_;
+ std::fstream serial_log_;
+
DISALLOW_COPY_AND_ASSIGN(BattOrConnectionImpl);
};
« no previous file with comments | « no previous file | tools/battor_agent/battor_connection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698