CSerial Class Reference

#include <Serial.h>

Inheritance diagram for CSerial:

Inheritance graph
[legend]
Collaboration diagram for CSerial:

Collaboration graph
[legend]

Detailed Description

Emulated serial port.

The serial port is translated to a telnet port.

Definition at line 104 of file Serial.h.


Public Member Functions

void write (const char *s)
virtual void WriteMem (int index, u64 address, int dsize, u64 data)
virtual u64 ReadMem (int index, u64 address, int dsize)
 CSerial (CConfigurator *cfg, CSystem *c, u16 number)
 Constructor.
virtual ~CSerial ()
 Destructor.
void receive (const char *data)
virtual void check_state ()
 Check if threads are still running.
virtual int SaveState (FILE *f)
 Save state to a Virtual Machine State file.
virtual int RestoreState (FILE *f)
 Restore state from a Virtual Machine State file.
void eval_interrupts ()
void WaitForConnection ()
virtual void run ()
 Thread entry point.
void execute ()
virtual void init ()
 Initialize the Serial port device.
virtual void start_threads ()
virtual void stop_threads ()

Private Member Functions

void serial_menu ()

Private Attributes

Poco::ThreadmyThread
bool StopThread
bool breakHit
struct CSerial::SSrl_state state
int listenPort
int listenSocket
int connectSocket
int throughSocket

Data Structures

struct  SSrl_state
 The state structure contains all elements that need to be saved to the statefile. More...

Constructor & Destructor Documentation

CSerial::CSerial ( CConfigurator cfg,
CSystem c,
u16  number 
)

Constructor.

Definition at line 202 of file Serial.cpp.

References breakHit, CSerial::SSrl_state::iNumber, and state.

CSerial::~CSerial (  )  [virtual]

Destructor.

Definition at line 314 of file Serial.cpp.

References stop_threads().


Member Function Documentation

void CSerial::write ( const char *  s  ) 

Definition at line 477 of file Serial.cpp.

References connectSocket.

Referenced by serial_menu(), WaitForConnection(), and WriteMem().

void CSerial::WriteMem ( int  index,
u64  address,
int  dsize,
u64  data 
) [virtual]

u64 CSerial::ReadMem ( int  index,
u64  address,
int  dsize 
) [virtual]

void CSerial::receive ( const char *  data  ) 

Definition at line 482 of file Serial.cpp.

References eval_interrupts(), FIFO_SIZE, CSerial::SSrl_state::rcvBuffer, CSerial::SSrl_state::rcvW, and state.

Referenced by execute().

void CSerial::check_state (  )  [virtual]

Check if threads are still running.

Enter serial port menu if <break> was received.

Reimplemented from CSystemComponent.

Definition at line 527 of file Serial.cpp.

References breakHit, FAILURE, Poco::Thread::isRunning(), myThread, and serial_menu().

int CSerial::SaveState ( FILE *  f  )  [virtual]

Save state to a Virtual Machine State file.

Implements CSystemComponent.

Definition at line 721 of file Serial.cpp.

References CSystemComponent::devid_string, srl_magic1, srl_magic2, and state.

int CSerial::RestoreState ( FILE *  f  )  [virtual]

Restore state from a Virtual Machine State file.

Implements CSystemComponent.

Definition at line 736 of file Serial.cpp.

References CSystemComponent::devid_string, srl_magic1, srl_magic2, and state.

void CSerial::eval_interrupts (  ) 

void CSerial::WaitForConnection (  ) 

void CSerial::run ( void   )  [virtual]

Thread entry point.

Implements Poco::Runnable.

Definition at line 501 of file Serial.cpp.

References Poco::Exception::displayText(), execute(), Poco::Thread::sleep(), and StopThread.

void CSerial::execute (  ) 

void CSerial::init (  )  [virtual]

void CSerial::start_threads (  )  [virtual]

void CSerial::stop_threads (  )  [virtual]

Reimplemented from CSystemComponent.

Definition at line 299 of file Serial.cpp.

References Poco::Thread::getName(), Poco::Thread::join(), myThread, and StopThread.

Referenced by ~CSerial().

void CSerial::serial_menu (  )  [private]


Field Documentation

Definition at line 127 of file Serial.h.

Referenced by check_state(), init(), start_threads(), and stop_threads().

bool CSerial::StopThread [private]

Definition at line 128 of file Serial.h.

Referenced by run(), start_threads(), and stop_threads().

bool CSerial::breakHit [private]

Definition at line 129 of file Serial.h.

Referenced by check_state(), CSerial(), execute(), and serial_menu().

int CSerial::listenPort [private]

Definition at line 153 of file Serial.h.

Referenced by execute(), init(), and WaitForConnection().

int CSerial::listenSocket [private]

Definition at line 154 of file Serial.h.

Referenced by init(), and WaitForConnection().

int CSerial::connectSocket [private]

Definition at line 155 of file Serial.h.

Referenced by execute(), serial_menu(), WaitForConnection(), and write().

int CSerial::throughSocket [private]

Definition at line 157 of file Serial.h.

Referenced by init().


The documentation for this class was generated from the following files:

SourceForge.net Logo
Project space on SourceForge.net