Chromium Code Reviews| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 RECORD_CLOCK_SYNC_MARKER, | 87 RECORD_CLOCK_SYNC_MARKER, |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 enum class Action { | 90 enum class Action { |
| 91 INVALID, | 91 INVALID, |
| 92 | 92 |
| 93 // Actions required to connect to a BattOr. | 93 // Actions required to connect to a BattOr. |
| 94 REQUEST_CONNECTION, | 94 REQUEST_CONNECTION, |
| 95 | 95 |
| 96 // Actions required for starting tracing. | 96 // Actions required for starting tracing. |
| 97 SEND_RESET, | 97 SEND_RESET, |
|
charliea (OOO until 10-5)
2016/05/23 14:08:52
This can be deleted
aschulman
2016/06/10 07:22:59
Done.
| |
| 98 SEND_INIT, | 98 SEND_INIT, |
| 99 READ_INIT_ACK, | 99 READ_INIT_ACK, |
| 100 SEND_SET_GAIN, | 100 SEND_SET_GAIN, |
| 101 READ_SET_GAIN_ACK, | 101 READ_SET_GAIN_ACK, |
| 102 SEND_START_TRACING, | 102 SEND_START_TRACING, |
| 103 READ_START_TRACING_ACK, | 103 READ_START_TRACING_ACK, |
| 104 | 104 |
| 105 // Actions required for stopping tracing. | 105 // Actions required for stopping tracing. |
| 106 SEND_EEPROM_REQUEST, | 106 SEND_EEPROM_REQUEST, |
| 107 READ_EEPROM, | 107 READ_EEPROM, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 // The actual data samples recorded. | 169 // The actual data samples recorded. |
| 170 std::vector<RawBattOrSample> samples_; | 170 std::vector<RawBattOrSample> samples_; |
| 171 | 171 |
| 172 // The expected sequence number of the next frame. We use this to ensure that | 172 // The expected sequence number of the next frame. We use this to ensure that |
| 173 // we receive frames in order. | 173 // we receive frames in order. |
| 174 uint32_t next_sequence_number_; | 174 uint32_t next_sequence_number_; |
| 175 | 175 |
| 176 // The number of times that we've attempted to read the last message. | 176 // The number of times that we've attempted to read the last message. |
| 177 uint8_t num_read_attempts_; | 177 uint8_t num_read_attempts_; |
| 178 | 178 |
| 179 // The number of times we've attempted to init the BattOr. | |
| 180 uint8_t num_init_attempts_; | |
| 181 | |
| 179 // The timeout that's run when an action times out. | 182 // The timeout that's run when an action times out. |
| 180 base::CancelableClosure timeout_callback_; | 183 base::CancelableClosure timeout_callback_; |
| 181 | 184 |
| 182 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); | 185 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); |
| 183 }; | 186 }; |
| 184 | 187 |
| 185 } // namespace battor | 188 } // namespace battor |
| 186 | 189 |
| 187 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ | 190 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ |
| OLD | NEW |