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

Side by Side Diff: device/serial/serial_io_handler_win.cc

Issue 399353007: Revert of Change SPACEPARITY in the Windows serial api implementation to ODDPARITY. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | no next file » | 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 #include <windows.h> 5 #include <windows.h>
6 6
7 #include "device/serial/serial_io_handler_win.h" 7 #include "device/serial/serial_io_handler_win.h"
8 8
9 namespace device { 9 namespace device {
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 default: 46 default:
47 return 8; 47 return 8;
48 } 48 }
49 } 49 }
50 50
51 int ParityBitEnumToConstant(serial::ParityBit parity_bit) { 51 int ParityBitEnumToConstant(serial::ParityBit parity_bit) {
52 switch (parity_bit) { 52 switch (parity_bit) {
53 case serial::PARITY_BIT_EVEN: 53 case serial::PARITY_BIT_EVEN:
54 return EVENPARITY; 54 return EVENPARITY;
55 case serial::PARITY_BIT_ODD: 55 case serial::PARITY_BIT_ODD:
56 return ODDPARITY; 56 return SPACEPARITY;
57 case serial::PARITY_BIT_NO: 57 case serial::PARITY_BIT_NO:
58 default: 58 default:
59 return NOPARITY; 59 return NOPARITY;
60 } 60 }
61 } 61 }
62 62
63 int StopBitsEnumToConstant(serial::StopBits stop_bits) { 63 int StopBitsEnumToConstant(serial::StopBits stop_bits) {
64 switch (stop_bits) { 64 switch (stop_bits) {
65 case serial::STOP_BITS_TWO: 65 case serial::STOP_BITS_TWO:
66 return TWOSTOPBITS; 66 return TWOSTOPBITS;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) { 372 std::string SerialIoHandler::MaybeFixUpPortName(const std::string& port_name) {
373 // For COM numbers less than 9, CreateFile is called with a string such as 373 // For COM numbers less than 9, CreateFile is called with a string such as
374 // "COM1". For numbers greater than 9, a prefix of "\\\\.\\" must be added. 374 // "COM1". For numbers greater than 9, a prefix of "\\\\.\\" must be added.
375 if (port_name.length() > std::string("COM9").length()) 375 if (port_name.length() > std::string("COM9").length())
376 return std::string("\\\\.\\").append(port_name); 376 return std::string("\\\\.\\").append(port_name);
377 377
378 return port_name; 378 return port_name;
379 } 379 }
380 380
381 } // namespace device 381 } // namespace device
OLDNEW
« 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