#include <Y2SerialComponent.h>
Inheritance diagram for Y2SerialComponent:
Public Member Functions | |
Y2SerialComponent (string device_name, long baud_rate) | |
~Y2SerialComponent () | |
string | name () const |
YCPValue | evaluate (const YCPValue &command) |
void | result (const YCPValue &result) |
void | setServerOptions (int argc, char **argv) |
YCPValue | doActualWork (const YCPList &arglist, Y2Component *user_interface) |
Private Member Functions | |
int | open_tty () |
void | close_tty () |
int | setup_serial_device () |
int | make_raw () |
int | set_fixed_line_speed (long speed) |
bool | await_readable (long timeout) |
bool | initializeConnection () |
void | sendToSerial (const YCPValue &v) |
YCPValue | receiveFromSerial () |
Private Attributes | |
string | device_name |
long | baud_rate |
int | fd_serial |
string | full_name |
Parser | parser |
int | timeout_seconds |
|
Creates a new serial component. |
|
Cleans up |
|
wait with timeout (microseconds) for readability |
|
close serial line if necessary and reset flag |
|
Here the client does its actual work.
Reimplemented from Y2Component. |
|
Defined only in the server role Reimplemented from Y2Component. |
|
initializes the serial connection |
|
Set raw mode 8,N,1, no parity for serial line |
|
Returns the name of the component. Implements Y2Component. |
|
Open the given tty and return the corresponding file descriptor on success. |
|
Reads one YCP value from the serial line. Return 0 if none could be read. |
|
Defined only in the server role Reimplemented from Y2Component. |
|
Send a YCPValue over the serial line |
|
Set line speed for serial line |
|
Sets the commandline options of the server. Server options for the cat server are simply ignored. This method is only defined, if the component is a server. Reimplemented from Y2Component. |
|
Setup serial device |
|
The baud rate to use |
|
The name of the device to use |
|
file descriptor for serial connection |
|
Full name of component |
|
Parser used to parse input |
|
After so many seconds cancel to try establishing the connection and to an exit(10); |