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
3 // found in the LICENSE file.
5 import "data_stream.mojom"
12 bool has_vendor_id = false;
14 bool has_product_id = false;
53 struct ConnectionOptions {
55 DataBits data_bits = NONE;
56 ParityBit parity_bit = NONE;
57 StopBits stop_bits = NONE;
58 bool cts_flow_control;
59 bool has_cts_flow_control = false;
62 struct ConnectionInfo {
64 DataBits data_bits = NONE;
65 ParityBit parity_bit = NONE;
66 StopBits stop_bits = NONE;
67 bool cts_flow_control;
70 struct HostControlSignals {
77 struct DeviceControlSignals {
84 interface SerialService {
85 GetDevices() => (array<DeviceInfo> devices);
87 // Creates a |Connection| to |path| with options specified by |options|,
88 // returning it via |connection|. Sending and receiving data over this
89 // connection is handled by |sink| and |source|, respectively. This will fail
90 // and |connection| will not be usable if |path| does not specify a valid
91 // serial device or there is an error connecting to or configuring the
94 ConnectionOptions? options,
95 Connection& connection,
100 interface Connection {
101 GetInfo() => (ConnectionInfo? info);
102 SetOptions(ConnectionOptions options) => (bool success);
103 SetControlSignals(HostControlSignals signals) => (bool success);
104 GetControlSignals() => (DeviceControlSignals? signals);
105 Flush() => (bool success);