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 import "data_stream.mojom" |
| 6 |
5 module device.serial { | 7 module device.serial { |
6 | 8 |
7 struct DeviceInfo { | 9 struct DeviceInfo { |
8 string? path; | 10 string? path; |
9 uint16 vendor_id; | 11 uint16 vendor_id; |
10 bool has_vendor_id = false; | 12 bool has_vendor_id = false; |
11 uint16 product_id; | 13 uint16 product_id; |
12 bool has_product_id = false; | 14 bool has_product_id = false; |
13 string? display_name; | 15 string? display_name; |
14 }; | 16 }; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bool dcd; | 78 bool dcd; |
77 bool cts; | 79 bool cts; |
78 bool ri; | 80 bool ri; |
79 bool dsr; | 81 bool dsr; |
80 }; | 82 }; |
81 | 83 |
82 interface SerialService { | 84 interface SerialService { |
83 GetDevices() => (DeviceInfo?[]? devices); | 85 GetDevices() => (DeviceInfo?[]? devices); |
84 | 86 |
85 // Creates a |Connection| to |path| with options specified by |options|, | 87 // Creates a |Connection| to |path| with options specified by |options|, |
86 // returning it via |connection|. This will fail and |connection| will not be | 88 // returning it via |connection|. Sending and receiving data over this |
87 // usable if |path| does not specify a valid serial device or there is an | 89 // connection is handled by |sink| and |source|, respectively. This will fail |
88 // error connecting to or configuring the connection. | 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 |
| 92 // connection. |
89 Connect(string? path, | 93 Connect(string? path, |
90 ConnectionOptions? options, | 94 ConnectionOptions? options, |
91 Connection&? connection); | 95 Connection&? connection, |
| 96 DataSink&? sink, |
| 97 DataSource&? source); |
92 }; | 98 }; |
93 | 99 |
94 interface Connection { | 100 interface Connection { |
95 GetInfo() => (ConnectionInfo? info); | 101 GetInfo() => (ConnectionInfo? info); |
96 SetOptions(ConnectionOptions? options) => (bool success); | 102 SetOptions(ConnectionOptions? options) => (bool success); |
97 SetControlSignals(HostControlSignals? signals) => (bool success); | 103 SetControlSignals(HostControlSignals? signals) => (bool success); |
98 GetControlSignals() => (DeviceControlSignals? signals); | 104 GetControlSignals() => (DeviceControlSignals? signals); |
99 Flush() => (bool success); | 105 Flush() => (bool success); |
100 }; | 106 }; |
101 | 107 |
102 } | 108 } |
OLD | NEW |