My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::TerminalServer Class Reference
Inheritance diagram for gcp::util::TerminalServer:
gcp::util::Runnable

Public Types

enum  { CR = '\r', LF = '\n' }
 

Public Member Functions

 TerminalServer (unsigned baudRate, std::string serialPort, bool spawnThread=false)
 
 TerminalServer (std::string ipAddress, unsigned port, bool spawnThread=false)
 
virtual ~TerminalServer ()
 
void listen (unsigned port, unsigned nClients=5)
 
void listenToStdin (bool listen)
 
void log (bool log)
 
void strip (std::string strip)
 
void dontStrip (std::string dontStrip)
 
void stripUnprintable (bool strip)
 
void append (std::string append)
 
void setLogFilePrefix (const std::string &prefix)
 
void setLogFileDirectory (const std::string &dir)
 
void run ()
 
void writeToPort (std::string &line)
 
void writeToPort (Vector< unsigned char > &bytes)
 
- Public Member Functions inherited from gcp::util::Runnable
 Runnable (bool spawnThread, RUN_FN(*runFn))
 
 Runnable (bool spawnThread, RUN_FN(*runFn), int priority)
 
virtual ~Runnable ()
 
void blockForever ()
 
void spawn ()
 

Static Public Member Functions

static RUN_FN (runFn)
 
- Static Public Member Functions inherited from gcp::util::Runnable
static THREAD_START (startUp)
 

Additional Inherited Members

- Protected Member Functions inherited from gcp::util::Runnable
virtual void broadcastReady ()
 
void spawn (void *arg)
 
- Protected Attributes inherited from gcp::util::Runnable
ThreadspawnedThread_
 
bool spawned_
 
RUN_FN * runFn_
 

Constructor & Destructor Documentation

TerminalServer::TerminalServer ( unsigned  baudRate,
std::string  serialPort,
bool  spawnThread = false 
)

Constructor for serial connections

....................................................................... Constructor for a serial connection

TerminalServer::TerminalServer ( std::string  ipAddress,
unsigned  port,
bool  spawnThread = false 
)

Constructor for serial connections

....................................................................... Constructor for a socket connection

TerminalServer::~TerminalServer ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

void TerminalServer::append ( std::string  append)

Set characters to append to lines written to the port

....................................................................... Append arbitrary characters to written lines

void TerminalServer::dontStrip ( std::string  dontStrip)

Set a string of chars never to strip from lines read from the port

....................................................................... Dont strip arbitrary characters from received lines

void TerminalServer::listen ( unsigned  port,
unsigned  nClients = 5 
)

Set the port number on which we should listen for connection requests. Also sets the queue length

....................................................................... Listen for connection requests on the specified port

void TerminalServer::listenToStdin ( bool  listen)

Set whether or not to register stdin to be listened to

....................................................................... Set whether or not to register stdin to be listened to

void TerminalServer::log ( bool  log)

Set whether or not to log server traffic

....................................................................... Set whether or not to log server traffic

void TerminalServer::run ( void  )

Block in select

....................................................................... Block in select

void TerminalServer::setLogFileDirectory ( const std::string &  dir)

................................................................................. Set the logfile directory

void TerminalServer::setLogFilePrefix ( const std::string &  prefix)

................................................................................. Set the logfile prefix

void TerminalServer::strip ( std::string  strip)

Set a string of chars to strip from lines read from the port

....................................................................... Strip arbitrary characters from received lines

void TerminalServer::stripUnprintable ( bool  strip)

Strip unprintable characters from received lines

....................................................................... Strip unprintable characters from received lines

void TerminalServer::writeToPort ( std::string &  line)

Write data to the port

....................................................................... Write data to the port

void TerminalServer::writeToPort ( Vector< unsigned char > &  bytes)

....................................................................... Write data to the port


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