TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
INDI::BaseDevice Class Reference

Class to provide basic INDI device functionality. More...

#include <basedevice.h>

Inheritance diagram for INDI::BaseDevice:
Inheritance graph
Collaboration diagram for INDI::BaseDevice:
Collaboration graph

Public Types

enum  INDI_ERROR {
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4,
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4
}
 
enum  DRIVER_INTERFACE {
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15),
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15)
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. More...
 
enum  INDI_ERROR {
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4,
  INDI_DEVICE_NOT_FOUND = -1, INDI_PROPERTY_INVALID = -2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR = -4
}
 
enum  DRIVER_INTERFACE {
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15),
  GENERAL_INTERFACE = 0, TELESCOPE_INTERFACE = (1 << 0), CCD_INTERFACE = (1 << 1), GUIDER_INTERFACE = (1 << 2),
  FOCUSER_INTERFACE = (1 << 3), FILTER_INTERFACE = (1 << 4), DOME_INTERFACE = (1 << 5), GPS_INTERFACE = (1 << 6),
  WEATHER_INTERFACE = (1 << 7), AO_INTERFACE = (1 << 8), DUSTCAP_INTERFACE = (1 << 9), LIGHTBOX_INTERFACE = (1 << 10),
  DETECTOR_INTERFACE = (1 << 11), ROTATOR_INTERFACE = (1 << 12), SPECTROGRAPH_INTERFACE = (1 << 13), AUX_INTERFACE = (1 << 15)
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. More...
 

Public Member Functions

 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 
virtual uint16_t getDriverInterface ()
 
getDriverInterface returns ORed values of DRIVER_INTERFACE. More...
 
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 
virtual uint16_t getDriverInterface ()
 
getDriverInterface returns ORed values of DRIVER_INTERFACE. More...
 

Protected Member Functions

int buildProp (XMLEle *root, char *errmsg)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (XMLEle *root, char *errmsg)
 handle SetXXX commands from client More...
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector. More...
 
int buildProp (XMLEle *root, char *errmsg)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (XMLEle *root, char *errmsg)
 handle SetXXX commands from client More...
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector. More...
 

Private Attributes

char * deviceID
 
std::vector< INDI::Property * > pAll
 
LilXMLlp
 
std::vector< std::string > messageLog
 
INDI::BaseMediatormediator
 

Friends

class INDI::BaseClient
 
class INDI::BaseClientQt
 
class INDI::DefaultDevice
 

Detailed Description

Class to provide basic INDI device functionality.

INDI::BaseDevice is the base device for all INDI devices and contains a list of all properties defined by the device either explicity or via a skeleton file. You don't need to subclass INDI::BaseDevice class directly, it is inheritied by INDI::DefaultDevice which takes care of building a standard INDI device. Moreover, INDI::BaseClient maintains a list of INDI::BaseDevice objects as they get defined from the INDI server, and those objects may be accessed to retrieve information on the object properties or message log.

Author
Jasem Mutlaq

Member Enumeration Documentation

◆ DRIVER_INTERFACE [1/2]

The DRIVER_INTERFACE enum defines the class of devices the driver implements.

A driver may implement one or more interfaces.

Enumerator
GENERAL_INTERFACE 

Default interface for all INDI devices.

TELESCOPE_INTERFACE 

Telescope interface, must subclass INDI::Telescope.

CCD_INTERFACE 

CCD interface, must subclass INDI::CCD.

GUIDER_INTERFACE 

Guider interface, must subclass INDI::GuiderInterface.

FOCUSER_INTERFACE 

Focuser interface, must subclass INDI::FocuserInterface.

FILTER_INTERFACE 

Filter interface, must subclass INDI::FilterInterface.

DOME_INTERFACE 

Dome interface, must subclass INDI::Dome.

GPS_INTERFACE 

GPS interface, must subclass INDI::GPS.

WEATHER_INTERFACE 

Weather interface, must subclass INDI::Weather.

AO_INTERFACE 

Adaptive Optics Interface.

DUSTCAP_INTERFACE 

Dust Cap Interface.

LIGHTBOX_INTERFACE 

Light Box Interface.

DETECTOR_INTERFACE 

Detector interface, must subclass INDI::Detector.

ROTATOR_INTERFACE 

Rotator interface, must subclass INDI::RotatorInterface.

SPECTROGRAPH_INTERFACE 

Spectrograph interface.

AUX_INTERFACE 

Auxiliary interface.

GENERAL_INTERFACE 

Default interface for all INDI devices.

TELESCOPE_INTERFACE 

Telescope interface, must subclass INDI::Telescope.

CCD_INTERFACE 

CCD interface, must subclass INDI::CCD.

GUIDER_INTERFACE 

Guider interface, must subclass INDI::GuiderInterface.

FOCUSER_INTERFACE 

Focuser interface, must subclass INDI::FocuserInterface.

FILTER_INTERFACE 

Filter interface, must subclass INDI::FilterInterface.

DOME_INTERFACE 

Dome interface, must subclass INDI::Dome.

GPS_INTERFACE 

GPS interface, must subclass INDI::GPS.

WEATHER_INTERFACE 

Weather interface, must subclass INDI::Weather.

AO_INTERFACE 

Adaptive Optics Interface.

DUSTCAP_INTERFACE 

Dust Cap Interface.

LIGHTBOX_INTERFACE 

Light Box Interface.

DETECTOR_INTERFACE 

Detector interface, must subclass INDI::Detector.

ROTATOR_INTERFACE 

Rotator interface, must subclass INDI::RotatorInterface.

SPECTROGRAPH_INTERFACE 

Spectrograph interface.

AUX_INTERFACE 

Auxiliary interface.

◆ DRIVER_INTERFACE [2/2]

The DRIVER_INTERFACE enum defines the class of devices the driver implements.

A driver may implement one or more interfaces.

Enumerator
GENERAL_INTERFACE 

Default interface for all INDI devices.

TELESCOPE_INTERFACE 

Telescope interface, must subclass INDI::Telescope.

CCD_INTERFACE 

CCD interface, must subclass INDI::CCD.

GUIDER_INTERFACE 

Guider interface, must subclass INDI::GuiderInterface.

FOCUSER_INTERFACE 

Focuser interface, must subclass INDI::FocuserInterface.

FILTER_INTERFACE 

Filter interface, must subclass INDI::FilterInterface.

DOME_INTERFACE 

Dome interface, must subclass INDI::Dome.

GPS_INTERFACE 

GPS interface, must subclass INDI::GPS.

WEATHER_INTERFACE 

Weather interface, must subclass INDI::Weather.

AO_INTERFACE 

Adaptive Optics Interface.

DUSTCAP_INTERFACE 

Dust Cap Interface.

LIGHTBOX_INTERFACE 

Light Box Interface.

DETECTOR_INTERFACE 

Detector interface, must subclass INDI::Detector.

ROTATOR_INTERFACE 

Rotator interface, must subclass INDI::RotatorInterface.

SPECTROGRAPH_INTERFACE 

Spectrograph interface.

AUX_INTERFACE 

Auxiliary interface.

GENERAL_INTERFACE 

Default interface for all INDI devices.

TELESCOPE_INTERFACE 

Telescope interface, must subclass INDI::Telescope.

CCD_INTERFACE 

CCD interface, must subclass INDI::CCD.

GUIDER_INTERFACE 

Guider interface, must subclass INDI::GuiderInterface.

FOCUSER_INTERFACE 

Focuser interface, must subclass INDI::FocuserInterface.

FILTER_INTERFACE 

Filter interface, must subclass INDI::FilterInterface.

DOME_INTERFACE 

Dome interface, must subclass INDI::Dome.

GPS_INTERFACE 

GPS interface, must subclass INDI::GPS.

WEATHER_INTERFACE 

Weather interface, must subclass INDI::Weather.

AO_INTERFACE 

Adaptive Optics Interface.

DUSTCAP_INTERFACE 

Dust Cap Interface.

LIGHTBOX_INTERFACE 

Light Box Interface.

DETECTOR_INTERFACE 

Detector interface, must subclass INDI::Detector.

ROTATOR_INTERFACE 

Rotator interface, must subclass INDI::RotatorInterface.

SPECTROGRAPH_INTERFACE 

Spectrograph interface.

AUX_INTERFACE 

Auxiliary interface.

◆ INDI_ERROR [1/2]

INDI error codes.

Enumerator
INDI_DEVICE_NOT_FOUND 

INDI Device was not found.

INDI_PROPERTY_INVALID 

Property has an invalid syntax or attribute.

INDI_PROPERTY_DUPLICATED 

INDI Device was not found.

INDI_DISPATCH_ERROR 

Dispatching command to driver failed.

INDI_DEVICE_NOT_FOUND 

INDI Device was not found.

INDI_PROPERTY_INVALID 

Property has an invalid syntax or attribute.

INDI_PROPERTY_DUPLICATED 

INDI Device was not found.

INDI_DISPATCH_ERROR 

Dispatching command to driver failed.

◆ INDI_ERROR [2/2]

INDI error codes.

Enumerator
INDI_DEVICE_NOT_FOUND 

INDI Device was not found.

INDI_PROPERTY_INVALID 

Property has an invalid syntax or attribute.

INDI_PROPERTY_DUPLICATED 

INDI Device was not found.

INDI_DISPATCH_ERROR 

Dispatching command to driver failed.

INDI_DEVICE_NOT_FOUND 

INDI Device was not found.

INDI_PROPERTY_INVALID 

Property has an invalid syntax or attribute.

INDI_PROPERTY_DUPLICATED 

INDI Device was not found.

INDI_DISPATCH_ERROR 

Dispatching command to driver failed.

Constructor & Destructor Documentation

◆ BaseDevice() [1/2]

INDI::BaseDevice::BaseDevice ( )

◆ ~BaseDevice() [1/2]

INDI::BaseDevice::~BaseDevice ( )
virtual

◆ BaseDevice() [2/2]

INDI::BaseDevice::BaseDevice ( )

◆ ~BaseDevice() [2/2]

virtual INDI::BaseDevice::~BaseDevice ( )
virtual

Member Function Documentation

◆ addMessage() [1/2]

void INDI::BaseDevice::addMessage ( const std::string &  msg)

Add message to the driver's message queue.

Parameters
msgMessage to add.

◆ addMessage() [2/2]

void INDI::BaseDevice::addMessage ( const std::string &  msg)

Add message to the driver's message queue.

Parameters
msgMessage to add.

◆ buildProp() [1/2]

int INDI::BaseDevice::buildProp ( XMLEle root,
char *  errmsg 
)
protected

Build a property given the supplied XML element (defXXX)

Parameters
rootXML element to parse and build.
errmsgbuffer to store error message in parsing fails.
Returns
0 if parsing is successful, -1 otherwise and errmsg is set

◆ buildProp() [2/2]

int INDI::BaseDevice::buildProp ( XMLEle root,
char *  errmsg 
)
protected

Build a property given the supplied XML element (defXXX)

Parameters
rootXML element to parse and build.
errmsgbuffer to store error message in parsing fails.
Returns
0 if parsing is successful, -1 otherwise and errmsg is set

◆ buildSkeleton() [1/2]

bool INDI::BaseDevice::buildSkeleton ( const char *  filename)

Build driver properties from a skeleton file.

Parameters
filenamefull path name of the file.
Returns
true if successful, false otherwise.

A skeloton file defines the properties supported by this driver. It is a list of defXXX elements enclosed by <INDIDriver>@ and </INDIDriver>@ opening and closing tags. After the properties are created, they can be rerieved, manipulated, and defined to other clients.

See also
An example skeleton file can be found under examples/tutorial_four_sk.xml

◆ buildSkeleton() [2/2]

bool INDI::BaseDevice::buildSkeleton ( const char *  filename)

Build driver properties from a skeleton file.

Parameters
filenamefull path name of the file.
Returns
true if successful, false otherwise.

A skeloton file defines the properties supported by this driver. It is a list of defXXX elements enclosed by <INDIDriver>@ and </INDIDriver>@ opening and closing tags. After the properties are created, they can be rerieved, manipulated, and defined to other clients.

See also
An example skeleton file can be found under examples/tutorial_four_sk.xml

◆ checkMessage() [1/2]

void INDI::BaseDevice::checkMessage ( XMLEle root)

◆ checkMessage() [2/2]

void INDI::BaseDevice::checkMessage ( XMLEle root)

◆ doMessage() [1/2]

void INDI::BaseDevice::doMessage ( XMLEle msg)

◆ doMessage() [2/2]

void INDI::BaseDevice::doMessage ( XMLEle msg)

◆ getBLOB() [1/2]

IBLOBVectorProperty* INDI::BaseDevice::getBLOB ( const char *  name)
Returns
Return vector BLOB property given its name

◆ getBLOB() [2/2]

IBLOBVectorProperty * INDI::BaseDevice::getBLOB ( const char *  name)
Returns
Return vector BLOB property given its name

◆ getDeviceName() [1/2]

const char * INDI::BaseDevice::getDeviceName ( )
Returns
Returns the device name

◆ getDeviceName() [2/2]

const char* INDI::BaseDevice::getDeviceName ( )
Returns
Returns the device name

◆ getDriverExec() [1/2]

const char * INDI::BaseDevice::getDriverExec ( )
Returns
driver executable name
Note
This can only be valid if DRIVER_INFO is defined by the driver.

◆ getDriverExec() [2/2]

const char* INDI::BaseDevice::getDriverExec ( )
Returns
driver executable name
Note
This can only be valid if DRIVER_INFO is defined by the driver.

◆ getDriverInterface() [1/2]

uint16_t INDI::BaseDevice::getDriverInterface ( )
virtual


getDriverInterface returns ORed values of DRIVER_INTERFACE.

Returns
It presents the device classes supported by the driver.
driver device interface descriptor.
Note
For example, to know if the driver supports CCD interface, check the retruned value:
if (device->getDriverInterface() & CCD_INTERFACE)
cout << "We received a camera!" << endl;

Reimplemented in INDI::DefaultDevice, and INDI::DefaultDevice.

◆ getDriverInterface() [2/2]

virtual uint16_t INDI::BaseDevice::getDriverInterface ( )
virtual


getDriverInterface returns ORed values of DRIVER_INTERFACE.

Returns
It presents the device classes supported by the driver.
driver device interface descriptor.
Note
For example, to know if the driver supports CCD interface, check the retruned value:
if (device->getDriverInterface() & CCD_INTERFACE)
cout << "We received a camera!" << endl;

Reimplemented in INDI::DefaultDevice, and INDI::DefaultDevice.

◆ getDriverName() [1/2]

const char* INDI::BaseDevice::getDriverName ( )
Returns
driver name
Note
This can only be valid if DRIVER_INFO is defined by the driver.

◆ getDriverName() [2/2]

const char * INDI::BaseDevice::getDriverName ( )
Returns
driver name
Note
This can only be valid if DRIVER_INFO is defined by the driver.

◆ getDriverVersion() [1/2]

const char * INDI::BaseDevice::getDriverVersion ( )
Returns
driver version
Note
This can only be valid if DRIVER_INFO is defined by the driver.

◆ getDriverVersion() [2/2]

const char* INDI::BaseDevice::getDriverVersion ( )
Returns
driver version
Note
This can only be valid if DRIVER_INFO is defined by the driver.

◆ getLight() [1/2]

ILightVectorProperty * INDI::BaseDevice::getLight ( const char *  name)
Returns
Return vector light property given its name

◆ getLight() [2/2]

ILightVectorProperty* INDI::BaseDevice::getLight ( const char *  name)
Returns
Return vector light property given its name

◆ getMediator() [1/2]

INDI::BaseMediator* INDI::BaseDevice::getMediator ( )
inline
Returns
Get the meditator assigned to this driver

◆ getMediator() [2/2]

INDI::BaseMediator* INDI::BaseDevice::getMediator ( )
inline
Returns
Get the meditator assigned to this driver

◆ getNumber() [1/2]

INumberVectorProperty * INDI::BaseDevice::getNumber ( const char *  name)
Returns
Return vector number property given its name

◆ getNumber() [2/2]

INumberVectorProperty* INDI::BaseDevice::getNumber ( const char *  name)
Returns
Return vector number property given its name

◆ getProperties() [1/2]

std::vector<INDI::Property *>* INDI::BaseDevice::getProperties ( )
inline

Return a list of all properties in the device.

◆ getProperties() [2/2]

std::vector<INDI::Property *>* INDI::BaseDevice::getProperties ( )
inline

Return a list of all properties in the device.

◆ getProperty() [1/2]

INDI::Property* INDI::BaseDevice::getProperty ( const char *  name,
INDI_PROPERTY_TYPE  type = INDI_UNKNOWN 
)

Return a property and its type given its name.

Parameters
nameof property to be found.
typeof property found.
Returns
If property is found, it is returned. To be used you must use static_cast with given the type of property returned.

◆ getProperty() [2/2]

INDI::Property * INDI::BaseDevice::getProperty ( const char *  name,
INDI_PROPERTY_TYPE  type = INDI_UNKNOWN 
)

Return a property and its type given its name.

Parameters
nameof property to be found.
typeof property found.
Returns
If property is found, it is returned. To be used you must use static_cast with given the type of property returned.

◆ getPropertyPermission() [1/2]

IPerm INDI::BaseDevice::getPropertyPermission ( const char *  name)
Returns
Return property permission

◆ getPropertyPermission() [2/2]

IPerm INDI::BaseDevice::getPropertyPermission ( const char *  name)
Returns
Return property permission

◆ getPropertyState() [1/2]

IPState INDI::BaseDevice::getPropertyState ( const char *  name)
Returns
Return property state

◆ getPropertyState() [2/2]

IPState INDI::BaseDevice::getPropertyState ( const char *  name)
Returns
Return property state

◆ getRawProperty() [1/2]

void * INDI::BaseDevice::getRawProperty ( const char *  name,
INDI_PROPERTY_TYPE  type = INDI_UNKNOWN 
)

Return a property and its type given its name.

Parameters
nameof property to be found.
typeof property found.
Returns
If property is found, the raw void * pointer to the IXXXVectorProperty is returned. To be used you must use static_cast with given the type of property returned. For example, INumberVectorProperty *num = static_cast<INumberVectorProperty> getRawProperty("FOO", INDI_NUMBER);
Note
This is a low-level function and should not be called directly unless necessary. Use getXXX instead where XXX is the property type (Number, Text, Switch..etc).

◆ getRawProperty() [2/2]

void* INDI::BaseDevice::getRawProperty ( const char *  name,
INDI_PROPERTY_TYPE  type = INDI_UNKNOWN 
)

Return a property and its type given its name.

Parameters
nameof property to be found.
typeof property found.
Returns
If property is found, the raw void * pointer to the IXXXVectorProperty is returned. To be used you must use static_cast with given the type of property returned. For example, INumberVectorProperty *num = static_cast<INumberVectorProperty> getRawProperty("FOO", INDI_NUMBER);
Note
This is a low-level function and should not be called directly unless necessary. Use getXXX instead where XXX is the property type (Number, Text, Switch..etc).

◆ getSwitch() [1/2]

ISwitchVectorProperty* INDI::BaseDevice::getSwitch ( const char *  name)
Returns
Return vector switch property given its name

◆ getSwitch() [2/2]

ISwitchVectorProperty * INDI::BaseDevice::getSwitch ( const char *  name)
Returns
Return vector switch property given its name

◆ getText() [1/2]

ITextVectorProperty* INDI::BaseDevice::getText ( const char *  name)
Returns
Return vector text property given its name

◆ getText() [2/2]

ITextVectorProperty * INDI::BaseDevice::getText ( const char *  name)
Returns
Return vector text property given its name

◆ isConnected() [1/2]

bool INDI::BaseDevice::isConnected ( )
Returns
True if the device is connected (CONNECT=ON), False otherwise

◆ isConnected() [2/2]

bool INDI::BaseDevice::isConnected ( )
Returns
True if the device is connected (CONNECT=ON), False otherwise

◆ lastMessage() [1/2]

std::string INDI::BaseDevice::lastMessage ( )
Returns
Returns last message message.

◆ lastMessage() [2/2]

std::string INDI::BaseDevice::lastMessage ( )
Returns
Returns last message message.

◆ messageQueue() [1/2]

std::string INDI::BaseDevice::messageQueue ( int  index) const
Returns
Returns a specific message.

◆ messageQueue() [2/2]

std::string INDI::BaseDevice::messageQueue ( int  index) const
Returns
Returns a specific message.

◆ registerProperty() [1/2]

void INDI::BaseDevice::registerProperty ( void *  p,
INDI_PROPERTY_TYPE  type 
)

◆ registerProperty() [2/2]

void INDI::BaseDevice::registerProperty ( void *  p,
INDI_PROPERTY_TYPE  type 
)

◆ removeProperty() [1/2]

int INDI::BaseDevice::removeProperty ( const char *  name,
char *  errmsg 
)

Remove a property.

Parameters
namename of property to be removed. Pass NULL to remove the whole device.
errmsgbuffer to store error message.
Returns
0 if successul, -1 otherwise.

◆ removeProperty() [2/2]

int INDI::BaseDevice::removeProperty ( const char *  name,
char *  errmsg 
)

Remove a property.

Parameters
namename of property to be removed. Pass NULL to remove the whole device.
errmsgbuffer to store error message.
Returns
0 if successul, -1 otherwise.

◆ setBLOB() [1/2]

int INDI::BaseDevice::setBLOB ( IBLOBVectorProperty pp,
XMLEle root,
char *  errmsg 
)
protected

Parse and store BLOB in the respective vector.

◆ setBLOB() [2/2]

int INDI::BaseDevice::setBLOB ( IBLOBVectorProperty pp,
XMLEle root,
char *  errmsg 
)
protected

Parse and store BLOB in the respective vector.

◆ setDeviceName() [1/2]

void INDI::BaseDevice::setDeviceName ( const char *  dev)

Set the device name.

Parameters
devnew device name

◆ setDeviceName() [2/2]

void INDI::BaseDevice::setDeviceName ( const char *  dev)

Set the device name.

Parameters
devnew device name

◆ setMediator() [1/2]

void INDI::BaseDevice::setMediator ( INDI::BaseMediator med)
inline

Set the driver's mediator to receive notification of news devices and updated property values.

◆ setMediator() [2/2]

void INDI::BaseDevice::setMediator ( INDI::BaseMediator med)
inline

Set the driver's mediator to receive notification of news devices and updated property values.

◆ setValue() [1/2]

int INDI::BaseDevice::setValue ( XMLEle root,
char *  errmsg 
)
protected

handle SetXXX commands from client

◆ setValue() [2/2]

int INDI::BaseDevice::setValue ( XMLEle root,
char *  errmsg 
)
protected

handle SetXXX commands from client

Friends And Related Function Documentation

◆ INDI::BaseClient

◆ INDI::BaseClientQt

◆ INDI::DefaultDevice

Member Data Documentation

◆ deviceID

char * INDI::BaseDevice::deviceID
private

◆ lp

LilXML * INDI::BaseDevice::lp
private

◆ mediator

INDI::BaseMediator * INDI::BaseDevice::mediator
private

◆ messageLog

std::vector< std::string > INDI::BaseDevice::messageLog
private

◆ pAll

std::vector< INDI::Property * > INDI::BaseDevice::pAll
private

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