yast2-core
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
liby2
src
include
y2
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
33
class
Y2SerialComponent
:
public
Y2Component
34
{
38
string
device_name
;
39
43
long
baud_rate
;
44
48
int
fd_serial
;
49
53
string
full_name
;
54
58
Parser
parser
;
59
60
65
int
timeout_seconds
;
66
67
public
:
68
72
Y2SerialComponent
(
string
device_name
,
long
baud_rate
);
73
77
~Y2SerialComponent
();
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
161
YCPValue
receiveFromSerial
();
162
};
163
164
#endif // Y2SerialComponent_h
Generated on a sunny day for yast2-core by
1.8.2