yast2-core
Y2SerialComponent.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: Y2SerialComponent.h
14 
15  Author: Thomas Roelz <tom@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 
20 /*
21  * Component that communicates via serial line
22  */
23 
24 #ifndef Y2SerialComponent_h
25 #define Y2SerialComponent_h
26 
27 #include "Y2Component.h"
28 #include <ycp/Parser.h>
29 
34 {
38  string device_name;
39 
43  long baud_rate;
44 
48  int fd_serial;
49 
53  string full_name;
54 
59 
60 
66 
67 public:
68 
73 
78 
82  string name() const;
83 
87  YCPValue evaluate(const YCPValue& command);
88 
92  void result(const YCPValue& result);
93 
100  void setServerOptions(int argc, char **argv);
101 
112  YCPValue doActualWork(const YCPList& arglist, Y2Component *user_interface);
113 
114 private:
115 
119  int open_tty();
120 
124  void close_tty();
125 
129  int setup_serial_device();
130 
134  int make_raw();
135 
139  int set_fixed_line_speed(long speed);
140 
144  bool await_readable(long timeout);
145 
149  bool initializeConnection();
150 
154  void sendToSerial(const YCPValue& v);
155 
156 
162 };
163 
164 #endif // Y2SerialComponent_h

Generated on a sunny day for yast2-core by doxygen 1.8.2