| 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 "extensions/browser/api/serial/serial_connection.h" | 5 #include "extensions/browser/api/serial/serial_connection.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return device::serial::DataBits::NONE; | 91 return device::serial::DataBits::NONE; |
| 92 } | 92 } |
| 93 | 93 |
| 94 api::serial::ParityBit ConvertParityBitFromMojo( | 94 api::serial::ParityBit ConvertParityBitFromMojo( |
| 95 device::serial::ParityBit input) { | 95 device::serial::ParityBit input) { |
| 96 switch (input) { | 96 switch (input) { |
| 97 case device::serial::ParityBit::NONE: | 97 case device::serial::ParityBit::NONE: |
| 98 return api::serial::PARITY_BIT_NONE; | 98 return api::serial::PARITY_BIT_NONE; |
| 99 case device::serial::ParityBit::ODD: | 99 case device::serial::ParityBit::ODD: |
| 100 return api::serial::PARITY_BIT_ODD; | 100 return api::serial::PARITY_BIT_ODD; |
| 101 case device::serial::ParityBit::NO: | 101 case device::serial::ParityBit::NO_PARITY: |
| 102 return api::serial::PARITY_BIT_NO; | 102 return api::serial::PARITY_BIT_NO; |
| 103 case device::serial::ParityBit::EVEN: | 103 case device::serial::ParityBit::EVEN: |
| 104 return api::serial::PARITY_BIT_EVEN; | 104 return api::serial::PARITY_BIT_EVEN; |
| 105 } | 105 } |
| 106 return api::serial::PARITY_BIT_NONE; | 106 return api::serial::PARITY_BIT_NONE; |
| 107 } | 107 } |
| 108 | 108 |
| 109 device::serial::ParityBit ConvertParityBitToMojo(api::serial::ParityBit input) { | 109 device::serial::ParityBit ConvertParityBitToMojo(api::serial::ParityBit input) { |
| 110 switch (input) { | 110 switch (input) { |
| 111 case api::serial::PARITY_BIT_NONE: | 111 case api::serial::PARITY_BIT_NONE: |
| 112 return device::serial::ParityBit::NONE; | 112 return device::serial::ParityBit::NONE; |
| 113 case api::serial::PARITY_BIT_NO: | 113 case api::serial::PARITY_BIT_NO: |
| 114 return device::serial::ParityBit::NO; | 114 return device::serial::ParityBit::NO_PARITY; |
| 115 case api::serial::PARITY_BIT_ODD: | 115 case api::serial::PARITY_BIT_ODD: |
| 116 return device::serial::ParityBit::ODD; | 116 return device::serial::ParityBit::ODD; |
| 117 case api::serial::PARITY_BIT_EVEN: | 117 case api::serial::PARITY_BIT_EVEN: |
| 118 return device::serial::ParityBit::EVEN; | 118 return device::serial::ParityBit::EVEN; |
| 119 } | 119 } |
| 120 return device::serial::ParityBit::NONE; | 120 return device::serial::ParityBit::NONE; |
| 121 } | 121 } |
| 122 | 122 |
| 123 api::serial::StopBits ConvertStopBitsFromMojo(device::serial::StopBits input) { | 123 api::serial::StopBits ConvertStopBitsFromMojo(device::serial::StopBits input) { |
| 124 switch (input) { | 124 switch (input) { |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); | 413 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); |
| 414 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); | 414 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); |
| 415 if (input.cts_flow_control.get()) { | 415 if (input.cts_flow_control.get()) { |
| 416 output->has_cts_flow_control = true; | 416 output->has_cts_flow_control = true; |
| 417 output->cts_flow_control = *input.cts_flow_control; | 417 output->cts_flow_control = *input.cts_flow_control; |
| 418 } | 418 } |
| 419 return output; | 419 return output; |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace mojo | 422 } // namespace mojo |
| OLD | NEW |