| 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 "device/serial/serial_connection.h" | 5 #include "device/serial/serial_connection.h" |
| 6 | 6 |
| 7 #include "device/serial/serial_io_handler.h" | 7 #include "device/serial/serial_io_handler.h" |
| 8 | 8 |
| 9 namespace device { | 9 namespace device { |
| 10 | 10 |
| 11 SerialConnection::SerialConnection(scoped_refptr<SerialIoHandler> io_handler) | 11 SerialConnection::SerialConnection(scoped_refptr<SerialIoHandler> io_handler) |
| 12 : io_handler_(io_handler) { | 12 : io_handler_(io_handler) { |
| 13 // TODO(sammc): Call io_handler_->Initialize() once we support send and recv. | |
| 14 } | 13 } |
| 15 | 14 |
| 16 SerialConnection::~SerialConnection() { | 15 SerialConnection::~SerialConnection() { |
| 17 } | 16 } |
| 18 | 17 |
| 19 void SerialConnection::GetInfo( | 18 void SerialConnection::GetInfo( |
| 20 const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback) { | 19 const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback) { |
| 21 callback.Run(io_handler_->GetPortInfo()); | 20 callback.Run(io_handler_->GetPortInfo()); |
| 22 } | 21 } |
| 23 | 22 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 36 void SerialConnection::GetControlSignals( | 35 void SerialConnection::GetControlSignals( |
| 37 const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback) { | 36 const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback) { |
| 38 callback.Run(io_handler_->GetControlSignals()); | 37 callback.Run(io_handler_->GetControlSignals()); |
| 39 } | 38 } |
| 40 | 39 |
| 41 void SerialConnection::Flush(const mojo::Callback<void(bool)>& callback) { | 40 void SerialConnection::Flush(const mojo::Callback<void(bool)>& callback) { |
| 42 callback.Run(io_handler_->Flush()); | 41 callback.Run(io_handler_->Flush()); |
| 43 } | 42 } |
| 44 | 43 |
| 45 } // namespace device | 44 } // namespace device |
| OLD | NEW |