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 module device { | 5 module device.serial { |
6 | 6 |
7 struct SerialDeviceInfo { | 7 struct DeviceInfo { |
8 string path; | 8 string path; |
9 uint16 vendor_id; | 9 uint16 vendor_id; |
10 bool has_vendor_id = false; | 10 bool has_vendor_id = false; |
11 uint16 product_id; | 11 uint16 product_id; |
12 bool has_product_id = false; | 12 bool has_product_id = false; |
13 string display_name; | 13 string display_name; |
14 }; | 14 }; |
15 | 15 |
| 16 enum SendError { |
| 17 SEND_ERROR_NONE, |
| 18 SEND_ERROR_DISCONNECTED, |
| 19 SEND_ERROR_PENDING, |
| 20 SEND_ERROR_TIMEOUT, |
| 21 SEND_ERROR_SYSTEM_ERROR, |
| 22 }; |
| 23 |
| 24 enum ReceiveError { |
| 25 RECEIVE_ERROR_NONE, |
| 26 RECEIVE_ERROR_DISCONNECTED, |
| 27 RECEIVE_ERROR_TIMEOUT, |
| 28 RECEIVE_ERROR_DEVICE_LOST, |
| 29 RECEIVE_ERROR_SYSTEM_ERROR, |
| 30 }; |
| 31 |
| 32 enum DataBits { |
| 33 DATA_BITS_NONE, |
| 34 DATA_BITS_SEVEN, |
| 35 DATA_BITS_EIGHT, |
| 36 }; |
| 37 |
| 38 enum ParityBit { |
| 39 PARITY_BIT_NONE, |
| 40 PARITY_BIT_NO, |
| 41 PARITY_BIT_ODD, |
| 42 PARITY_BIT_EVEN, |
| 43 }; |
| 44 |
| 45 enum StopBits { |
| 46 STOP_BITS_NONE, |
| 47 STOP_BITS_ONE, |
| 48 STOP_BITS_TWO, |
| 49 }; |
| 50 |
| 51 struct ConnectionOptions { |
| 52 uint32 bitrate = 0; |
| 53 DataBits data_bits = DATA_BITS_NONE; |
| 54 ParityBit parity_bit = PARITY_BIT_NONE; |
| 55 StopBits stop_bits = STOP_BITS_NONE; |
| 56 bool cts_flow_control; |
| 57 bool has_cts_flow_control = false; |
| 58 }; |
| 59 |
| 60 struct ConnectionInfo { |
| 61 uint32 bitrate = 0; |
| 62 DataBits data_bits = DATA_BITS_NONE; |
| 63 ParityBit parity_bit = PARITY_BIT_NONE; |
| 64 StopBits stop_bits = STOP_BITS_NONE; |
| 65 bool cts_flow_control; |
| 66 }; |
| 67 |
| 68 struct HostControlSignals { |
| 69 bool dtr; |
| 70 bool has_dtr = false; |
| 71 bool rts; |
| 72 bool has_rts = false; |
| 73 }; |
| 74 |
| 75 struct DeviceControlSignals { |
| 76 bool dcd; |
| 77 bool cts; |
| 78 bool ri; |
| 79 bool dsr; |
| 80 }; |
| 81 |
16 } | 82 } |
OLD | NEW |