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_win.h" | 5 #include "device/serial/serial_io_handler_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <setupapi.h> | 8 #include <setupapi.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "device/core/device_info_query_win.h" | 14 #include "device/base/device_info_query_win.h" |
15 #include "device/core/device_monitor_win.h" | 15 #include "device/base/device_monitor_win.h" |
16 #include "third_party/re2/src/re2/re2.h" | 16 #include "third_party/re2/src/re2/re2.h" |
17 | 17 |
18 namespace device { | 18 namespace device { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 int BitrateToSpeedConstant(int bitrate) { | 22 int BitrateToSpeedConstant(int bitrate) { |
23 #define BITRATE_TO_SPEED_CASE(x) \ | 23 #define BITRATE_TO_SPEED_CASE(x) \ |
24 case x: \ | 24 case x: \ |
25 return CBR_##x; | 25 return CBR_##x; |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { | 526 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { |
527 // For COM numbers less than 9, CreateFile is called with a string such as | 527 // For COM numbers less than 9, CreateFile is called with a string such as |
528 // "COM1". For numbers greater than 9, a prefix of "\\\\.\\" must be added. | 528 // "COM1". For numbers greater than 9, a prefix of "\\\\.\\" must be added. |
529 if (port_name.length() > std::string("COM9").length()) | 529 if (port_name.length() > std::string("COM9").length()) |
530 return std::string("\\\\.\\").append(port_name); | 530 return std::string("\\\\.\\").append(port_name); |
531 | 531 |
532 return port_name; | 532 return port_name; |
533 } | 533 } |
534 | 534 |
535 } // namespace device | 535 } // namespace device |
OLD | NEW |