TwiceAsNice
2019-02-18
|
core communication library for serial tty and sockets tcp More...
#include <Core.h>
Public Types | |
enum | ChatVERBOSE { ChatVERBOSE = 0x1, ChatCOLOR = 0x2, ChatTIME = 0x4, ChatECHO = 0x8, ChatVERBOSE = 0x1, ChatCOLOR = 0x2, ChatTIME = 0x4, ChatECHO = 0x8 } |
enum | ChatVERBOSE { ChatVERBOSE = 0x1, ChatCOLOR = 0x2, ChatTIME = 0x4, ChatECHO = 0x8, ChatVERBOSE = 0x1, ChatCOLOR = 0x2, ChatTIME = 0x4, ChatECHO = 0x8 } |
Public Member Functions | |
ChatCore () | |
constructor More... | |
ChatCore (const char *_device) | |
constructor with devicename tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD. More... | |
ChatCore (int _fd) | |
constructor with file descriptor More... | |
virtual | ~ChatCore () |
destructor More... | |
virtual int | open () |
virtual int | open (const char *_device) |
open device with name tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD. More... | |
virtual int | open (int _fd) |
open device with file descriptor More... | |
virtual int | close () |
closedevice More... | |
virtual bool | isConnected () const |
check if its connected More... | |
virtual int | wait (Nice::Time _time) |
wait _time sec for data, returns earlier as soon as data has arrived. More... | |
virtual int | openListenSocket (int _port) |
open a listen socket. More... | |
virtual int | tryAccept (ChatCore &_newConnection) |
try accepting for X secs. X is set by member setTimeout More... | |
void | setTimeout (Nice::Time _t) |
set read timeout in seconds, -1 = wait forever. More... | |
Nice::Time | timeout () |
void | setVerbose (int _v) |
set verbosity parameters More... | |
void | setName (std::string _name) |
std::string | name () |
ChatCore () | |
constructor More... | |
ChatCore (const char *_device) | |
constructor with devicename tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD. More... | |
ChatCore (int _fd) | |
constructor with file descriptor More... | |
virtual | ~ChatCore () |
destructor More... | |
virtual int | open () |
virtual int | open (const char *_device) |
open device with name tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD. More... | |
virtual int | open (int _fd) |
open device with file descriptor More... | |
virtual int | close () |
closedevice More... | |
virtual bool | isConnected () const |
check if its connected More... | |
virtual int | wait (Nice::Time _time) |
wait _time sec for data, returns earlier as soon as data has arrived. More... | |
virtual int | openListenSocket (int _port) |
open a listen socket. More... | |
virtual int | tryAccept (ChatCore &_newConnection) |
try accepting for X secs. X is set by member setTimeout More... | |
void | setTimeout (Nice::Time _t) |
set read timeout in seconds, -1 = wait forever. More... | |
Nice::Time | timeout () |
void | setVerbose (int _v) |
set verbosity parameters More... | |
void | setName (std::string _name) |
std::string | name () |
Protected Member Functions | |
int | openTCP (std::string &_host, uint16_t _port) |
int | openTTY (std::string &_device, int _baud, int _numbits, std::string _parity) |
virtual void | setStdSettings () |
virtual void | timeoutAktion (const std::string &)=0 |
int | openTCP (std::string &_host, uint16_t _port) |
int | openTTY (std::string &_device, int _baud, int _numbits, std::string _parity) |
virtual void | setStdSettings () |
virtual void | timeoutAktion (const std::string &)=0 |
Protected Attributes | |
std::string | m_device_name |
int | m_fd |
Nice::Time | m_timeout |
int | verbose_ |
bool | m_persistent |
std::string | m_name |
Private Member Functions | |
std::string | createMessageForErrno (int errorNumber) |
std::string | createMessageForErrno (int errorNumber) |
core communication library for serial tty and sockets tcp
enum Nice::ChatCore::ChatVERBOSE = 0x1 |
Nice::ChatCore::ChatCore | ( | ) |
constructor
Nice::ChatCore::ChatCore | ( | const char * | _device | ) |
constructor with devicename tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD.
Nice::ChatCore::ChatCore | ( | int | _fd | ) |
constructor with file descriptor
|
virtual |
destructor
Nice::ChatCore::ChatCore | ( | ) |
constructor
Nice::ChatCore::ChatCore | ( | const char * | _device | ) |
constructor with devicename tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD.
Nice::ChatCore::ChatCore | ( | int | _fd | ) |
constructor with file descriptor
|
virtual |
destructor
|
virtual |
closedevice
Reimplemented in Basda::ChatLineMockCore, and Basda::ChatLineMockCore.
|
virtual |
closedevice
Reimplemented in Basda::ChatLineMockCore, and Basda::ChatLineMockCore.
|
private |
|
private |
|
inlinevirtual |
check if its connected
|
inlinevirtual |
check if its connected
|
inline |
|
inline |
|
virtual |
Reimplemented in Basda::PdvChat, Basda::PdvChat, and Basda::PdvChat.
|
virtual |
Reimplemented in Basda::PdvChat, Basda::PdvChat, and Basda::PdvChat.
|
virtual |
open device with name tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD.
Reimplemented in Basda::PdvChat, Basda::PdvChat, Basda::PdvChat, Basda::LilJoeChitChat, Basda::LilJoeChitChat, Basda::LilJoeChitChat, Basda::ChatLineMockCore, and Basda::ChatLineMockCore.
|
virtual |
open device with name tcp://HOSTNAME:PORT or tty:/dev/ttyX:BAUD.
Reimplemented in Basda::PdvChat, Basda::PdvChat, Basda::PdvChat, Basda::LilJoeChitChat, Basda::LilJoeChitChat, Basda::LilJoeChitChat, Basda::ChatLineMockCore, and Basda::ChatLineMockCore.
|
virtual |
open device with file descriptor
Reimplemented in Basda::PdvChat, Basda::PdvChat, and Basda::PdvChat.
|
virtual |
open device with file descriptor
Reimplemented in Basda::PdvChat, Basda::PdvChat, and Basda::PdvChat.
|
virtual |
open a listen socket.
|
virtual |
open a listen socket.
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
protectedvirtual |
Reimplemented in Nice::ChatLine, Nice::ChatLine, Nice::ChatBlock, and Nice::ChatBlock.
|
protectedvirtual |
Reimplemented in Nice::ChatLine, Nice::ChatLine, Nice::ChatBlock, and Nice::ChatBlock.
|
inline |
set read timeout in seconds, -1 = wait forever.
|
inline |
set read timeout in seconds, -1 = wait forever.
|
inline |
set verbosity parameters
The following flags can be combined:
ChatCore::VERBOSE verbosity - prints sent and rcvd lines. ChatCore::COLOR ansi color - if you like color in your live. ChatCore::TIME prints time between sent and rcvd lines. ChatCore::ECHO prints every received character.
|
inline |
set verbosity parameters
The following flags can be combined:
ChatCore::VERBOSE verbosity - prints sent and rcvd lines. ChatCore::COLOR ansi color - if you like color in your live. ChatCore::TIME prints time between sent and rcvd lines. ChatCore::ECHO prints every received character.
|
inline |
|
inline |
|
protectedpure virtual |
Implemented in Nice::ChatLine, Nice::ChatLine, Nice::ChatBlock, and Nice::ChatBlock.
|
protectedpure virtual |
Implemented in Nice::ChatLine, Nice::ChatLine, Nice::ChatBlock, and Nice::ChatBlock.
|
virtual |
try accepting for X secs. X is set by member setTimeout
|
virtual |
try accepting for X secs. X is set by member setTimeout
|
virtual |
wait _time sec for data, returns earlier as soon as data has arrived.
|
virtual |
wait _time sec for data, returns earlier as soon as data has arrived.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |