Instrument Neutral Distributed Interface INDI
2.0.2
|
The Interface 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 } |
Public Member Functions | |
virtual bool | Connect ()=0 |
Connect Connect to device via the implemented communication medium. Do not perform any handshakes. 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. selected by the user). It is usually used to define properties pertaining to the specific plugin functionalities. More... | |
virtual void | Deactivated ()=0 |
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. 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 | ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], 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 () |
Protected Attributes | |
std::function< bool()> | Handshake |
INDI::DefaultDevice * | m_Device { nullptr } |
Type | m_Type { CONNECTION_NONE } |
The Interface 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.
Definition at line 51 of file connectioninterface.h.
Definition at line 58 of file connectioninterface.h.
|
protected |
Definition at line 27 of file connectioninterface.cpp.
|
protectedvirtual |
Definition at line 36 of file connectioninterface.cpp.
|
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::TCP, and Connection::Serial.
|
pure virtual |
Connect Connect to device via the implemented communication medium. Do not perform any handshakes.
Implemented in Connection::TCP, and Connection::Serial.
|
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::TCP, and Connection::Serial.
|
pure virtual |
Disconnect Disconnect from device.
Implemented in Connection::TCP, and Connection::Serial.
|
protected |
Definition at line 40 of file connectioninterface.cpp.
|
virtual |
Definition at line 75 of file connectioninterface.cpp.
|
virtual |
Definition at line 55 of file connectioninterface.cpp.
|
virtual |
Reimplemented in Connection::TCP, and Connection::Serial.
Definition at line 45 of file connectioninterface.cpp.
|
virtual |
Reimplemented in Connection::TCP, and Connection::Serial.
Definition at line 65 of file connectioninterface.cpp.
|
pure virtual |
Implemented in Connection::TCP, and Connection::Serial.
|
pure virtual |
Implemented in Connection::TCP, and Connection::Serial.
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 |
Definition at line 95 of file connectioninterface.cpp.
|
virtual |
Reimplemented in Connection::TCP, and Connection::Serial.
Definition at line 89 of file connectioninterface.cpp.
|
inlinevirtual |
type Return connection type
Definition at line 105 of file connectioninterface.h.
|
protected |
Definition at line 129 of file connectioninterface.h.
|
protected |
Definition at line 130 of file connectioninterface.h.
|
protected |
Definition at line 131 of file connectioninterface.h.