TwiceAsNice
2019-02-18
|
The TCP class manages connection with devices over the network via TCP/IP. More...
#include <connectiontcp.h>
Public Types | |
enum | ConnectionType { TYPE_TCP = 0, TYPE_UDP, TYPE_TCP = 0, TYPE_UDP } |
enum | ConnectionType { TYPE_TCP = 0, TYPE_UDP, TYPE_TCP = 0, TYPE_UDP } |
![]() | |
enum | Type { CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2, CONNECTION_USB = 1 << 3, CONNECTION_CUSTOM = 1 << 15, CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2, CONNECTION_USB = 1 << 3, CONNECTION_CUSTOM = 1 << 15 } |
enum | Type { CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2, CONNECTION_USB = 1 << 3, CONNECTION_CUSTOM = 1 << 15, CONNECTION_NONE = 1 << 0, CONNECTION_SERIAL = 1 << 1, CONNECTION_TCP = 1 << 2, CONNECTION_USB = 1 << 3, CONNECTION_CUSTOM = 1 << 15 } |
Public Member Functions | |
TCP (INDI::DefaultDevice *dev) | |
virtual | ~TCP ()=default |
virtual bool | Connect () |
Connect Connect to device via the implemented communication medium. More... | |
virtual bool | Disconnect () |
Disconnect Disconnect from device. More... | |
virtual void | Activated () |
Activated Function called by the framework when the plugin is activated (i.e. More... | |
virtual void | Deactivated () |
Deactivated Function called by the framework when the plugin is deactivated. More... | |
virtual std::string | name () |
virtual std::string | label () |
virtual const char * | host () |
virtual uint32_t | port () |
virtual bool | ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) |
virtual bool | ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
virtual bool | saveConfigItems (FILE *fp) |
int | getPortFD () const |
void | setDefaultHost (const char *addressHost) |
void | setDefaultPort (uint32_t addressPort) |
void | setConnectionType (int type) |
TCP (INDI::DefaultDevice *dev) | |
virtual | ~TCP ()=default |
virtual bool | Connect () |
Connect Connect to device via the implemented communication medium. More... | |
virtual bool | Disconnect () |
Disconnect Disconnect from device. More... | |
virtual void | Activated () |
Activated Function called by the framework when the plugin is activated (i.e. More... | |
virtual void | Deactivated () |
Deactivated Function called by the framework when the plugin is deactivated. More... | |
virtual std::string | name () |
virtual std::string | label () |
virtual const char * | host () |
virtual uint32_t | port () |
virtual bool | ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) |
virtual bool | ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
virtual bool | saveConfigItems (FILE *fp) |
int | getPortFD () const |
void | setDefaultHost (const char *addressHost) |
void | setDefaultPort (uint32_t addressPort) |
void | setConnectionType (int type) |
![]() | |
virtual Type | type () |
type Return connection type More... | |
virtual bool | ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) |
void | registerHandshake (std::function< bool()> callback) |
registerHandshake Register a handshake function to be called once the intial connection to the device is established. More... | |
virtual Type | type () |
type Return connection type More... | |
virtual bool | ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) |
void | registerHandshake (std::function< bool()> callback) |
registerHandshake Register a handshake function to be called once the intial connection to the device is established. More... | |
Protected Attributes | |
ITextVectorProperty | AddressTP |
IText | AddressT [2] {} |
ISwitch | TcpUdpS [2] |
ISwitchVectorProperty | TcpUdpSP |
int | sockfd = -1 |
const uint8_t | SOCKET_TIMEOUT = 5 |
int | PortFD = -1 |
![]() | |
std::function< bool()> | Handshake |
INDI::DefaultDevice * | m_Device { nullptr } |
Type | m_Type { CONNECTION_NONE } |
Additional Inherited Members | |
![]() | |
Interface (INDI::DefaultDevice *dev, Type type=CONNECTION_NONE) | |
virtual | ~Interface () |
const char * | getDeviceName () |
Interface (INDI::DefaultDevice *dev, Type type=CONNECTION_NONE) | |
virtual | ~Interface () |
const char * | getDeviceName () |
The TCP class manages connection with devices over the network via TCP/IP.
Upon successfull connection, reads & writes from and to the device are performed via the returned file descriptor using standard UNIX read/write functions.
Connection::TCP::TCP | ( | INDI::DefaultDevice * | dev | ) |
|
virtualdefault |
Connection::TCP::TCP | ( | INDI::DefaultDevice * | dev | ) |
|
virtualdefault |
|
virtual |
Activated Function called by the framework when the plugin is activated (i.e.
selected by the user). It is usually used to define properties pertaining to the specific plugin functionalities.
Implements Connection::Interface.
|
virtual |
Activated Function called by the framework when the plugin is activated (i.e.
selected by the user). It is usually used to define properties pertaining to the specific plugin functionalities.
Implements Connection::Interface.
|
virtual |
Connect Connect to device via the implemented communication medium.
Do not perform any handshakes.
Implements Connection::Interface.
|
virtual |
Connect Connect to device via the implemented communication medium.
Do not perform any handshakes.
Implements Connection::Interface.
|
virtual |
Deactivated Function called by the framework when the plugin is deactivated.
It is usually used to delete properties by were defined previously since the plugin is no longer active.
Implements Connection::Interface.
|
virtual |
Deactivated Function called by the framework when the plugin is deactivated.
It is usually used to delete properties by were defined previously since the plugin is no longer active.
Implements Connection::Interface.
|
virtual |
Disconnect Disconnect from device.
Implements Connection::Interface.
|
virtual |
Disconnect Disconnect from device.
Implements Connection::Interface.
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Reimplemented from Connection::Interface.
|
virtual |
Reimplemented from Connection::Interface.
|
virtual |
Reimplemented from Connection::Interface.
|
virtual |
Reimplemented from Connection::Interface.
|
inlinevirtual |
Implements Connection::Interface.
|
inlinevirtual |
Implements Connection::Interface.
|
inlinevirtual |
Implements Connection::Interface.
|
inlinevirtual |
Implements Connection::Interface.
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Reimplemented from Connection::Interface.
|
virtual |
Reimplemented from Connection::Interface.
void Connection::TCP::setConnectionType | ( | int | type | ) |
void Connection::TCP::setConnectionType | ( | int | type | ) |
void Connection::TCP::setDefaultHost | ( | const char * | addressHost | ) |
void Connection::TCP::setDefaultHost | ( | const char * | addressHost | ) |
void Connection::TCP::setDefaultPort | ( | uint32_t | addressPort | ) |
void Connection::TCP::setDefaultPort | ( | uint32_t | addressPort | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |