OLD | NEW |
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 SerialConnection(const std::string& port, | 30 SerialConnection(const std::string& port, |
31 int bitrate, | 31 int bitrate, |
32 ApiResourceEventNotifier* event_notifier); | 32 ApiResourceEventNotifier* event_notifier); |
33 virtual ~SerialConnection(); | 33 virtual ~SerialConnection(); |
34 | 34 |
35 virtual bool Open(); | 35 virtual bool Open(); |
36 virtual void Close(); | 36 virtual void Close(); |
37 virtual void Flush(); | 37 virtual void Flush(); |
38 | 38 |
39 virtual int Read(uint8* byte); | 39 virtual int Read(scoped_refptr<net::IOBufferWithSize> io_buffer); |
40 virtual int Write(scoped_refptr<net::IOBuffer> io_buffer, int byte_count); | 40 virtual int Write(scoped_refptr<net::IOBuffer> io_buffer, int byte_count); |
41 | 41 |
42 struct ControlSignals { | 42 struct ControlSignals { |
43 // Sent from workstation to device. The should_set_ values indicate whether | 43 // Sent from workstation to device. The should_set_ values indicate whether |
44 // SetControlSignals should change the given signal (true) or else leave it | 44 // SetControlSignals should change the given signal (true) or else leave it |
45 // as-is (false). | 45 // as-is (false). |
46 bool should_set_dtr; | 46 bool should_set_dtr; |
47 bool dtr; | 47 bool dtr; |
48 bool should_set_rts; | 48 bool should_set_rts; |
49 bool rts; | 49 bool rts; |
(...skipping 13 matching lines...) Expand all Loading... |
63 | 63 |
64 private: | 64 private: |
65 std::string port_; | 65 std::string port_; |
66 int bitrate_; | 66 int bitrate_; |
67 base::PlatformFile file_; | 67 base::PlatformFile file_; |
68 }; | 68 }; |
69 | 69 |
70 } // namespace extensions | 70 } // namespace extensions |
71 | 71 |
72 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ | 72 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ |
OLD | NEW |