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 #include "device/serial/serial_io_handler_posix.h" | 5 #include "device/serial/serial_io_handler_posix.h" |
6 | 6 |
7 #include <sys/ioctl.h> | 7 #include <sys/ioctl.h> |
8 #include <termios.h> | 8 #include <termios.h> |
9 | 9 |
10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
| 11 #include "build/build_config.h" |
11 | 12 |
12 #if defined(OS_LINUX) | 13 #if defined(OS_LINUX) |
13 #include <linux/serial.h> | 14 #include <linux/serial.h> |
14 | 15 |
15 // The definition of struct termios2 is copied from asm-generic/termbits.h | 16 // The definition of struct termios2 is copied from asm-generic/termbits.h |
16 // because including that header directly conflicts with termios.h. | 17 // because including that header directly conflicts with termios.h. |
17 extern "C" { | 18 extern "C" { |
18 struct termios2 { | 19 struct termios2 { |
19 tcflag_t c_iflag; // input mode flags | 20 tcflag_t c_iflag; // input mode flags |
20 tcflag_t c_oflag; // output mode flags | 21 tcflag_t c_oflag; // output mode flags |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 memcpy(buffer, chars_stashed_, std::min(new_bytes_read, 2)); | 612 memcpy(buffer, chars_stashed_, std::min(new_bytes_read, 2)); |
612 memcpy(chars_stashed_, tmp, num_chars_stashed_); | 613 memcpy(chars_stashed_, tmp, num_chars_stashed_); |
613 return new_bytes_read; | 614 return new_bytes_read; |
614 } | 615 } |
615 | 616 |
616 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { | 617 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { |
617 return port_name; | 618 return port_name; |
618 } | 619 } |
619 | 620 |
620 } // namespace device | 621 } // namespace device |
OLD | NEW |