My Project
|
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) |
![]() | |
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 | THREAD_START (startUp) |
Additional Inherited Members | |
![]() | |
virtual void | broadcastReady () |
void | spawn (void *arg) |
![]() | |
Thread * | spawnedThread_ |
bool | spawned_ |
RUN_FN * | runFn_ |
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
|
virtual |
Destructor.
....................................................................... Destructor.
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