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

Side by Side Diff: tools/battor_agent/battor_agent.h

Issue 1991403002: [battor agent] Fix the init sequence so it retries inits instead of resets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comment Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/battor_agent/battor_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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,
98 SEND_INIT, 97 SEND_INIT,
99 READ_INIT_ACK, 98 READ_INIT_ACK,
100 SEND_SET_GAIN, 99 SEND_SET_GAIN,
101 READ_SET_GAIN_ACK, 100 READ_SET_GAIN_ACK,
102 SEND_START_TRACING, 101 SEND_START_TRACING,
103 READ_START_TRACING_ACK, 102 READ_START_TRACING_ACK,
104 103
105 // Actions required for stopping tracing. 104 // Actions required for stopping tracing.
106 SEND_EEPROM_REQUEST, 105 SEND_EEPROM_REQUEST,
107 READ_EEPROM, 106 READ_EEPROM,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // The first frame (required for calibration). 165 // The first frame (required for calibration).
167 std::vector<RawBattOrSample> calibration_frame_; 166 std::vector<RawBattOrSample> calibration_frame_;
168 167
169 // The actual data samples recorded. 168 // The actual data samples recorded.
170 std::vector<RawBattOrSample> samples_; 169 std::vector<RawBattOrSample> samples_;
171 170
172 // 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
173 // we receive frames in order. 172 // we receive frames in order.
174 uint32_t next_sequence_number_; 173 uint32_t next_sequence_number_;
175 174
175 // The number of times we've attempted to init the BattOr.
176 uint8_t num_init_attempts_;
177
176 // The number of times that we've attempted to read the last message. 178 // The number of times that we've attempted to read the last message.
177 uint8_t num_read_attempts_; 179 uint8_t num_read_attempts_;
178 180
179 // The timeout that's run when an action times out. 181 // The timeout that's run when an action times out.
180 base::CancelableClosure timeout_callback_; 182 base::CancelableClosure timeout_callback_;
181 183
182 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); 184 DISALLOW_COPY_AND_ASSIGN(BattOrAgent);
183 }; 185 };
184 186
185 } // namespace battor 187 } // namespace battor
186 188
187 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_ 189 #endif // TOOLS_BATTOR_AGENT_BATTOR_AGENT_H_
OLDNEW
« no previous file with comments | « no previous file | tools/battor_agent/battor_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698