Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1328)

Side by Side Diff: chrome/common/extensions/api/serial.idl

Issue 22804008: Adds Serial API to set data bits, parity, stop bits. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Use the <code>chrome.serial</code> API to read from and write to a device 5 // Use the <code>chrome.serial</code> API to read from and write to a device
6 // connected to a serial port. 6 // connected to a serial port.
7 namespace serial { 7 namespace serial {
8 8
9 callback GetPortsCallback = void (DOMString[] ports); 9 callback GetPortsCallback = void (DOMString[] ports);
10 10
11 enum DataBit { sevenbit, eightbit };
12 enum ParityBit { noparity, oddparity, evenparity };
13 enum StopBit { onestopbit, twostopbit };
14
11 dictionary OpenOptions { 15 dictionary OpenOptions {
12 // The requested bitrate of the connection to be opened. For compatibility 16 // The requested bitrate of the connection to be opened. For compatibility
13 // with the widest range of hardware, this number should match one of 17 // with the widest range of hardware, this number should match one of
14 // commonly-available bitrates, such as 110, 300, 1200, 2400, 4800, 9600, 18 // commonly-available bitrates, such as 110, 300, 1200, 2400, 4800, 9600,
15 // 14400, 19200, 38400, 57600, 115200. There is no guarantee, of course, 19 // 14400, 19200, 38400, 57600, 115200. There is no guarantee, of course,
16 // that the device connected to the serial port will support the requested 20 // that the device connected to the serial port will support the requested
17 // bitrate, even if the port itself supports that bitrate. 21 // bitrate, even if the port itself supports that bitrate.
18 long bitrate; 22 long? bitrate;
miket_OOO 2013/08/21 19:43:44 It's OK if we make bitrate optional, but we should
limasdf 2013/08/24 15:46:24 Done.
23 DataBit? dataBit;
24 ParityBit? parityBit;
25 StopBit? stopBit;
19 }; 26 };
20 27
21 dictionary OpenInfo { 28 dictionary OpenInfo {
22 // The id of the opened connection. 29 // The id of the opened connection.
23 long connectionId; 30 long connectionId;
24 }; 31 };
25 32
26 callback OpenCallback = void (OpenInfo openInfo); 33 callback OpenCallback = void (OpenInfo openInfo);
27 34
28 // Returns true if operation was successful. 35 // Returns true if operation was successful.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 133
127 static void getControlSignals(long connectionId, 134 static void getControlSignals(long connectionId,
128 GetControlSignalsCallback callback); 135 GetControlSignalsCallback callback);
129 136
130 static void setControlSignals(long connectionId, 137 static void setControlSignals(long connectionId,
131 ControlSignalOptions options, 138 ControlSignalOptions options,
132 SetControlSignalsCallback callback); 139 SetControlSignalsCallback callback);
133 }; 140 };
134 141
135 }; 142 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698