Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

Y2SerialComponent Class Reference

Interface to a component via serial line. More...

#include <Y2SerialComponent.h>

Inheritance diagram for Y2SerialComponent:

Y2Component List of all members.

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

Detailed Description

Interface to a component via serial line.


Constructor & Destructor Documentation

Y2SerialComponent::Y2SerialComponent string  device_name,
long  baud_rate
 

Creates a new serial component.

Y2SerialComponent::~Y2SerialComponent  ) 
 

Cleans up


Member Function Documentation

bool Y2SerialComponent::await_readable long  timeout  )  [private]
 

wait with timeout (microseconds) for readability

void Y2SerialComponent::close_tty  )  [private]
 

close serial line if necessary and reset flag

YCPValue Y2SerialComponent::doActualWork const YCPList arglist,
Y2Component user_interface
[virtual]
 

Here the client does its actual work.

Parameters:
arglist YCPList of client arguments.
user_interface Option display server (user interface)
Returns:
The result value (exit code) of the called client. The result code has not yet been sent to the display server. Destroy it after use.
This method is only defined, if the component is a client.

Reimplemented from Y2Component.

YCPValue Y2SerialComponent::evaluate const YCPValue command  )  [virtual]
 

Defined only in the server role

Reimplemented from Y2Component.

bool Y2SerialComponent::initializeConnection  )  [private]
 

initializes the serial connection

int Y2SerialComponent::make_raw  )  [private]
 

Set raw mode 8,N,1, no parity for serial line

string Y2SerialComponent::name  )  const [virtual]
 

Returns the name of the component.

Implements Y2Component.

int Y2SerialComponent::open_tty  )  [private]
 

Open the given tty and return the corresponding file descriptor on success.

YCPValue Y2SerialComponent::receiveFromSerial  )  [private]
 

Reads one YCP value from the serial line. Return 0 if none could be read.

void Y2SerialComponent::result const YCPValue result  )  [virtual]
 

Defined only in the server role

Reimplemented from Y2Component.

void Y2SerialComponent::sendToSerial const YCPValue v  )  [private]
 

Send a YCPValue over the serial line

int Y2SerialComponent::set_fixed_line_speed long  speed  )  [private]
 

Set line speed for serial line

void Y2SerialComponent::setServerOptions int  argc,
char **  argv
[virtual]
 

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.

int Y2SerialComponent::setup_serial_device  )  [private]
 

Setup serial device


Member Data Documentation

long Y2SerialComponent::baud_rate [private]
 

The baud rate to use

string Y2SerialComponent::device_name [private]
 

The name of the device to use

int Y2SerialComponent::fd_serial [private]
 

file descriptor for serial connection

string Y2SerialComponent::full_name [private]
 

Full name of component

Parser Y2SerialComponent::parser [private]
 

Parser used to parse input

int Y2SerialComponent::timeout_seconds [private]
 

After so many seconds cancel to try establishing the connection and to an exit(10);


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6