TwiceAsNice
2019-02-18
|
Class to provide basic INDI device functionality. More...
#include <basedevice.h>
Public Member Functions | |
BaseDevice () | |
virtual | ~BaseDevice () |
INumberVectorProperty * | getNumber (const char *name) |
ITextVectorProperty * | getText (const char *name) |
ISwitchVectorProperty * | getSwitch (const char *name) |
ILightVectorProperty * | getLight (const char *name) |
IBLOBVectorProperty * | getBLOB (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::Property * | getProperty (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::BaseMediator * | getMediator () |
const char * | getDriverName () |
const char * | getDriverExec () |
const char * | getDriverVersion () |
virtual uint16_t | getDriverInterface () |
getDriverInterface returns ORed values of DRIVER_INTERFACE. More... | |
BaseDevice () | |
virtual | ~BaseDevice () |
INumberVectorProperty * | getNumber (const char *name) |
ITextVectorProperty * | getText (const char *name) |
ISwitchVectorProperty * | getSwitch (const char *name) |
ILightVectorProperty * | getLight (const char *name) |
IBLOBVectorProperty * | getBLOB (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::Property * | getProperty (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::BaseMediator * | getMediator () |
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 |
LilXML * | lp |
std::vector< std::string > | messageLog |
INDI::BaseMediator * | mediator |
Friends | |
class | INDI::BaseClient |
class | INDI::BaseClientQt |
class | INDI::DefaultDevice |
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.
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 | |
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 | |
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 | |
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 | |
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. |
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 | |
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 | |
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 | |
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 | |
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 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 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::BaseDevice::BaseDevice | ( | ) |
|
virtual |
INDI::BaseDevice::BaseDevice | ( | ) |
|
virtual |
void INDI::BaseDevice::addMessage | ( | const std::string & | msg | ) |
Add message to the driver's message queue.
msg | Message to add. |
void INDI::BaseDevice::addMessage | ( | const std::string & | msg | ) |
Add message to the driver's message queue.
msg | Message to add. |
|
protected |
Build a property given the supplied XML element (defXXX)
root | XML element to parse and build. |
errmsg | buffer to store error message in parsing fails. |
|
protected |
Build a property given the supplied XML element (defXXX)
root | XML element to parse and build. |
errmsg | buffer to store error message in parsing fails. |
Build driver properties from a skeleton file.
filename | full path name of the file. |
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.
Build driver properties from a skeleton file.
filename | full path name of the file. |
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.
void INDI::BaseDevice::checkMessage | ( | XMLEle * | root | ) |
void INDI::BaseDevice::checkMessage | ( | XMLEle * | root | ) |
void INDI::BaseDevice::doMessage | ( | XMLEle * | msg | ) |
void INDI::BaseDevice::doMessage | ( | XMLEle * | msg | ) |
IBLOBVectorProperty* INDI::BaseDevice::getBLOB | ( | const char * | name | ) |
IBLOBVectorProperty * INDI::BaseDevice::getBLOB | ( | const char * | name | ) |
const char * INDI::BaseDevice::getDeviceName | ( | ) |
const char* INDI::BaseDevice::getDeviceName | ( | ) |
const char * INDI::BaseDevice::getDriverExec | ( | ) |
const char* INDI::BaseDevice::getDriverExec | ( | ) |
|
virtual |
getDriverInterface returns ORed values of DRIVER_INTERFACE.
Reimplemented in INDI::DefaultDevice, and INDI::DefaultDevice.
|
virtual |
getDriverInterface returns ORed values of DRIVER_INTERFACE.
Reimplemented in INDI::DefaultDevice, and INDI::DefaultDevice.
const char* INDI::BaseDevice::getDriverName | ( | ) |
const char * INDI::BaseDevice::getDriverName | ( | ) |
const char * INDI::BaseDevice::getDriverVersion | ( | ) |
const char* INDI::BaseDevice::getDriverVersion | ( | ) |
ILightVectorProperty * INDI::BaseDevice::getLight | ( | const char * | name | ) |
ILightVectorProperty* INDI::BaseDevice::getLight | ( | const char * | name | ) |
|
inline |
|
inline |
INumberVectorProperty * INDI::BaseDevice::getNumber | ( | const char * | name | ) |
INumberVectorProperty* INDI::BaseDevice::getNumber | ( | const char * | name | ) |
|
inline |
Return a list of all properties in the device.
|
inline |
Return a list of all properties in the device.
INDI::Property* INDI::BaseDevice::getProperty | ( | const char * | name, |
INDI_PROPERTY_TYPE | type = INDI_UNKNOWN |
||
) |
Return a property and its type given its name.
name | of property to be found. |
type | of property found. |
INDI::Property * INDI::BaseDevice::getProperty | ( | const char * | name, |
INDI_PROPERTY_TYPE | type = INDI_UNKNOWN |
||
) |
Return a property and its type given its name.
name | of property to be found. |
type | of property found. |
void * INDI::BaseDevice::getRawProperty | ( | const char * | name, |
INDI_PROPERTY_TYPE | type = INDI_UNKNOWN |
||
) |
Return a property and its type given its name.
name | of property to be found. |
type | of property found. |
void* INDI::BaseDevice::getRawProperty | ( | const char * | name, |
INDI_PROPERTY_TYPE | type = INDI_UNKNOWN |
||
) |
Return a property and its type given its name.
name | of property to be found. |
type | of property found. |
ISwitchVectorProperty* INDI::BaseDevice::getSwitch | ( | const char * | name | ) |
ISwitchVectorProperty * INDI::BaseDevice::getSwitch | ( | const char * | name | ) |
ITextVectorProperty* INDI::BaseDevice::getText | ( | const char * | name | ) |
ITextVectorProperty * INDI::BaseDevice::getText | ( | const char * | name | ) |
bool INDI::BaseDevice::isConnected | ( | ) |
bool INDI::BaseDevice::isConnected | ( | ) |
std::string INDI::BaseDevice::lastMessage | ( | ) |
std::string INDI::BaseDevice::lastMessage | ( | ) |
std::string INDI::BaseDevice::messageQueue | ( | int | index | ) | const |
std::string INDI::BaseDevice::messageQueue | ( | int | index | ) | const |
void INDI::BaseDevice::registerProperty | ( | void * | p, |
INDI_PROPERTY_TYPE | type | ||
) |
void INDI::BaseDevice::registerProperty | ( | void * | p, |
INDI_PROPERTY_TYPE | type | ||
) |
int INDI::BaseDevice::removeProperty | ( | const char * | name, |
char * | errmsg | ||
) |
Remove a property.
name | name of property to be removed. Pass NULL to remove the whole device. |
errmsg | buffer to store error message. |
int INDI::BaseDevice::removeProperty | ( | const char * | name, |
char * | errmsg | ||
) |
Remove a property.
name | name of property to be removed. Pass NULL to remove the whole device. |
errmsg | buffer to store error message. |
|
protected |
Parse and store BLOB in the respective vector.
|
protected |
Parse and store BLOB in the respective vector.
void INDI::BaseDevice::setDeviceName | ( | const char * | dev | ) |
Set the device name.
dev | new device name |
void INDI::BaseDevice::setDeviceName | ( | const char * | dev | ) |
Set the device name.
dev | new device name |
|
inline |
Set the driver's mediator to receive notification of news devices and updated property values.
|
inline |
Set the driver's mediator to receive notification of news devices and updated property values.
|
protected |
handle SetXXX commands from client
|
protected |
handle SetXXX commands from client
|
friend |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |