|
Instrument Neutral Distributed Interface INDI 2.2.5
|
SafetyMonitorClient connects to a remote INDI device and monitors its SAFETY_STATUS property. More...
#include <safetymonitor_client.h>
Public Member Functions | |
| SafetyMonitorClient (const std::string &deviceName, std::function< void()> statusCallback) | |
| ~SafetyMonitorClient () | |
| bool | connectToServer (const std::string &host, int port) |
| Connect to an INDI server. | |
| IPState | getSafetyStatus () const |
| Get the current safety status. | |
| const std::string & | getMonitoredDeviceName () const |
| Get the monitored device name. | |
| bool | isDeviceOnline () const |
| Check if the monitored device is online. | |
| bool | hasSafetyStatus () const |
| Check if the SAFETY_STATUS property has been received. | |
| const char * | getDeviceName () const |
| Get the device name for logging purposes (INDI logging requirement) | |
Public Member Functions inherited from INDI::BaseClient | |
| BaseClient () | |
| virtual | ~BaseClient () |
| bool | connectServer () override |
| Connect to INDI server. | |
| bool | disconnectServer (int exit_code=0) override |
| Disconnect from INDI server. Any devices previously created will be deleted and memory cleared. | |
| void | enableDirectBlobAccess (const char *dev=nullptr, const char *prop=nullptr) |
| activate zero-copy delivering of the blob content. When enabled, all blob copy will be avoided when possible (depending on the connection). This changes how the IBLOB.data field : | |
Public Member Functions inherited from INDI::AbstractBaseClient | |
| AbstractBaseClient ()=delete | |
| virtual | ~AbstractBaseClient () |
| void | setServer (const char *hostname, unsigned int port) |
| Set the server host name and port. | |
| const char * | getHost () const |
| Get the server host name. | |
| int | getPort () const |
| Get the port number. | |
| bool | isServerConnected () const |
| Get status of the connection. | |
| void | setConnectionTimeout (uint32_t seconds, uint32_t microseconds) |
| setConnectionTimeout Set connection timeout. By default it is 3 seconds. | |
| void | setVerbose (bool enable) |
| setVerbose Set verbose mode | |
| bool | isVerbose () const |
| isVerbose Is client in verbose mode? | |
| void | watchDevice (const char *deviceName) |
| Add a device to the watch list. | |
| 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. | |
| void | connectDevice (const char *deviceName) |
| Disconnect INDI driver. | |
| void | disconnectDevice (const char *deviceName) |
| Disconnect INDI driver. | |
| 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. | |
| void | setBLOBMode (BLOBHandling blobH, const char *dev, const char *prop=nullptr) |
| Set Binary Large Object policy mode. | |
| BLOBHandling | getBLOBMode (const char *dev, const char *prop=nullptr) |
| getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode | |
| void | sendNewProperty (INDI::Property pp) |
| Send new Property command to server. | |
| void | sendNewText (INDI::Property pp) |
| Send new Text command to server. | |
| void | sendNewText (const char *deviceName, const char *propertyName, const char *elementName, const char *text) |
| Send new Text command to server. | |
| void | sendNewNumber (INDI::Property pp) |
| Send new Number command to server. | |
| void | sendNewNumber (const char *deviceName, const char *propertyName, const char *elementName, double value) |
| Send new Number command to server. | |
| void | sendNewSwitch (INDI::Property pp) |
| Send new Switch command to server. | |
| void | sendNewSwitch (const char *deviceName, const char *propertyName, const char *elementName) |
| Send new Switch command to server. | |
| void | startBlob (const char *devName, const char *propName, const char *timestamp) |
| Send opening tag for BLOB command to server. | |
| 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. | |
| 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. | |
| void | finishBlob () |
| Send closing tag for BLOB command to server. | |
| void | sendPingRequest (const char *uid) |
| Send one ping request, the server will answer back with the same uuid. | |
| void | sendPingReply (const char *uid) |
| Send a ping reply for the given uuid. | |
Public Member Functions inherited from INDI::BaseMediator | |
| virtual | ~BaseMediator ()=default |
| virtual void | removeProperty (INDI::Property property) |
| Emmited when a property is deleted for an INDI driver. | |
| virtual void | newMessage (INDI::BaseDevice baseDevice, int messageID) |
| Emmited when a new message arrives from INDI server. | |
| virtual void | newDevice (INDI::BaseDevice *dp) |
| Emmited when a new device is created from INDI server. | |
| virtual void | removeDevice (INDI::BaseDevice *dp) |
| Emmited when a device is deleted from INDI server. | |
| virtual void | newProperty (INDI::Property *property) |
| Emmited when a new property is created for an INDI driver. | |
| virtual void | removeProperty (INDI::Property *property) |
| Emmited when a property is deleted for an INDI driver. | |
| virtual void | newSwitch (ISwitchVectorProperty *svp) |
| Emmited when a new switch value arrives from INDI server. | |
| virtual void | newNumber (INumberVectorProperty *nvp) |
| Emmited when a new number value arrives from INDI server. | |
| virtual void | newText (ITextVectorProperty *tvp) |
| Emmited when a new text value arrives from INDI server. | |
| virtual void | newLight (ILightVectorProperty *lvp) |
| Emmited when a new light value arrives from INDI server. | |
| virtual void | newBLOB (IBLOB *bp) |
| Emmited when a new property value arrives from INDI server. | |
| virtual void | newMessage (INDI::BaseDevice *dp, int messageID) |
| Emmited when a new message arrives from INDI server. | |
Protected Member Functions | |
| void | newDevice (INDI::BaseDevice dp) override |
| Emmited when a new device is created from INDI server. | |
| void | removeDevice (INDI::BaseDevice dp) override |
| Emmited when a device is deleted from INDI server. | |
| void | newProperty (INDI::Property property) override |
| Emmited when a new property is created for an INDI driver. | |
| void | updateProperty (INDI::Property property) override |
| Emmited when a new property value arrives from INDI server. | |
| void | serverConnected () override |
| Emmited when the server is connected. | |
| void | serverDisconnected (int exitCode) override |
| Emmited when the server gets disconnected. | |
Protected Member Functions inherited from INDI::AbstractBaseClient | |
| virtual void | newPingReply (std::string uid) |
| pingReply are sent by the server on response to pingReply (see above). | |
| 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. | |
| AbstractBaseClient (std::unique_ptr< AbstractBaseClientPrivate > &&dd) | |
Additional Inherited Members | |
Protected Attributes inherited from INDI::AbstractBaseClient | |
| std::unique_ptr< AbstractBaseClientPrivate > | d_ptr_indi |
SafetyMonitorClient connects to a remote INDI device and monitors its SAFETY_STATUS property.
Definition at line 37 of file safetymonitor_client.h.
| SafetyMonitorClient::SafetyMonitorClient | ( | const std::string & | deviceName, |
| std::function< void()> | statusCallback | ||
| ) |
Definition at line 29 of file safetymonitor_client.cpp.
| SafetyMonitorClient::~SafetyMonitorClient | ( | ) |
Definition at line 35 of file safetymonitor_client.cpp.
| bool SafetyMonitorClient::connectToServer | ( | const std::string & | host, |
| int | port | ||
| ) |
Connect to an INDI server.
| host | Server hostname |
| port | Server port |
Definition at line 39 of file safetymonitor_client.cpp.
|
inline |
Get the device name for logging purposes (INDI logging requirement)
Definition at line 79 of file safetymonitor_client.h.
|
inline |
Get the monitored device name.
Definition at line 61 of file safetymonitor_client.h.
| IPState SafetyMonitorClient::getSafetyStatus | ( | ) | const |
Get the current safety status.
Definition at line 59 of file safetymonitor_client.cpp.
|
inline |
Check if the SAFETY_STATUS property has been received.
Definition at line 73 of file safetymonitor_client.h.
|
inline |
Check if the monitored device is online.
Definition at line 67 of file safetymonitor_client.h.
|
overrideprotectedvirtual |
Emmited when a new device is created from INDI server.
| baseDevice | BaseDevice instance. |
Reimplemented from INDI::BaseMediator.
Definition at line 67 of file safetymonitor_client.cpp.
|
overrideprotectedvirtual |
Emmited when a new property is created for an INDI driver.
| property | Property container. |
Reimplemented from INDI::BaseMediator.
Definition at line 86 of file safetymonitor_client.cpp.
|
overrideprotectedvirtual |
Emmited when a device is deleted from INDI server.
| baseDevice | BaseDevice instance. |
Reimplemented from INDI::BaseMediator.
Definition at line 76 of file safetymonitor_client.cpp.
|
overrideprotectedvirtual |
Emmited when the server is connected.
Reimplemented from INDI::BaseMediator.
Definition at line 119 of file safetymonitor_client.cpp.
|
overrideprotectedvirtual |
Emmited when the server gets disconnected.
| exit_code | 0 if client was requested to disconnect from server. -1 if connection to server is terminated due to remote server disconnection. |
Reimplemented from INDI::BaseMediator.
Definition at line 124 of file safetymonitor_client.cpp.
|
overrideprotectedvirtual |
Emmited when a new property value arrives from INDI server.
| property | Property container. |
Reimplemented from INDI::BaseMediator.
Definition at line 105 of file safetymonitor_client.cpp.