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

Unified Diff: device/serial/serial_io_handler_posix.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/serial/serial_io_handler_posix.h ('k') | device/serial/serial_io_handler_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_io_handler_posix.cc
diff --git a/device/serial/serial_io_handler_posix.cc b/device/serial/serial_io_handler_posix.cc
index 52aad173d397064ef9d9ddf6c54d76d8524b0a3e..91cd110ca3eb6ea49efd2a3efa51fe7b693c267c 100644
--- a/device/serial/serial_io_handler_posix.cc
+++ b/device/serial/serial_io_handler_posix.cc
@@ -472,6 +472,23 @@ serial::ConnectionInfoPtr SerialIoHandlerPosix::GetPortInfo() const {
return info.Pass();
}
+bool SerialIoHandlerPosix::SetBreak() {
+ if (ioctl(file().GetPlatformFile(), TIOCSBRK, 0) != 0) {
+ VPLOG(1) << "Failed to set break";
+ return false;
+ }
+
+ return true;
+}
+
+bool SerialIoHandlerPosix::ClearBreak() {
+ if (ioctl(file().GetPlatformFile(), TIOCCBRK, 0) != 0) {
+ VPLOG(1) << "Failed to clear break";
+ return false;
+ }
+ return true;
+}
+
std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) {
return port_name;
}
« no previous file with comments | « device/serial/serial_io_handler_posix.h ('k') | device/serial/serial_io_handler_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698