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

Unified Diff: tools/battor_agent/battor_connection.h

Issue 1567683002: Makes the BattOrConnection read messages instead of bytes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 4 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
« no previous file with comments | « tools/battor_agent/battor_agent_unittest.cc ('k') | tools/battor_agent/battor_connection_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_connection.h
diff --git a/tools/battor_agent/battor_connection.h b/tools/battor_agent/battor_connection.h
index 6da8be35828adcc291b142a07ffc518437cf99e3..9b8442995a64b446bf8768d49d4d8b56ddc752e8 100644
--- a/tools/battor_agent/battor_connection.h
+++ b/tools/battor_agent/battor_connection.h
@@ -34,9 +34,9 @@ class BattOrConnection {
public:
virtual void OnConnectionOpened(bool success) = 0;
virtual void OnBytesSent(bool success) = 0;
- virtual void OnBytesRead(bool success,
- BattOrMessageType type,
- scoped_ptr<std::vector<char>> bytes) = 0;
+ virtual void OnMessageRead(bool success,
+ BattOrMessageType type,
+ scoped_ptr<std::vector<char>> bytes) = 0;
};
BattOrConnection(Listener* listener);
@@ -58,12 +58,10 @@ class BattOrConnection {
const void* buffer,
size_t bytes_to_send) = 0;
- // Reads the specified number of bytes from the serial connection and calls
- // the listener's OnBytesRead() when complete. Note that the number of bytes
- // requested should not include the start, end, or type bytes required by the
- // BattOr protocol, and that this method may issue multiple read read requests
- // if the message contains escape characters.
- virtual void ReadBytes(size_t bytes_to_read) = 0;
+ // Gets the next message available from the serial connection, reading the
+ // correct number of bytes based on the specified message type, and calls the
+ // listener's OnMessageRead() when complete.
+ virtual void ReadMessage(BattOrMessageType type) = 0;
// Flushes the serial connection to the BattOr.
virtual void Flush() = 0;
« no previous file with comments | « tools/battor_agent/battor_agent_unittest.cc ('k') | tools/battor_agent/battor_connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698