| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module device.serial; |
| |
| struct DeviceInfo { |
| string path; |
| uint16 vendor_id; |
| bool has_vendor_id = false; |
| uint16 product_id; |
| bool has_product_id = false; |
| string? display_name; |
| }; |
| |
| enum SendError { |
| NONE, |
| DISCONNECTED, |
| PENDING, |
| TIMEOUT, |
| SYSTEM_ERROR, |
| }; |
| |
| enum ReceiveError { |
| NONE, |
| DISCONNECTED, |
| TIMEOUT, |
| DEVICE_LOST, |
| BREAK, |
| FRAME_ERROR, |
| OVERRUN, |
| BUFFER_OVERFLOW, |
| PARITY_ERROR, |
| SYSTEM_ERROR, |
| }; |
| |
| enum DataBits { |
| NONE, |
| SEVEN, |
| EIGHT, |
| }; |
| |
| enum ParityBit { |
| NONE, |
| NO_PARITY, |
| ODD, |
| EVEN, |
| }; |
| |
| enum StopBits { |
| NONE, |
| ONE, |
| TWO, |
| }; |
| |
| struct ConnectionOptions { |
| uint32 bitrate = 0; |
| DataBits data_bits = NONE; |
| ParityBit parity_bit = NONE; |
| StopBits stop_bits = NONE; |
| bool cts_flow_control; |
| bool has_cts_flow_control = false; |
| }; |
| |
| struct ConnectionInfo { |
| uint32 bitrate = 0; |
| DataBits data_bits = NONE; |
| ParityBit parity_bit = NONE; |
| StopBits stop_bits = NONE; |
| bool cts_flow_control; |
| }; |
| |
| struct HostControlSignals { |
| bool dtr; |
| bool has_dtr = false; |
| bool rts; |
| bool has_rts = false; |
| }; |
| |
| struct DeviceControlSignals { |
| bool dcd; |
| bool cts; |
| bool ri; |
| bool dsr; |
| }; |