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 #ifndef DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ | 5 #ifndef DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ |
6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ | 6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
11 #include "device/serial/serial_io_handler.h" | 11 #include "device/serial/serial_io_handler.h" |
12 | 12 |
13 namespace device { | 13 namespace device { |
14 | 14 |
15 class SerialIoHandlerPosix : public SerialIoHandler, | 15 class SerialIoHandlerPosix : public SerialIoHandler, |
16 public base::MessageLoopForIO::Watcher { | 16 public base::MessageLoopForIO::Watcher { |
17 protected: | 17 protected: |
18 // SerialIoHandler impl. | 18 // SerialIoHandler impl. |
19 void ReadImpl() override; | 19 void ReadImpl() override; |
20 void WriteImpl() override; | 20 void WriteImpl() override; |
21 void CancelReadImpl() override; | 21 void CancelReadImpl() override; |
22 void CancelWriteImpl() override; | 22 void CancelWriteImpl() override; |
23 bool ConfigurePortImpl() override; | 23 bool ConfigurePortImpl() override; |
24 bool Flush() const override; | 24 bool Flush() const override; |
25 serial::DeviceControlSignalsPtr GetControlSignals() const override; | 25 serial::DeviceControlSignalsPtr GetControlSignals() const override; |
26 bool SetControlSignals( | 26 bool SetControlSignals( |
27 const serial::HostControlSignals& control_signals) override; | 27 const serial::HostControlSignals& control_signals) override; |
28 serial::ConnectionInfoPtr GetPortInfo() const override; | 28 serial::ConnectionInfoPtr GetPortInfo() const override; |
| 29 bool SetBreak() override; |
| 30 bool ClearBreak() override; |
29 void RequestAccess( | 31 void RequestAccess( |
30 const std::string& port, | 32 const std::string& port, |
31 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, | 33 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
32 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) override; | 34 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) override; |
33 | 35 |
34 private: | 36 private: |
35 friend class SerialIoHandler; | 37 friend class SerialIoHandler; |
36 | 38 |
37 SerialIoHandlerPosix( | 39 SerialIoHandlerPosix( |
38 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
(...skipping 13 matching lines...) Expand all Loading... |
52 // Flags indicating if the message loop is watching the device for IO events. | 54 // Flags indicating if the message loop is watching the device for IO events. |
53 bool is_watching_reads_; | 55 bool is_watching_reads_; |
54 bool is_watching_writes_; | 56 bool is_watching_writes_; |
55 | 57 |
56 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerPosix); | 58 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerPosix); |
57 }; | 59 }; |
58 | 60 |
59 } // namespace device | 61 } // namespace device |
60 | 62 |
61 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ | 63 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ |
OLD | NEW |