OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/browser/api/serial/serial_connection.h" | 5 #include "extensions/browser/api/serial/serial_connection.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 control_signals->dsr = signals->dsr; | 353 control_signals->dsr = signals->dsr; |
354 return true; | 354 return true; |
355 } | 355 } |
356 | 356 |
357 bool SerialConnection::SetControlSignals( | 357 bool SerialConnection::SetControlSignals( |
358 const core_api::serial::HostControlSignals& control_signals) { | 358 const core_api::serial::HostControlSignals& control_signals) { |
359 return io_handler_->SetControlSignals( | 359 return io_handler_->SetControlSignals( |
360 *device::serial::HostControlSignals::From(control_signals)); | 360 *device::serial::HostControlSignals::From(control_signals)); |
361 } | 361 } |
362 | 362 |
| 363 bool SerialConnection::SetBreak() { |
| 364 return io_handler_->SetBreak(); |
| 365 } |
| 366 |
| 367 bool SerialConnection::ClearBreak() { |
| 368 return io_handler_->ClearBreak(); |
| 369 } |
| 370 |
363 void SerialConnection::OnReceiveTimeout() { | 371 void SerialConnection::OnReceiveTimeout() { |
364 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 372 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
365 io_handler_->CancelRead(device::serial::RECEIVE_ERROR_TIMEOUT); | 373 io_handler_->CancelRead(device::serial::RECEIVE_ERROR_TIMEOUT); |
366 } | 374 } |
367 | 375 |
368 void SerialConnection::OnSendTimeout() { | 376 void SerialConnection::OnSendTimeout() { |
369 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 377 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
370 io_handler_->CancelWrite(device::serial::SEND_ERROR_TIMEOUT); | 378 io_handler_->CancelWrite(device::serial::SEND_ERROR_TIMEOUT); |
371 } | 379 } |
372 | 380 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); | 452 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); |
445 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); | 453 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); |
446 if (input.cts_flow_control.get()) { | 454 if (input.cts_flow_control.get()) { |
447 output->has_cts_flow_control = true; | 455 output->has_cts_flow_control = true; |
448 output->cts_flow_control = *input.cts_flow_control; | 456 output->cts_flow_control = *input.cts_flow_control; |
449 } | 457 } |
450 return output.Pass(); | 458 return output.Pass(); |
451 } | 459 } |
452 | 460 |
453 } // namespace mojo | 461 } // namespace mojo |
OLD | NEW |