| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_H_ | 5 #ifndef TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_H_ |
| 6 #define TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_H_ | 6 #define TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // protocol. | 56 // protocol. |
| 57 virtual void SendBytes(BattOrMessageType type, | 57 virtual void SendBytes(BattOrMessageType type, |
| 58 const void* buffer, | 58 const void* buffer, |
| 59 size_t bytes_to_send) = 0; | 59 size_t bytes_to_send) = 0; |
| 60 | 60 |
| 61 // Gets the next message available from the serial connection, reading the | 61 // Gets the next message available from the serial connection, reading the |
| 62 // correct number of bytes based on the specified message type, and calls the | 62 // correct number of bytes based on the specified message type, and calls the |
| 63 // listener's OnMessageRead() when complete. | 63 // listener's OnMessageRead() when complete. |
| 64 virtual void ReadMessage(BattOrMessageType type) = 0; | 64 virtual void ReadMessage(BattOrMessageType type) = 0; |
| 65 | 65 |
| 66 // Cancels the current message read operation. |
| 67 virtual void CancelReadMessage() = 0; |
| 68 |
| 66 // Flushes the serial connection to the BattOr. | 69 // Flushes the serial connection to the BattOr. |
| 67 virtual void Flush() = 0; | 70 virtual void Flush() = 0; |
| 68 | 71 |
| 69 protected: | 72 protected: |
| 70 // The listener receiving the results of the commands being executed. | 73 // The listener receiving the results of the commands being executed. |
| 71 Listener* listener_; | 74 Listener* listener_; |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 DISALLOW_COPY_AND_ASSIGN(BattOrConnection); | 77 DISALLOW_COPY_AND_ASSIGN(BattOrConnection); |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } // namespace battor | 80 } // namespace battor |
| 78 | 81 |
| 79 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_H_ | 82 #endif // TOOLS_BATTOR_AGENT_BATTOR_CONNECTION_H_ |
| OLD | NEW |