| Index: tools/battor_agent/battor_connection_impl.cc
|
| diff --git a/tools/battor_agent/battor_connection_impl.cc b/tools/battor_agent/battor_connection_impl.cc
|
| index cf33c2ab97b18e1359f077f192117aae2840b6b5..849637bf8dde71fedc214c68684084137b17aa9c 100644
|
| --- a/tools/battor_agent/battor_connection_impl.cc
|
| +++ b/tools/battor_agent/battor_connection_impl.cc
|
| @@ -228,9 +228,17 @@ void BattOrConnectionImpl::OnBytesRead(int bytes_read,
|
| return;
|
| }
|
|
|
| - LogSerial(StringPrintf(
|
| - "%d more bytes read: %s.", bytes_read,
|
| - CharArrayToString(pending_read_buffer_->data(), bytes_read).c_str()));
|
| + if (pending_read_message_type_ == BATTOR_MESSAGE_TYPE_SAMPLES) {
|
| + // If we're reading samples, don't log every byte that we receive. This
|
| + // exacerbates a problem on Mac wherein we can't process sample frames
|
| + // quickly enough to prevent the serial buffer from overflowing, causing us
|
| + // to drop frames.
|
| + LogSerial(StringPrintf("%d more bytes read.", bytes_read));
|
| + } else {
|
| + LogSerial(StringPrintf(
|
| + "%d more bytes read: %s.", bytes_read,
|
| + CharArrayToString(pending_read_buffer_->data(), bytes_read).c_str()));
|
| + }
|
|
|
| already_read_buffer_.insert(already_read_buffer_.end(),
|
| pending_read_buffer_->data(),
|
|
|