Instrument Neutral Distributed Interface INDI
2.0.2
|
#include <abstractbaseclient.h>
Public Member Functions | |
AbstractBaseClient ()=delete | |
virtual | ~AbstractBaseClient () |
void | setServer (const char *hostname, unsigned int port) |
Set the server host name and port. More... | |
const char * | getHost () const |
Get the server host name. More... | |
int | getPort () const |
Get the port number. More... | |
virtual bool | connectServer ()=0 |
Connect to INDI server. More... | |
virtual bool | disconnectServer (int exit_code=0)=0 |
Disconnect from INDI server. Any devices previously created will be deleted and memory cleared. More... | |
bool | isServerConnected () const |
Get status of the connection. More... | |
void | setConnectionTimeout (uint32_t seconds, uint32_t microseconds) |
setConnectionTimeout Set connection timeout. By default it is 3 seconds. More... | |
void | setVerbose (bool enable) |
setVerbose Set verbose mode More... | |
bool | isVerbose () const |
isVerbose Is client in verbose mode? More... | |
void | watchDevice (const char *deviceName) |
Add a device to the watch list. More... | |
void | watchDevice (const char *deviceName, const std::function< void(BaseDevice)> &callback) |
void | watchProperty (const char *deviceName, const char *propertyName) |
watchProperties Add a property to the watch list. When communicating with INDI server. More... | |
void | connectDevice (const char *deviceName) |
Disconnect INDI driver. More... | |
void | disconnectDevice (const char *deviceName) |
Disconnect INDI driver. More... | |
INDI::BaseDevice | getDevice (const char *deviceName) |
std::vector< INDI::BaseDevice > | getDevices () const |
bool | getDevices (std::vector< INDI::BaseDevice > &deviceList, uint16_t driverInterface) |
getDevices Returns list of devices that belong to a particular DRIVER_INTERFACE class. More... | |
void | setBLOBMode (BLOBHandling blobH, const char *dev, const char *prop=nullptr) |
Set Binary Large Object policy mode. More... | |
BLOBHandling | getBLOBMode (const char *dev, const char *prop=nullptr) |
getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode More... | |
void | sendNewProperty (INDI::Property pp) |
Send new Property command to server. More... | |
void | sendNewText (INDI::Property pp) |
Send new Text command to server. More... | |
void | sendNewText (const char *deviceName, const char *propertyName, const char *elementName, const char *text) |
Send new Text command to server. More... | |
void | sendNewNumber (INDI::Property pp) |
Send new Number command to server. More... | |
void | sendNewNumber (const char *deviceName, const char *propertyName, const char *elementName, double value) |
Send new Number command to server. More... | |
void | sendNewSwitch (INDI::Property pp) |
Send new Switch command to server. More... | |
void | sendNewSwitch (const char *deviceName, const char *propertyName, const char *elementName) |
Send new Switch command to server. More... | |
void | startBlob (const char *devName, const char *propName, const char *timestamp) |
Send opening tag for BLOB command to server. More... | |
void | sendOneBlob (IBLOB *bp) |
Send ONE blob content to server. The BLOB data in raw binary format and will be converted to base64 and sent to server. More... | |
void | sendOneBlob (INDI::WidgetViewBlob *blob) |
void | sendOneBlob (const char *blobName, unsigned int blobSize, const char *blobFormat, void *blobBuffer) |
Send ONE blob content to server. The BLOB data in raw binary format and will be converted to base64 and sent to server. More... | |
void | finishBlob () |
Send closing tag for BLOB command to server. More... | |
void | sendPingRequest (const char *uid) |
Send one ping request, the server will answer back with the same uuid. More... | |
void | sendPingReply (const char *uid) |
Send a ping reply for the given uuid. More... | |
Public Member Functions inherited from INDI::BaseMediator | |
virtual | ~BaseMediator ()=default |
virtual void | newDevice (INDI::BaseDevice baseDevice) |
Emmited when a new device is created from INDI server. More... | |
virtual void | removeDevice (INDI::BaseDevice baseDevice) |
Emmited when a device is deleted from INDI server. More... | |
virtual void | newProperty (INDI::Property property) |
Emmited when a new property is created for an INDI driver. More... | |
virtual void | updateProperty (INDI::Property property) |
Emmited when a new property value arrives from INDI server. More... | |
virtual void | removeProperty (INDI::Property property) |
Emmited when a property is deleted for an INDI driver. More... | |
virtual void | newMessage (INDI::BaseDevice baseDevice, int messageID) |
Emmited when a new message arrives from INDI server. More... | |
virtual void | serverConnected () |
Emmited when the server is connected. More... | |
virtual void | serverDisconnected (int exit_code) |
Emmited when the server gets disconnected. More... | |
virtual void | newDevice (INDI::BaseDevice *dp) |
Emmited when a new device is created from INDI server. More... | |
virtual void | removeDevice (INDI::BaseDevice *dp) |
Emmited when a device is deleted from INDI server. More... | |
virtual void | newProperty (INDI::Property *property) |
Emmited when a new property is created for an INDI driver. More... | |
virtual void | removeProperty (INDI::Property *property) |
Emmited when a property is deleted for an INDI driver. More... | |
virtual void | newSwitch (ISwitchVectorProperty *svp) |
Emmited when a new switch value arrives from INDI server. More... | |
virtual void | newNumber (INumberVectorProperty *nvp) |
Emmited when a new number value arrives from INDI server. More... | |
virtual void | newText (ITextVectorProperty *tvp) |
Emmited when a new text value arrives from INDI server. More... | |
virtual void | newLight (ILightVectorProperty *lvp) |
Emmited when a new light value arrives from INDI server. More... | |
virtual void | newBLOB (IBLOB *bp) |
Emmited when a new property value arrives from INDI server. More... | |
virtual void | newMessage (INDI::BaseDevice *dp, int messageID) |
Emmited when a new message arrives from INDI server. More... | |
Protected Member Functions | |
virtual void | newPingReply (std::string uid) |
pingReply are sent by the server on response to pingReply (see above). More... | |
virtual void | newUniversalMessage (std::string message) |
newUniversalMessage Universal messages are sent from INDI server without a specific device. It is addressed to the client overall. More... | |
AbstractBaseClient (std::unique_ptr< AbstractBaseClientPrivate > &&dd) | |
Protected Attributes | |
std::unique_ptr< AbstractBaseClientPrivate > | d_ptr_indi |
Friends | |
class | BaseClientPrivate |
class | BaseClientQtPrivate |
Definition at line 37 of file abstractbaseclient.h.
|
delete |
|
virtual |
Definition at line 317 of file abstractbaseclient.cpp.
|
protected |
Definition at line 313 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::connectDevice | ( | const char * | deviceName | ) |
Disconnect INDI driver.
deviceName | Name of the device to disconnect. |
Definition at line 382 of file abstractbaseclient.cpp.
|
pure virtual |
Connect to INDI server.
Implemented in INDI::BaseClientQt, and INDI::BaseClient.
void INDI::AbstractBaseClient::disconnectDevice | ( | const char * | deviceName | ) |
Disconnect INDI driver.
deviceName | Name of the device to disconnect. |
Definition at line 388 of file abstractbaseclient.cpp.
|
pure virtual |
Disconnect from INDI server. Any devices previously created will be deleted and memory cleared.
Implemented in INDI::BaseClientQt, and INDI::BaseClient.
void INDI::AbstractBaseClient::finishBlob | ( | ) |
Send closing tag for BLOB command to server.
Definition at line 595 of file abstractbaseclient.cpp.
BLOBHandling INDI::AbstractBaseClient::getBLOBMode | ( | const char * | dev, |
const char * | prop = nullptr |
||
) |
getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode
dev | name of device. |
prop | property name, can be NULL to return overall device policy if it exists. |
Definition at line 447 of file abstractbaseclient.cpp.
BaseDevice INDI::AbstractBaseClient::getDevice | ( | const char * | deviceName | ) |
deviceName | Name of device to search for in the list of devices owned by INDI server, |
Definition at line 394 of file abstractbaseclient.cpp.
std::vector< BaseDevice > INDI::AbstractBaseClient::getDevices | ( | ) | const |
Definition at line 400 of file abstractbaseclient.cpp.
bool INDI::AbstractBaseClient::getDevices | ( | std::vector< INDI::BaseDevice > & | deviceList, |
uint16_t | driverInterface | ||
) |
getDevices Returns list of devices that belong to a particular DRIVER_INTERFACE class.
For example, to get a list of guide cameras:
deviceList | Supply device list to be filled by the function. |
driverInterface | ORed DRIVER_INTERFACE values to select the desired class of devices. |
const char * INDI::AbstractBaseClient::getHost | ( | ) | const |
Get the server host name.
Definition at line 327 of file abstractbaseclient.cpp.
int INDI::AbstractBaseClient::getPort | ( | ) | const |
Get the port number.
Definition at line 333 of file abstractbaseclient.cpp.
bool INDI::AbstractBaseClient::isServerConnected | ( | ) | const |
Get status of the connection.
Definition at line 339 of file abstractbaseclient.cpp.
bool INDI::AbstractBaseClient::isVerbose | ( | ) | const |
isVerbose Is client in verbose mode?
Definition at line 358 of file abstractbaseclient.cpp.
|
protectedvirtual |
pingReply are sent by the server on response to pingReply (see above).
Definition at line 613 of file abstractbaseclient.cpp.
|
protectedvirtual |
newUniversalMessage Universal messages are sent from INDI server without a specific device. It is addressed to the client overall.
message | content of message. |
Definition at line 618 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewNumber | ( | const char * | deviceName, |
const char * | propertyName, | ||
const char * | elementName, | ||
double | value | ||
) |
Send new Number command to server.
Definition at line 523 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewNumber | ( | INDI::Property | pp | ) |
Send new Number command to server.
Definition at line 515 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewProperty | ( | INDI::Property | pp | ) |
Send new Property command to server.
Definition at line 460 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewSwitch | ( | const char * | deviceName, |
const char * | propertyName, | ||
const char * | elementName | ||
) |
Send new Switch command to server.
Definition at line 548 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewSwitch | ( | INDI::Property | pp | ) |
Send new Switch command to server.
Definition at line 541 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewText | ( | const char * | deviceName, |
const char * | propertyName, | ||
const char * | elementName, | ||
const char * | text | ||
) |
Send new Text command to server.
Definition at line 497 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendNewText | ( | INDI::Property | pp | ) |
Send new Text command to server.
Definition at line 488 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendOneBlob | ( | const char * | blobName, |
unsigned int | blobSize, | ||
const char * | blobFormat, | ||
void * | blobBuffer | ||
) |
Send ONE blob content to server. The BLOB data in raw binary format and will be converted to base64 and sent to server.
Definition at line 585 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendOneBlob | ( | IBLOB * | bp | ) |
Send ONE blob content to server. The BLOB data in raw binary format and will be converted to base64 and sent to server.
Definition at line 580 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendOneBlob | ( | INDI::WidgetViewBlob * | blob | ) |
Definition at line 571 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendPingReply | ( | const char * | uid | ) |
Send a ping reply for the given uuid.
Definition at line 607 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::sendPingRequest | ( | const char * | uid | ) |
Send one ping request, the server will answer back with the same uuid.
uid | This string will server as identifier for the reply |
Definition at line 601 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::setBLOBMode | ( | BLOBHandling | blobH, |
const char * | dev, | ||
const char * | prop = nullptr |
||
) |
Set Binary Large Object policy mode.
Set the BLOB handling mode for the client. The client may either receive:
If dev and prop are supplied, then the BLOB handling policy is set for this particular device and property. if prop is NULL, then the BLOB policy applies to the whole device.
blobH | BLOB handling policy |
dev | name of device, required. |
prop | name of property, optional. |
Definition at line 419 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::setConnectionTimeout | ( | uint32_t | seconds, |
uint32_t | microseconds | ||
) |
setConnectionTimeout Set connection timeout. By default it is 3 seconds.
seconds | seconds |
microseconds | microseconds |
Definition at line 345 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::setServer | ( | const char * | hostname, |
unsigned int | port | ||
) |
Set the server host name and port.
Definition at line 320 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::setVerbose | ( | bool | enable | ) |
setVerbose Set verbose mode
enable | If true, enable FULL verbose output. Any XML message received, including BLOBs, are printed on standard output. Only use this for debugging purposes. |
Definition at line 352 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::startBlob | ( | const char * | devName, |
const char * | propName, | ||
const char * | timestamp | ||
) |
Send opening tag for BLOB command to server.
Definition at line 565 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::watchDevice | ( | const char * | deviceName | ) |
Add a device to the watch list.
A client may select to receive notifications of only a specific device or a set of devices. If the client encounters any of the devices set via this function, it will create a corresponding INDI::BaseDevice object to handle them. If no devices are watched, then all devices owned by INDI server will be created and handled.
Definition at line 364 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::watchDevice | ( | const char * | deviceName, |
const std::function< void(BaseDevice)> & | callback | ||
) |
Definition at line 370 of file abstractbaseclient.cpp.
void INDI::AbstractBaseClient::watchProperty | ( | const char * | deviceName, |
const char * | propertyName | ||
) |
watchProperties Add a property to the watch list. When communicating with INDI server.
The client calls <getProperties device=deviceName property=propertyName/>> so that only a particular property (or list of properties if more than one) are defined back to the client. This function will call watchDevice(deviceName) as well to limit the traffic to this device.
propertyName | Property to watch for. |
Definition at line 376 of file abstractbaseclient.cpp.
|
friend |
Definition at line 226 of file abstractbaseclient.h.
|
friend |
Definition at line 227 of file abstractbaseclient.h.
|
protected |
Definition at line 233 of file abstractbaseclient.h.