Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: device/serial/test_serial_io_handler.h

Issue 488363002: Implement the host side of serial connection I/O on data pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win x64 build Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/serial/serial_service_unittest.cc ('k') | device/serial/test_serial_io_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // This callback will be called when this IoHandler processes its next write,
44 // instead of the normal behavior of echoing the data to reads.
45 void set_send_callback(const base::Closure& callback) {
46 send_callback_ = callback;
47 }
43 48
44 protected: 49 protected:
45 virtual ~TestSerialIoHandler(); 50 virtual ~TestSerialIoHandler();
46 51
47 private: 52 private:
48 bool opened_; 53 bool opened_;
49 serial::ConnectionInfo info_; 54 serial::ConnectionInfo info_;
50 serial::DeviceControlSignals device_control_signals_; 55 serial::DeviceControlSignals device_control_signals_;
51 bool dtr_; 56 bool dtr_;
52 bool rts_; 57 bool rts_;
53 mutable int flushes_; 58 mutable int flushes_;
59 std::string buffer_;
60 base::Closure send_callback_;
54 61
55 DISALLOW_COPY_AND_ASSIGN(TestSerialIoHandler); 62 DISALLOW_COPY_AND_ASSIGN(TestSerialIoHandler);
56 }; 63 };
57 64
58 } // namespace device 65 } // namespace device
59 66
60 #endif // DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_ 67 #endif // DEVICE_SERIAL_TEST_SERIAL_IO_HANDLER_H_
OLDNEW
« no previous file with comments | « device/serial/serial_service_unittest.cc ('k') | device/serial/test_serial_io_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698