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_AGENT_H_ | 5 #ifndef TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ |
6 #define TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ | 6 #define TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void BeginConnect(); | 106 void BeginConnect(); |
107 | 107 |
108 // Sends a control message over the connection. | 108 // Sends a control message over the connection. |
109 void SendControlMessage(BattOrControlMessageType type, | 109 void SendControlMessage(BattOrControlMessageType type, |
110 uint16_t param1, | 110 uint16_t param1, |
111 uint16_t param2); | 111 uint16_t param2); |
112 | 112 |
113 // Completes the command with the specified error. | 113 // Completes the command with the specified error. |
114 void CompleteCommand(BattOrError error); | 114 void CompleteCommand(BattOrError error); |
115 | 115 |
| 116 // Returns a formatted version of samples_ with timestamps and real units. |
| 117 std::string SamplesToString(); |
| 118 |
116 // The listener that handles the commands' results. It must outlive the agent. | 119 // The listener that handles the commands' results. It must outlive the agent. |
117 Listener* listener_; | 120 Listener* listener_; |
118 | 121 |
119 // The last action executed by the agent. This should only be updated in | 122 // The last action executed by the agent. This should only be updated in |
120 // PerformAction(). | 123 // PerformAction(). |
121 Action last_action_; | 124 Action last_action_; |
122 | 125 |
123 // The tracing command currently being executed by the agent. | 126 // The tracing command currently being executed by the agent. |
124 Command command_; | 127 Command command_; |
125 | 128 |
(...skipping 11 matching lines...) Expand all Loading... |
137 | 140 |
138 // The number of times that we've attempted to read the last message. | 141 // The number of times that we've attempted to read the last message. |
139 uint8_t num_read_attempts_; | 142 uint8_t num_read_attempts_; |
140 | 143 |
141 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); | 144 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); |
142 }; | 145 }; |
143 | 146 |
144 } // namespace battor | 147 } // namespace battor |
145 | 148 |
146 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ | 149 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ |
OLD | NEW |