TwiceAsNice
2019-02-18
|
The Interface class class is the base class for all INDI connection plugins. More...
#include <connectioninterface.h>
Public Types | |
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 | |
virtual bool | Connect ()=0 |
Connect Connect to device via the implemented communication medium. More... | |
virtual bool | Disconnect ()=0 |
Disconnect Disconnect from device. More... | |
virtual void | Activated ()=0 |
Activated Function called by the framework when the plugin is activated (i.e. More... | |
virtual void | Deactivated ()=0 |
Deactivated Function called by the framework when the plugin is deactivated. More... | |
virtual std::string | name ()=0 |
virtual std::string | label ()=0 |
virtual Type | type () |
type Return connection type More... | |
virtual bool | ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
virtual bool | ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) |
virtual bool | ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) |
virtual bool | saveConfigItems (FILE *fp) |
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 bool | Connect ()=0 |
Connect Connect to device via the implemented communication medium. More... | |
virtual bool | Disconnect ()=0 |
Disconnect Disconnect from device. More... | |
virtual void | Activated ()=0 |
Activated Function called by the framework when the plugin is activated (i.e. More... | |
virtual void | Deactivated ()=0 |
Deactivated Function called by the framework when the plugin is deactivated. More... | |
virtual std::string | name ()=0 |
virtual std::string | label ()=0 |
virtual Type | type () |
type Return connection type More... | |
virtual bool | ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
virtual bool | ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n) |
virtual bool | ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) |
virtual bool | saveConfigItems (FILE *fp) |
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 Member Functions | |
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 () |
Protected Attributes | |
std::function< bool()> | Handshake |
INDI::DefaultDevice * | m_Device { nullptr } |
Type | m_Type { CONNECTION_NONE } |
The Interface class class is the base class for all INDI connection plugins.
Each plugin implements the connection details specific to a particular medium (e.g. serial). After the connection to the medium is successful, a handshake is initialted to make sure the device is online and responding to commands. The child class employing the plugin must register the handshake to perform the actual low-level communication with the device.
|
protected |
|
protectedvirtual |
|
protected |
|
protectedvirtual |
|
pure 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.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure 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.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Connect Connect to device via the implemented communication medium.
Do not perform any handshakes.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Connect Connect to device via the implemented communication medium.
Do not perform any handshakes.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure 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.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure 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.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Disconnect Disconnect from device.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Disconnect Disconnect from device.
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
protected |
|
protected |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
virtual |
Reimplemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
virtual |
Reimplemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
virtual |
Reimplemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
pure virtual |
Implemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
void Connection::Interface::registerHandshake | ( | std::function< bool()> | callback | ) |
registerHandshake Register a handshake function to be called once the intial connection to the device is established.
callback | Handshake function callback |
void Connection::Interface::registerHandshake | ( | std::function< bool()> | callback | ) |
registerHandshake Register a handshake function to be called once the intial connection to the device is established.
callback | Handshake function callback |
|
virtual |
Reimplemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
virtual |
Reimplemented in Connection::Serial, Connection::Serial, Connection::TCP, and Connection::TCP.
|
inlinevirtual |
type Return connection type
|
inlinevirtual |
type Return connection type
|
protected |
|
protected |
|
protected |