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

Side by Side Diff: extensions/browser/api/serial/serial_connection.h

Issue 873903002: Set serial connection parameters immediately on connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment explaing the "set" notation. Created 5 years, 10 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
OLDNEW
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 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ 5 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_
6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ 6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 void set_send_timeout(int send_timeout); 67 void set_send_timeout(int send_timeout);
68 int send_timeout() const { return send_timeout_; } 68 int send_timeout() const { return send_timeout_; }
69 69
70 void set_paused(bool paused); 70 void set_paused(bool paused);
71 bool paused() const { return paused_; } 71 bool paused() const { return paused_; }
72 72
73 // Initiates an asynchronous Open of the device. It is the caller's 73 // Initiates an asynchronous Open of the device. It is the caller's
74 // responsibility to ensure that this SerialConnection stays alive 74 // responsibility to ensure that this SerialConnection stays alive
75 // until |callback| is run. 75 // until |callback| is run.
76 void Open(const OpenCompleteCallback& callback); 76 void Open(const core_api::serial::ConnectionOptions& options,
77 const OpenCompleteCallback& callback);
77 78
78 // Begins an asynchronous receive operation. Calling this while a Receive 79 // Begins an asynchronous receive operation. Calling this while a Receive
79 // is already pending is a no-op and returns |false| without calling 80 // is already pending is a no-op and returns |false| without calling
80 // |callback|. 81 // |callback|.
81 bool Receive(const ReceiveCompleteCallback& callback); 82 bool Receive(const ReceiveCompleteCallback& callback);
82 83
83 // Begins an asynchronous send operation. Calling this while a Send 84 // Begins an asynchronous send operation. Calling this while a Send
84 // is already pending is a no-op and returns |false| without calling 85 // is already pending is a no-op and returns |false| without calling
85 // |callback|. 86 // |callback|.
86 bool Send(const std::vector<char>& data, 87 bool Send(const std::vector<char>& data,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 template <> 208 template <>
208 struct TypeConverter<device::serial::ConnectionOptionsPtr, 209 struct TypeConverter<device::serial::ConnectionOptionsPtr,
209 extensions::core_api::serial::ConnectionOptions> { 210 extensions::core_api::serial::ConnectionOptions> {
210 static device::serial::ConnectionOptionsPtr Convert( 211 static device::serial::ConnectionOptionsPtr Convert(
211 const extensions::core_api::serial::ConnectionOptions& input); 212 const extensions::core_api::serial::ConnectionOptions& input);
212 }; 213 };
213 214
214 } // namespace mojo 215 } // namespace mojo
215 216
216 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ 217 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_api.cc ('k') | extensions/browser/api/serial/serial_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698