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_TEST_SERIAL_IO_HANDLER_H_ | 5 #ifndef DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_ |
6 #define DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_ | 6 #define DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 virtual bool SetControlSignals( | 33 virtual bool SetControlSignals( |
34 const serial::HostControlSignals& signals) OVERRIDE; | 34 const serial::HostControlSignals& signals) OVERRIDE; |
35 | 35 |
36 serial::ConnectionInfo* connection_info() { return &info_; } | 36 serial::ConnectionInfo* connection_info() { return &info_; } |
37 serial::DeviceControlSignals* device_control_signals() { | 37 serial::DeviceControlSignals* device_control_signals() { |
38 return &device_control_signals_; | 38 return &device_control_signals_; |
39 } | 39 } |
40 bool dtr() { return dtr_; } | 40 bool dtr() { return dtr_; } |
41 bool rts() { return rts_; } | 41 bool rts() { return rts_; } |
42 int flushes() { return flushes_; } | 42 int flushes() { return flushes_; } |
| 43 void set_send_callback(const base::Closure& callback) { |
| 44 send_callback_ = callback; |
| 45 } |
43 | 46 |
44 protected: | 47 protected: |
45 virtual ~TestSerialIoHandler(); | 48 virtual ~TestSerialIoHandler(); |
46 | 49 |
47 private: | 50 private: |
48 bool opened_; | 51 bool opened_; |
49 serial::ConnectionInfo info_; | 52 serial::ConnectionInfo info_; |
50 serial::DeviceControlSignals device_control_signals_; | 53 serial::DeviceControlSignals device_control_signals_; |
51 bool dtr_; | 54 bool dtr_; |
52 bool rts_; | 55 bool rts_; |
53 mutable int flushes_; | 56 mutable int flushes_; |
| 57 std::string buffer_; |
| 58 base::Closure send_callback_; |
54 | 59 |
55 DISALLOW_COPY_AND_ASSIGN(TestSerialIoHandler); | 60 DISALLOW_COPY_AND_ASSIGN(TestSerialIoHandler); |
56 }; | 61 }; |
57 | 62 |
58 } // namespace device | 63 } // namespace device |
59 | 64 |
60 #endif // DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_ | 65 #endif // DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_ |
OLD | NEW |