TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SkySafariClient Class Reference

#include <skysafariclient.h>

Inheritance diagram for SkySafariClient:
Inheritance graph
Collaboration diagram for SkySafariClient:
Collaboration graph

Public Types

enum  GotoMode { SLEW, TRACK, SYNC }
 

Public Member Functions

 SkySafariClient ()
 
 ~SkySafariClient ()
 
bool isConnected ()
 
void setMount (const std::string &value)
 
INumberVectorPropertygetEquatorialCoords ()
 
bool sendEquatorialCoords ()
 
INumberVectorPropertygetGeographiCoords ()
 
bool sendGeographicCoords ()
 
ISwitchVectorPropertygetGotoMode ()
 
bool sendGotoMode ()
 
ISwitchVectorPropertygetMotionNS ()
 
bool setMotionNS ()
 
ISwitchVectorPropertygetMotionWE ()
 
bool setMotionWE ()
 
bool parkMount ()
 
IPState getMountParkState ()
 
bool setSlewRate (int slewRate)
 
bool abort ()
 
ITextVectorPropertygetTimeUTC ()
 
bool setTimeUTC ()
 
- Public Member Functions inherited from INDI::BaseClient
 BaseClient ()
 
virtual ~BaseClient ()
 
void setServer (const char *hostname, unsigned int port)
 Set the server host name and port. More...
 
void watchDevice (const char *deviceName)
 Add a device to the watch list. More...
 
bool connectServer ()
 Connect to INDI server. More...
 
bool disconnectServer ()
 Disconnect from INDI server. More...
 
bool isServerConnected () const
 
void connectDevice (const char *deviceName)
 Connect to INDI driver. More...
 
void disconnectDevice (const char *deviceName)
 Disconnect INDI driver. More...
 
INDI::BaseDevicegetDevice (const char *deviceName)
 
const 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=NULL)
 Set Binary Large Object policy mode. More...
 
BLOBHandling getBLOBMode (const char *dev, const char *prop=NULL)
 getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode More...
 
const char * getHost ()
 
int getPort ()
 
void sendNewText (ITextVectorProperty *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 (INumberVectorProperty *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 (ISwitchVectorProperty *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. More...
 
void sendOneBlob (const char *blobName, unsigned int blobSize, const char *blobFormat, void *blobBuffer)
 Send ONE blob content to server. More...
 
void finishBlob ()
 Send closing tag for BLOB command to server. More...
 
void setVerbose (bool enable)
 setVerbose Set verbose mode More...
 
bool isVerbose () const
 isVerbose Is client in verbose mode? More...
 
void setConnectionTimeout (uint32_t seconds, uint32_t microseconds)
 setConnectionTimeout Set connection timeout. More...
 
 BaseClient ()
 
virtual ~BaseClient ()
 
void setServer (const char *hostname, unsigned int port)
 Set the server host name and port. More...
 
void watchDevice (const char *deviceName)
 Add a device to the watch list. More...
 
bool connectServer ()
 Connect to INDI server. More...
 
bool disconnectServer ()
 Disconnect from INDI server. More...
 
bool isServerConnected () const
 
void connectDevice (const char *deviceName)
 Connect to INDI driver. More...
 
void disconnectDevice (const char *deviceName)
 Disconnect INDI driver. More...
 
INDI::BaseDevicegetDevice (const char *deviceName)
 
const 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=NULL)
 Set Binary Large Object policy mode. More...
 
BLOBHandling getBLOBMode (const char *dev, const char *prop=NULL)
 getBLOBMode Get Binary Large Object policy mode IF set previously by setBLOBMode More...
 
const char * getHost ()
 
int getPort ()
 
void sendNewText (ITextVectorProperty *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 (INumberVectorProperty *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 (ISwitchVectorProperty *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. More...
 
void sendOneBlob (const char *blobName, unsigned int blobSize, const char *blobFormat, void *blobBuffer)
 Send ONE blob content to server. More...
 
void finishBlob ()
 Send closing tag for BLOB command to server. More...
 
void setVerbose (bool enable)
 setVerbose Set verbose mode More...
 
bool isVerbose () const
 isVerbose Is client in verbose mode? More...
 
void setConnectionTimeout (uint32_t seconds, uint32_t microseconds)
 setConnectionTimeout Set connection timeout. More...
 
- Public Member Functions inherited from INDI::BaseMediator
virtual ~BaseMediator ()
 
virtual ~BaseMediator ()
 

Protected Member Functions

virtual void newDevice (INDI::BaseDevice *dp)
 Emmited when a new device is created from INDI server. More...
 
virtual void removeDevice (INDI::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 removeProperty (INDI::Property *)
 Emmited when a property is deleted for an INDI driver. More...
 
virtual void newBLOB (IBLOB *)
 Emmited when a new BLOB value arrives from INDI server. More...
 
virtual void newSwitch (ISwitchVectorProperty *)
 Emmited when a new switch value arrives from INDI server. More...
 
virtual void newNumber (INumberVectorProperty *)
 Emmited when a new number value arrives from INDI server. More...
 
virtual void newMessage (INDI::BaseDevice *, int)
 Emmited when a new message arrives from INDI server. More...
 
virtual void newText (ITextVectorProperty *)
 Emmited when a new text value arrives from INDI server. More...
 
virtual void newLight (ILightVectorProperty *)
 Emmited when a new light value arrives from INDI server. More...
 
virtual void serverConnected ()
 Emmited when the server is connected. More...
 
virtual void serverDisconnected (int)
 Emmited when the server gets disconnected. More...
 
- Protected Member Functions inherited from INDI::BaseClient
int dispatchCommand (XMLEle *root, char *errmsg)
 Dispatch command received from INDI server to respective devices handled by the client. More...
 
int deleteDevice (const char *devName, char *errmsg)
 Remove device. More...
 
int delPropertyCmd (XMLEle *root, char *errmsg)
 Delete property command. More...
 
INDI::BaseDevicefindDev (const char *devName, char *errmsg)
 Find and return a particular device. More...
 
INDI::BaseDeviceaddDevice (XMLEle *dep, char *errmsg)
 Add a new device. More...
 
INDI::BaseDevicefindDev (XMLEle *root, int create, char *errmsg)
 Find a device, and if it doesn't exist, create it if create is set to 1. More...
 
int messageCmd (XMLEle *root, char *errmsg)
 Process messages. More...
 
virtual void newUniversalMessage (std::string message)
 newUniversalMessage Universal messages are sent from INDI server without a specific device. More...
 
int dispatchCommand (XMLEle *root, char *errmsg)
 Dispatch command received from INDI server to respective devices handled by the client. More...
 
int deleteDevice (const char *devName, char *errmsg)
 Remove device. More...
 
int delPropertyCmd (XMLEle *root, char *errmsg)
 Delete property command. More...
 
INDI::BaseDevicefindDev (const char *devName, char *errmsg)
 Find and return a particular device. More...
 
INDI::BaseDeviceaddDevice (XMLEle *dep, char *errmsg)
 Add a new device. More...
 
INDI::BaseDevicefindDev (XMLEle *root, int create, char *errmsg)
 Find a device, and if it doesn't exist, create it if create is set to 1. More...
 
int messageCmd (XMLEle *root, char *errmsg)
 Process messages. More...
 
virtual void newUniversalMessage (std::string message)
 newUniversalMessage Universal messages are sent from INDI server without a specific device. More...
 

Private Attributes

std::string mount
 
bool isReady
 
bool mountOnline
 
ISwitchVectorPropertymountParkSP = nullptr
 
ISwitchVectorPropertygotoModeSP = nullptr
 
INumberVectorPropertyeqCoordsNP = nullptr
 
INumberVectorPropertygeoCoordsNP = nullptr
 
ISwitchVectorPropertyabortSP = nullptr
 
ISwitchVectorPropertyslewRateSP = nullptr
 
ISwitchVectorPropertymotionNSSP = nullptr
 
ISwitchVectorPropertymotionWESP = nullptr
 
ITextVectorPropertytimeUTC = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from INDI::BaseClient
static void * listenHelper (void *context)
 
static void * listenHelper (void *context)
 

Member Enumeration Documentation

◆ GotoMode

Enumerator
SLEW 
TRACK 
SYNC 

Constructor & Destructor Documentation

◆ SkySafariClient()

SkySafariClient::SkySafariClient ( )

◆ ~SkySafariClient()

SkySafariClient::~SkySafariClient ( )

Member Function Documentation

◆ abort()

bool SkySafariClient::abort ( )

◆ getEquatorialCoords()

INumberVectorProperty* SkySafariClient::getEquatorialCoords ( )
inline

◆ getGeographiCoords()

INumberVectorProperty* SkySafariClient::getGeographiCoords ( )
inline

◆ getGotoMode()

ISwitchVectorProperty* SkySafariClient::getGotoMode ( )
inline

◆ getMotionNS()

ISwitchVectorProperty* SkySafariClient::getMotionNS ( )
inline

◆ getMotionWE()

ISwitchVectorProperty* SkySafariClient::getMotionWE ( )
inline

◆ getMountParkState()

IPState SkySafariClient::getMountParkState ( )

◆ getTimeUTC()

ITextVectorProperty* SkySafariClient::getTimeUTC ( )
inline

◆ isConnected()

bool SkySafariClient::isConnected ( )
inline

◆ newBLOB()

virtual void SkySafariClient::newBLOB ( IBLOB bp)
inlineprotectedvirtual

Emmited when a new BLOB value arrives from INDI server.

Parameters
bpPointer to filled and process BLOB.

Implements INDI::BaseMediator.

◆ newDevice()

void SkySafariClient::newDevice ( INDI::BaseDevice dp)
protectedvirtual

Emmited when a new device is created from INDI server.

Parameters
dpPointer to the base device instance

Implements INDI::BaseMediator.

◆ newLight()

virtual void SkySafariClient::newLight ( ILightVectorProperty lvp)
inlineprotectedvirtual

Emmited when a new light value arrives from INDI server.

Parameters
lvpPointer to a light vector property.

Implements INDI::BaseMediator.

◆ newMessage()

virtual void SkySafariClient::newMessage ( INDI::BaseDevice dp,
int  messageID 
)
inlineprotectedvirtual

Emmited when a new message arrives from INDI server.

Parameters
dppointer to the INDI device the message is sent to.
messageIDID of the message that can be used to retrieve the message from the device's messageQueue() function.

Implements INDI::BaseMediator.

◆ newNumber()

virtual void SkySafariClient::newNumber ( INumberVectorProperty nvp)
inlineprotectedvirtual

Emmited when a new number value arrives from INDI server.

Parameters
nvpPointer to a number vector property.

Implements INDI::BaseMediator.

◆ newProperty()

void SkySafariClient::newProperty ( INDI::Property property)
protectedvirtual

Emmited when a new property is created for an INDI driver.

Parameters
propertyPointer to the Property Container

Implements INDI::BaseMediator.

◆ newSwitch()

virtual void SkySafariClient::newSwitch ( ISwitchVectorProperty svp)
inlineprotectedvirtual

Emmited when a new switch value arrives from INDI server.

Parameters
svpPointer to a switch vector property.

Implements INDI::BaseMediator.

◆ newText()

virtual void SkySafariClient::newText ( ITextVectorProperty tvp)
inlineprotectedvirtual

Emmited when a new text value arrives from INDI server.

Parameters
tvpPointer to a text vector property.

Implements INDI::BaseMediator.

◆ parkMount()

bool SkySafariClient::parkMount ( )

◆ removeDevice()

virtual void SkySafariClient::removeDevice ( INDI::BaseDevice dp)
inlineprotectedvirtual

Emmited when a device is deleted from INDI server.

Parameters
dpPointer to the base device instance.

Implements INDI::BaseMediator.

◆ removeProperty()

virtual void SkySafariClient::removeProperty ( INDI::Property property)
inlineprotectedvirtual

Emmited when a property is deleted for an INDI driver.

Parameters
propertyPointer to the Property Container to remove.

Implements INDI::BaseMediator.

◆ sendEquatorialCoords()

bool SkySafariClient::sendEquatorialCoords ( )

◆ sendGeographicCoords()

bool SkySafariClient::sendGeographicCoords ( )

◆ sendGotoMode()

bool SkySafariClient::sendGotoMode ( )

◆ serverConnected()

virtual void SkySafariClient::serverConnected ( )
inlineprotectedvirtual

Emmited when the server is connected.

Implements INDI::BaseMediator.

◆ serverDisconnected()

virtual void SkySafariClient::serverDisconnected ( int  exit_code)
inlineprotectedvirtual

Emmited when the server gets disconnected.

Parameters
exit_code0 if client was requested to disconnect from server. -1 if connection to server is terminated due to remote server disconnection.

Implements INDI::BaseMediator.

◆ setMotionNS()

bool SkySafariClient::setMotionNS ( )

◆ setMotionWE()

bool SkySafariClient::setMotionWE ( )

◆ setMount()

void SkySafariClient::setMount ( const std::string &  value)

◆ setSlewRate()

bool SkySafariClient::setSlewRate ( int  slewRate)

◆ setTimeUTC()

bool SkySafariClient::setTimeUTC ( )

Member Data Documentation

◆ abortSP

ISwitchVectorProperty* SkySafariClient::abortSP = nullptr
private

◆ eqCoordsNP

INumberVectorProperty* SkySafariClient::eqCoordsNP = nullptr
private

◆ geoCoordsNP

INumberVectorProperty* SkySafariClient::geoCoordsNP = nullptr
private

◆ gotoModeSP

ISwitchVectorProperty* SkySafariClient::gotoModeSP = nullptr
private

◆ isReady

bool SkySafariClient::isReady
private

◆ motionNSSP

ISwitchVectorProperty* SkySafariClient::motionNSSP = nullptr
private

◆ motionWESP

ISwitchVectorProperty* SkySafariClient::motionWESP = nullptr
private

◆ mount

std::string SkySafariClient::mount
private

◆ mountOnline

bool SkySafariClient::mountOnline
private

◆ mountParkSP

ISwitchVectorProperty* SkySafariClient::mountParkSP = nullptr
private

◆ slewRateSP

ISwitchVectorProperty* SkySafariClient::slewRateSP = nullptr
private

◆ timeUTC

ITextVectorProperty* SkySafariClient::timeUTC = nullptr
private

The documentation for this class was generated from the following files: