| 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.serial; | 5 module device.serial; |
| 6 | 6 |
| 7 import "data_stream.mojom"; | 7 import "data_stream.mojom"; |
| 8 | 8 |
| 9 struct DeviceInfo { | 9 struct DeviceInfo { |
| 10 string path; | 10 string path; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Creates a |Connection| to |path| with options specified by |options|, | 87 // Creates a |Connection| to |path| with options specified by |options|, |
| 88 // returning it via |connection|. Sending and receiving data over this | 88 // returning it via |connection|. Sending and receiving data over this |
| 89 // connection is handled by |sink| and |source|, respectively. This will fail | 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 | 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 | 91 // serial device or there is an error connecting to or configuring the |
| 92 // connection. | 92 // connection. |
| 93 Connect(string path, | 93 Connect(string path, |
| 94 ConnectionOptions? options, | 94 ConnectionOptions? options, |
| 95 Connection& connection, | 95 Connection& connection, |
| 96 DataSink& sink, | 96 DataSink& sink, |
| 97 DataSinkClient sink_client, | 97 DataSource& source); |
| 98 DataSource& source, | |
| 99 DataSourceClient source_client); | |
| 100 }; | 98 }; |
| 101 | 99 |
| 102 interface Connection { | 100 interface Connection { |
| 103 GetInfo() => (ConnectionInfo? info); | 101 GetInfo() => (ConnectionInfo? info); |
| 104 SetOptions(ConnectionOptions options) => (bool success); | 102 SetOptions(ConnectionOptions options) => (bool success); |
| 105 SetControlSignals(HostControlSignals signals) => (bool success); | 103 SetControlSignals(HostControlSignals signals) => (bool success); |
| 106 GetControlSignals() => (DeviceControlSignals? signals); | 104 GetControlSignals() => (DeviceControlSignals? signals); |
| 107 Flush() => (bool success); | 105 Flush() => (bool success); |
| 108 }; | 106 }; |
| OLD | NEW |