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

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

Issue 1128943005: Implement break signal for serial api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histogram, VLOG Created 5 years, 6 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 | « no previous file | device/serial/serial_io_handler_posix.h » ('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_SERIAL_IO_HANDLER_H_ 5 #ifndef DEVICE_SERIAL_SERIAL_IO_HANDLER_H_
6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_H_ 6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 // Performs platform-specific port configuration. Returns |true| iff 77 // Performs platform-specific port configuration. Returns |true| iff
78 // configuration was successful. 78 // configuration was successful.
79 bool ConfigurePort(const serial::ConnectionOptions& options); 79 bool ConfigurePort(const serial::ConnectionOptions& options);
80 80
81 // Performs a platform-specific port configuration query. Fills values in an 81 // Performs a platform-specific port configuration query. Fills values in an
82 // existing ConnectionInfo. Returns |true| iff port configuration was 82 // existing ConnectionInfo. Returns |true| iff port configuration was
83 // successfully retrieved. 83 // successfully retrieved.
84 virtual serial::ConnectionInfoPtr GetPortInfo() const = 0; 84 virtual serial::ConnectionInfoPtr GetPortInfo() const = 0;
85 85
86 // Initiates a BREAK signal. Places the transmission line in a break state
87 // until the |ClearBreak| is called.
88 virtual bool SetBreak() = 0;
89
90 // Terminates the BREAK signal. Places the transmission line in a nonbreak
91 // state.
92 virtual bool ClearBreak() = 0;
93
86 protected: 94 protected:
87 explicit SerialIoHandler( 95 explicit SerialIoHandler(
88 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, 96 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner,
89 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); 97 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner);
90 virtual ~SerialIoHandler(); 98 virtual ~SerialIoHandler();
91 99
92 // Performs a platform-specific read operation. This must guarantee that 100 // Performs a platform-specific read operation. This must guarantee that
93 // ReadCompleted is called when the underlying async operation is completed 101 // ReadCompleted is called when the underlying async operation is completed
94 // or the SerialIoHandler instance will leak. 102 // or the SerialIoHandler instance will leak.
95 // NOTE: Implementations of ReadImpl should never call ReadCompleted directly. 103 // NOTE: Implementations of ReadImpl should never call ReadCompleted directly.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_; 220 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner_;
213 // On Chrome OS, PermissionBrokerClient should be called on the UI thread. 221 // On Chrome OS, PermissionBrokerClient should be called on the UI thread.
214 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_; 222 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_;
215 223
216 DISALLOW_COPY_AND_ASSIGN(SerialIoHandler); 224 DISALLOW_COPY_AND_ASSIGN(SerialIoHandler);
217 }; 225 };
218 226
219 } // namespace device 227 } // namespace device
220 228
221 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_H_ 229 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | device/serial/serial_io_handler_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698