| 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 struct DeviceInfo { | 7 struct DeviceInfo { |
| 8 string path; | 8 string? path; |
| 9 uint16 vendor_id; | 9 uint16 vendor_id; |
| 10 bool has_vendor_id = false; | 10 bool has_vendor_id = false; |
| 11 uint16 product_id; | 11 uint16 product_id; |
| 12 bool has_product_id = false; | 12 bool has_product_id = false; |
| 13 string display_name; | 13 string? display_name; |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 enum SendError { | 16 enum SendError { |
| 17 NONE, | 17 NONE, |
| 18 DISCONNECTED, | 18 DISCONNECTED, |
| 19 PENDING, | 19 PENDING, |
| 20 TIMEOUT, | 20 TIMEOUT, |
| 21 SYSTEM_ERROR, | 21 SYSTEM_ERROR, |
| 22 }; | 22 }; |
| 23 | 23 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Creates a |Connection| to |path| with options specified by |options|, | 85 // Creates a |Connection| to |path| with options specified by |options|, |
| 86 // returning it via |connection|. This will fail and |connection| will not be | 86 // returning it via |connection|. This will fail and |connection| will not be |
| 87 // usable if |path| does not specify a valid serial device or there is an | 87 // usable if |path| does not specify a valid serial device or there is an |
| 88 // error connecting to or configuring the connection. | 88 // error connecting to or configuring the connection. |
| 89 Connect(string path, | 89 Connect(string path, |
| 90 ConnectionOptions options, | 90 ConnectionOptions options, |
| 91 Connection& connection); | 91 Connection& connection); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 interface Connection { | 94 interface Connection { |
| 95 GetInfo() => (ConnectionInfo info); | 95 GetInfo() => (ConnectionInfo? info); |
| 96 SetOptions(ConnectionOptions options) => (bool success); | 96 SetOptions(ConnectionOptions options) => (bool success); |
| 97 SetControlSignals(HostControlSignals signals) => (bool success); | 97 SetControlSignals(HostControlSignals signals) => (bool success); |
| 98 GetControlSignals() => (DeviceControlSignals signals); | 98 GetControlSignals() => (DeviceControlSignals signals); |
| 99 Flush() => (bool success); | 99 Flush() => (bool success); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } | 102 } |
| OLD | NEW |