| Index: device/serial/test_serial_io_handler.cc
|
| diff --git a/device/serial/test_serial_io_handler.cc b/device/serial/test_serial_io_handler.cc
|
| index 8ec564851cb50205f4446efa7ad1b9f763dbb228..9713c070f98bd1f44fc6a737eb1c42d941f48d88 100644
|
| --- a/device/serial/test_serial_io_handler.cc
|
| +++ b/device/serial/test_serial_io_handler.cc
|
| @@ -24,27 +24,14 @@ scoped_refptr<SerialIoHandler> TestSerialIoHandler::Create() {
|
| }
|
|
|
| void TestSerialIoHandler::Open(const std::string& port,
|
| + const serial::ConnectionOptions& options,
|
| const OpenCompleteCallback& callback) {
|
| DCHECK(!opened_);
|
| opened_ = true;
|
| + ConfigurePort(options);
|
| callback.Run(true);
|
| }
|
|
|
| -bool TestSerialIoHandler::ConfigurePort(
|
| - const serial::ConnectionOptions& options) {
|
| - if (options.bitrate)
|
| - info_.bitrate = options.bitrate;
|
| - if (options.data_bits != serial::DATA_BITS_NONE)
|
| - info_.data_bits = options.data_bits;
|
| - if (options.parity_bit != serial::PARITY_BIT_NONE)
|
| - info_.parity_bit = options.parity_bit;
|
| - if (options.stop_bits != serial::STOP_BITS_NONE)
|
| - info_.stop_bits = options.stop_bits;
|
| - if (options.has_cts_flow_control)
|
| - info_.cts_flow_control = options.cts_flow_control;
|
| - return true;
|
| -}
|
| -
|
| void TestSerialIoHandler::ReadImpl() {
|
| if (!pending_read_buffer())
|
| return;
|
| @@ -79,6 +66,15 @@ void TestSerialIoHandler::CancelWriteImpl() {
|
| WriteCompleted(0, write_cancel_reason());
|
| }
|
|
|
| +bool TestSerialIoHandler::ConfigurePortImpl() {
|
| + info_.bitrate = options().bitrate;
|
| + info_.data_bits = options().data_bits;
|
| + info_.parity_bit = options().parity_bit;
|
| + info_.stop_bits = options().stop_bits;
|
| + info_.cts_flow_control = options().cts_flow_control;
|
| + return true;
|
| +}
|
| +
|
| serial::DeviceControlSignalsPtr TestSerialIoHandler::GetControlSignals() const {
|
| serial::DeviceControlSignalsPtr signals(serial::DeviceControlSignals::New());
|
| *signals = device_control_signals_;
|
|
|