| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // The actual data samples recorded. | 168 // The actual data samples recorded. |
| 169 std::vector<RawBattOrSample> samples_; | 169 std::vector<RawBattOrSample> samples_; |
| 170 | 170 |
| 171 // The expected sequence number of the next frame. We use this to ensure that | 171 // The expected sequence number of the next frame. We use this to ensure that |
| 172 // we receive frames in order. | 172 // we receive frames in order. |
| 173 uint32_t next_sequence_number_; | 173 uint32_t next_sequence_number_; |
| 174 | 174 |
| 175 // The number of times we've attempted to init the BattOr. | 175 // The number of times we've attempted to init the BattOr. |
| 176 uint8_t num_init_attempts_; | 176 uint8_t num_init_attempts_; |
| 177 | 177 |
| 178 // The number of times that we've attempted to read the last message. | |
| 179 uint8_t num_read_attempts_; | |
| 180 | |
| 181 // The timeout that's run when an action times out. | 178 // The timeout that's run when an action times out. |
| 182 base::CancelableClosure timeout_callback_; | 179 base::CancelableClosure timeout_callback_; |
| 183 | 180 |
| 181 // First error that was encountered while reading frames. It is necessary |
| 182 // to handle read errors at the end of the read because the FTDI serial |
| 183 // device crashes on OSX if there is data that arrives in the FTDI device's |
| 184 // buffer after the file descriptor is closed. |
| 185 BattOrError read_frame_error_; |
| 186 |
| 184 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); | 187 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); |
| 185 }; | 188 }; |
| 186 | 189 |
| 187 } // namespace battor | 190 } // namespace battor |
| 188 | 191 |
| 189 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ | 192 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ |
| OLD | NEW |