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.
7 import "data_stream.mojom";
12 bool has_vendor_id = false;
14 bool has_product_id = false;
58 struct ConnectionOptions {
60 DataBits data_bits = NONE;
61 ParityBit parity_bit = NONE;
62 StopBits stop_bits = NONE;
63 bool cts_flow_control;
64 bool has_cts_flow_control = false;
67 struct ConnectionInfo {
69 DataBits data_bits = NONE;
70 ParityBit parity_bit = NONE;
71 StopBits stop_bits = NONE;
72 bool cts_flow_control;
75 struct HostControlSignals {
82 struct DeviceControlSignals {
89 interface SerialService {
90 GetDevices() => (array<DeviceInfo> devices);
92 // Creates a |Connection| to |path| with options specified by |options|,
93 // returning it via |connection|. Sending and receiving data over this
94 // connection is handled by |sink| and |source|, respectively. This will fail
95 // and |connection| will not be usable if |path| does not specify a valid
96 // serial device or there is an error connecting to or configuring the
99 ConnectionOptions? options,
100 Connection& connection,
103 DataSourceClient source_client);
106 interface Connection {
107 GetInfo() => (ConnectionInfo? info);
108 SetOptions(ConnectionOptions options) => (bool success);
109 SetControlSignals(HostControlSignals signals) => (bool success);
110 GetControlSignals() => (DeviceControlSignals? signals);
111 Flush() => (bool success);