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

Unified Diff: chrome/browser/extensions/api/serial/serial_connection_posix.cc

Issue 107363002: Support custom serial bitrates on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/serial/serial_connection_posix.cc
diff --git a/chrome/browser/extensions/api/serial/serial_connection_posix.cc b/chrome/browser/extensions/api/serial/serial_connection_posix.cc
index b1ad1dca317dd01ab87040dc48ea7b44f121d683..18a2119a586248e8dd87f18a6f25572784812ea2 100644
--- a/chrome/browser/extensions/api/serial/serial_connection_posix.cc
+++ b/chrome/browser/extensions/api/serial/serial_connection_posix.cc
@@ -11,6 +11,10 @@
#include <linux/serial.h>
#endif
+#if defined(OS_MACOSX)
+#include <IOKit/serial/ioss.h>
+#endif
+
namespace extensions {
namespace {
@@ -101,6 +105,9 @@ bool SetCustomBitrate(base::PlatformFile file,
cfsetispeed(config, B38400);
cfsetospeed(config, B38400);
return ioctl(file, TIOCSSERIAL, &serial) >= 0;
+#elif defined(OS_MACOSX)
+ speed_t speed = static_cast<speed_t>(bitrate);
+ return ioctl(file, IOSSIOSPEED, &speed) != -1;
#else
return false;
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698