Instrument Neutral Distributed Interface INDI  2.0.2
Public Member Functions | Protected Member Functions | Friends | List of all members
INDI::DefaultDevice Class Referenceabstract

Class to provide extended functionality for devices in addition to the functionality provided by INDI::BaseDevice. This class should only be subclassed by drivers directly as it is linked with main(). Virtual drivers cannot employ INDI::DefaultDevice. More...

#include <defaultdevice.h>

Inheritance diagram for INDI::DefaultDevice:
INDI::ParentDevice INDI::BaseDevice ALTO ArduinoST4 AstrometryDriver DeepSkyDadFP1 DeltaT Dome Excalibur FlipFlat GIOTTO GPUSB INDI::CCD INDI::Dome INDI::FilterWheel INDI::Focuser INDI::GPS INDI::Rotator INDI::SensorInterface INDI::Telescope INDI::Weather Imager JoyStick LPM LightPanelSimulator MyDCP4ESP PegasusFlatMaster PegasusPPB PegasusPPBA PegasusUCH PegasusUPB RainDetector SQM SQMSimulator STAR2000 ShelyakDriver SimpleDevice SimpleSkeleton SkySafari SnapCap USBDewpoint WandererCover WatchDog WeatherMeta myDewControllerPro

Public Member Functions

 DefaultDevice ()
 
virtual ~DefaultDevice () override=default
 
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver. More...
 
void addDebugControl ()
 Add Debug control to the driver. More...
 
void addSimulationControl ()
 Add Simulation control to the driver. More...
 
void addConfigurationControl ()
 Add Configuration control to the driver. More...
 
void addPollPeriodControl ()
 Add Polling period control to the driver. More...
 
void resetProperties ()
 Set all properties to IDLE state. More...
 
void defineNumber (INumberVectorProperty *nvp)
 Define number vector to client & register it. Alternatively, IDDefNumber can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (INumberVectorProperty *property)
 
void defineText (ITextVectorProperty *tvp)
 Define text vector to client & register it. Alternatively, IDDefText can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (ITextVectorProperty *property)
 
void defineSwitch (ISwitchVectorProperty *svp)
 Define switch vector to client & register it. Alternatively, IDDefswitch can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (ISwitchVectorProperty *property)
 
void defineLight (ILightVectorProperty *lvp)
 Define light vector to client & register it. Alternatively, IDDeflight can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (ILightVectorProperty *property)
 
void defineBLOB (IBLOBVectorProperty *bvp)
 Define BLOB vector to client & register it. Alternatively, IDDefBLOB can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineProperty (IBLOBVectorProperty *property)
 
void defineProperty (INDI::Property &property)
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. It will also be deleted from all clients. More...
 
bool deleteProperty (INDI::Property &property)
 deleteProperty Delete a property and unregister it. It will also be deleted from all clients. More...
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=nullptr)
 Set connection switch status in the client. More...
 
int SetTimer (uint32_t ms)
 Set a timer to call the function TimerHit after ms milliseconds. More...
 
void RemoveTimer (int id)
 Remove timer added with SetTimer. More...
 
virtual void TimerHit ()
 Callback function to be called once SetTimer duration elapses. More...
 
virtual const char * getDriverExec ()
 
virtual const char * getDriverName ()
 
void setVersion (uint16_t vMajor, uint16_t vMinor)
 Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor. More...
 
uint16_t getMajorVersion () const
 
uint16_t getMinorVersion () const
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. Usually, only a minimum set of properties are defined to the client in this function if the device is in disconnected state. Those properties should be enough to enable the client to establish a connection to the device. In addition to CONNECT/DISCONNECT, such properties may include port name, IP address, etc. You should check if the device is already connected, and if this is true, then you must define the remainder of the the properties to the client in this function. Otherwise, the remainder of the driver's properties are defined to the client in updateProperties() function which is called when a client connects/disconnects from a device. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 Process the client newBLOB command. More...
 
virtual bool ISSnoopDevice (XMLEle *root)
 Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver. More...
 
uint16_t getDriverInterface () const
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE. You may send an ORed list of DeviceInterface values. More...
 
void watchDevice (const char *deviceName, const std::function< void(INDI::BaseDevice)> &callback)
 Add a device to the watch list. More...
 
- Public Member Functions inherited from INDI::ParentDevice
 ParentDevice (Type type)
 
 ~ParentDevice ()
 
 ParentDevice (ParentDevice &&other)=default
 
ParentDeviceoperator= (ParentDevice &&other)=default
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
void registerProperty (const INDI::Property &property)
 Register the property to be able to observe and update. More...
 
void registerProperty (const INDI::Property &property, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void watchProperty (const char *name, const std::function< void(INDI::Property)> &callback, WATCH watch=WATCH_NEW)
 Call the callback function if property is available. More...
 
Property getProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name. More...
 
Properties getProperties ()
 Return a list of all properties in the device. More...
 
const Properties getProperties () const
 
INDI::PropertyNumber getNumber (const char *name) const
 
INDI::PropertyText getText (const char *name) const
 
INDI::PropertySwitch getSwitch (const char *name) const
 
INDI::PropertyLight getLight (const char *name) const
 
INDI::PropertyBlob getBLOB (const char *name) const
 
IPState getPropertyState (const char *name) const
 
IPerm getPropertyPermission (const char *name) const
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name. More...
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
const std::string & messageQueue (size_t index) const
 
const std::string & lastMessage () const
 
bool isValid () const
 
bool isConnected () const
 
void attach ()
 indicates that the device is ready More...
 
void detach ()
 indicates that the device is being removed More...
 
void setMediator (INDI::BaseMediator *mediator)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator () const
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName () const
 
bool isDeviceNameMatch (const char *otherName) const
 Check that the device name matches the argument. More...
 
bool isDeviceNameMatch (const std::string &otherName) const
 Check that the device name matches the argument. More...
 
const char * getDriverName () const
 
const char * getDriverExec () const
 
const char * getDriverVersion () const
 
uint16_t getDriverInterface () const
 getDriverInterface returns ORed values of DRIVER_INTERFACE. It presents the device classes supported by the driver. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
int buildProp (const INDI::LilXmlElement &root, char *errmsg, bool isDynamic=false)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (const INDI::LilXmlElement &root, char *errmsg)
 handle SetXXX commands from client More...
 
 operator BaseDevice * ()
 
BaseDeviceoperator-> ()
 
bool operator!= (std::nullptr_t) const
 
bool operator== (std::nullptr_t) const
 
 operator bool () const
 
 operator bool ()
 

Protected Member Functions

void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. Dyanmic properties are those generated from an external skeleton XML file. By default all properties, including dynamic properties, are defined to the client in ISGetProperties(). Furthermore, when űdeleteProperty(properyName) is called, the dynamic property is deleted by default, and can only be restored by calling buildSkeleton(filename) again. However, it is sometimes desirable to skip the definition of the dynamic properties on startup and delegate this task to the child class. To control this behavior, set enabled to false. More...
 
virtual bool loadConfig (bool silent=false, const char *property=nullptr)
 Load the last saved configuration file. More...
 
bool loadConfig (INDI::Property &property)
 Load property config from the configuration file. If the property configuration is successfully parsed, the corresponding ISNewXXX is called with the values parsed from the config file. More...
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file. More...
 
bool saveConfig (INDI::Property &property)
 Save a property in the configuration file. More...
 
virtual bool purgeConfig ()
 purgeConfig Remove config file from disk. More...
 
virtual bool saveConfigItems (FILE *fp)
 saveConfigItems Save specific properties in the provide config file handler. Child class usually override this function to save their own properties and the base class saveConfigItems(fp) must be explicitly called by each child class. The Default Device saveConfigItems(fp) only save Debug properties options in the config file. More...
 
virtual bool saveAllConfigItems (FILE *fp)
 saveAllConfigItems Save all the drivers' properties in the configuration file More...
 
virtual bool loadDefaultConfig ()
 Load the default configuration file. More...
 
void setDebug (bool enable)
 Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client. More...
 
void setSimulation (bool enable)
 Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client. More...
 
virtual void debugTriggered (bool enable)
 Inform driver that the debug option was triggered. This function is called after setDebug is triggered by the client. Reimplement this function if your driver needs to take specific action after debug is enabled/disabled. Otherwise, you can use isDebug() to check if simulation is enabled or disabled. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. This function is called after setSimulation is triggered by the client. Reimplement this function if your driver needs to take specific action after simulation is enabled/disabled. Otherwise, you can use isSimulation() to check if simulation is enabled or disabled. More...
 
bool isDebug () const
 
bool isSimulation () const
 
virtual bool initProperties ()
 Initilize properties initial state and value. The child class must implement this function. More...
 
virtual bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before. More...
 
virtual bool Connect ()
 Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interface (Serial or TCP) governed by connectionMode. If connection is successful, it proceed to call Handshake() function to ensure communication with device is successful. For other communication interface, override the method in the child class implementation. More...
 
virtual bool Disconnect ()
 Disconnect from device. More...
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. The connection type shall be defined to the client in ISGetProperties() More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
void setActiveConnection (Connection::Interface *existingConnection)
 setActiveConnection Switch the active connection to the passed connection plugin More...
 
void setDefaultPollingPeriod (uint32_t msec)
 setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver. More...
 
void setPollingPeriodRange (uint32_t minimum, uint32_t maximum)
 setPollingPeriodRange Set the range permitted by the polling range in milliseconds More...
 
uint32_t getPollingPeriod () const
 getPollingPeriod Return the polling period. More...
 
void setCurrentPollingPeriod (uint32_t msec)
 setCurrentPollingPeriod Change the current polling period to call TimerHit() function in the driver. More...
 
uint32_t getCurrentPollingPeriod () const
 getCurrentPollingPeriod Return the current polling period. More...
 
uint32_t & refCurrentPollingPeriod () __attribute__((deprecated))
 
uint32_t refCurrentPollingPeriod () const __attribute__((deprecated))
 
bool isConfigLoading () const
 isConfigLoading Check if driver configuration is currently in the process of getting loaded. More...
 
bool isInitializationComplete () const
 isInitializationComplete Check if driver initialization is complete. More...
 
void syncDriverInfo ()
 syncDriverInfo sends the current driver information to the client. More...
 
virtual const char * getDefaultName ()=0
 
 DefaultDevice (const std::shared_ptr< DefaultDevicePrivate > &dd)
 
- Protected Member Functions inherited from INDI::ParentDevice
 ParentDevice (const std::shared_ptr< ParentDevicePrivate > &dd)
 
- Protected Member Functions inherited from INDI::BaseDevice
 BaseDevice (BaseDevicePrivate &dd)
 
 BaseDevice (const std::shared_ptr< BaseDevicePrivate > &dd)
 

Friends

class Connection::Serial
 
class Connection::TCP
 
class FilterInterface
 
class FocuserInterface
 

Additional Inherited Members

- Public Types inherited from INDI::ParentDevice
enum  Type { Valid , Invalid }
 
- Public Types inherited from INDI::BaseDevice
enum  INDI_ERROR { INDI_DEVICE_NOT_FOUND = -1 , INDI_PROPERTY_INVALID = -2 , INDI_PROPERTY_DUPLICATED = -3 , INDI_DISPATCH_ERROR = -4 }
 
enum  { INDI_ENABLED , INDI_DISABLED }
 
enum  WATCH { WATCH_NEW = 0 , WATCH_UPDATE , WATCH_NEW_OR_UPDATE }
 
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) , CORRELATOR_INTERFACE = (1 << 14) ,
  AUX_INTERFACE = (1 << 15) , SENSOR_INTERFACE = SPECTROGRAPH_INTERFACE | DETECTOR_INTERFACE | CORRELATOR_INTERFACE
}
 The DRIVER_INTERFACE enum defines the class of devices the driver implements. A driver may implement one or more interfaces. More...
 
typedef INDI::Properties Properties
 
- Static Public Member Functions inherited from INDI::BaseDevice
static std::string getSharedFilePath (std::string fileName)
 
- Protected Attributes inherited from INDI::BaseDevice
std::shared_ptr< BaseDevicePrivated_ptr
 

Detailed Description

Class to provide extended functionality for devices in addition to the functionality provided by INDI::BaseDevice. This class should only be subclassed by drivers directly as it is linked with main(). Virtual drivers cannot employ INDI::DefaultDevice.

INDI::DefaultDevice provides capability to add Debug, Simulation, and Configuration controls. These controls (switches) are defined to the client. Configuration options permit saving and loading of AS-IS property values.

See also
Tutorial Four
Author
Jasem Mutlaq
Examples
dome.h, raindetector.h, simpledevice.h, and simpleskeleton.h.

Definition at line 118 of file defaultdevice.h.

Constructor & Destructor Documentation

◆ DefaultDevice() [1/2]

INDI::DefaultDevice::DefaultDevice ( )

Definition at line 178 of file defaultdevice.cpp.

◆ ~DefaultDevice()

virtual INDI::DefaultDevice::~DefaultDevice ( )
overridevirtualdefault

◆ DefaultDevice() [2/2]

INDI::DefaultDevice::DefaultDevice ( const std::shared_ptr< DefaultDevicePrivate > &  dd)
protected

Member Function Documentation

◆ addAuxControls()

void INDI::DefaultDevice::addAuxControls ( )

Add Debug, Simulation, and Configuration options to the driver.

Examples
simpleccd.cpp, and simpleskeleton.cpp.

Definition at line 601 of file defaultdevice.cpp.

◆ addConfigurationControl()

void INDI::DefaultDevice::addConfigurationControl ( )

Add Configuration control to the driver.

Definition at line 589 of file defaultdevice.cpp.

◆ addDebugControl()

void INDI::DefaultDevice::addDebugControl ( )

Add Debug control to the driver.

Examples
simplescope.cpp.

Definition at line 575 of file defaultdevice.cpp.

◆ addPollPeriodControl()

void INDI::DefaultDevice::addPollPeriodControl ( )

Add Polling period control to the driver.

Definition at line 595 of file defaultdevice.cpp.

◆ addSimulationControl()

void INDI::DefaultDevice::addSimulationControl ( )

Add Simulation control to the driver.

Definition at line 582 of file defaultdevice.cpp.

◆ Connect()

bool INDI::DefaultDevice::Connect ( )
protectedvirtual

Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interface (Serial or TCP) governed by connectionMode. If connection is successful, it proceed to call Handshake() function to ensure communication with device is successful. For other communication interface, override the method in the child class implementation.

Returns
True if connection is successful, false otherwise

Reimplemented in SimpleCCD, ScopeSim, SimpleDevice, SimpleSkeleton, RainDetector, Dome, SimpleReceiver, WeatherWatcher, WeatherSimulator, WeatherMeta, WeatherSafetyProxy, OpenWeatherMap, V4L2_Driver, ScopeSim, ScopeScript, SynscanLegacyDriver, LX200Pulsar2, LX200Gemini, LX200AstroPhysicsV2, LX200AstroPhysics, TitanTCS, RotatorSimulator, RadioSim, RTLSDR, SIEFS, PerfectStar, MoonLiteDRO, HitecAstroDCFocuser, FocusLynxF2, FocusLynxF1, FocusSim, FCUSB, ActiveFocuser, ManualFilter, RollOff, DomeSim, DomeScript, GuideSim, CCDSim, WatchDog, STAR2000, SQMSimulator, SkySafari, LightPanelSimulator, JoyStick, GPUSB, AstrometryDriver, Imager, WunderGround, FocusMaster, FilterSim, and GPSSimulator.

Definition at line 1120 of file defaultdevice.cpp.

◆ debugTriggered()

void INDI::DefaultDevice::debugTriggered ( bool  enable)
protectedvirtual

Inform driver that the debug option was triggered. This function is called after setDebug is triggered by the client. Reimplement this function if your driver needs to take specific action after debug is enabled/disabled. Otherwise, you can use isDebug() to check if simulation is enabled or disabled.

Parameters
enableIf true, the debug option is set to ON.

Reimplemented in LX200AstroPhysics, PMC8, LX200Telescope, LX200Basic, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200_TeenAstro, IOptronV3, IEQProLegacy, IEQPro, SteelDrive, FocusLynxBase, FocusLynxF2, FocusLynxF1, GPUSB, and QFW.

Definition at line 676 of file defaultdevice.cpp.

◆ defineBLOB()

void INDI::DefaultDevice::defineBLOB ( IBLOBVectorProperty bvp)

Define BLOB vector to client & register it. Alternatively, IDDefBLOB can be used but the property will not get registered and the driver will not be able to save configuration files.

Parameters
bvpThe BLOB vector property to be defined

Definition at line 1115 of file defaultdevice.cpp.

◆ defineLight()

void INDI::DefaultDevice::defineLight ( ILightVectorProperty lvp)

Define light vector to client & register it. Alternatively, IDDeflight can be used but the property will not get registered and the driver will not be able to save configuration files.

Parameters
lvpThe light vector property to be defined

Definition at line 1110 of file defaultdevice.cpp.

◆ defineNumber()

void INDI::DefaultDevice::defineNumber ( INumberVectorProperty nvp)

Define number vector to client & register it. Alternatively, IDDefNumber can be used but the property will not get registered and the driver will not be able to save configuration files.

Parameters
nvpThe number vector property to be defined

Definition at line 1095 of file defaultdevice.cpp.

◆ defineProperty() [1/6]

void INDI::DefaultDevice::defineProperty ( IBLOBVectorProperty property)

Definition at line 1083 of file defaultdevice.cpp.

◆ defineProperty() [2/6]

void INDI::DefaultDevice::defineProperty ( ILightVectorProperty property)

Definition at line 1077 of file defaultdevice.cpp.

◆ defineProperty() [3/6]

void INDI::DefaultDevice::defineProperty ( INDI::Property property)

Definition at line 1089 of file defaultdevice.cpp.

◆ defineProperty() [4/6]

void INDI::DefaultDevice::defineProperty ( INumberVectorProperty property)
Examples
dome.cpp.

Definition at line 1059 of file defaultdevice.cpp.

◆ defineProperty() [5/6]

void INDI::DefaultDevice::defineProperty ( ISwitchVectorProperty property)

Definition at line 1071 of file defaultdevice.cpp.

◆ defineProperty() [6/6]

void INDI::DefaultDevice::defineProperty ( ITextVectorProperty property)

Definition at line 1065 of file defaultdevice.cpp.

◆ defineSwitch()

void INDI::DefaultDevice::defineSwitch ( ISwitchVectorProperty svp)

Define switch vector to client & register it. Alternatively, IDDefswitch can be used but the property will not get registered and the driver will not be able to save configuration files.

Parameters
svpThe switch vector property to be defined

Definition at line 1105 of file defaultdevice.cpp.

◆ defineText()

void INDI::DefaultDevice::defineText ( ITextVectorProperty tvp)

Define text vector to client & register it. Alternatively, IDDefText can be used but the property will not get registered and the driver will not be able to save configuration files.

Parameters
tvpThe text vector property to be defined

Definition at line 1100 of file defaultdevice.cpp.

◆ deleteProperty() [1/2]

bool INDI::DefaultDevice::deleteProperty ( const char *  propertyName)
virtual

Delete a property and unregister it. It will also be deleted from all clients.

Parameters
propertyNamename of property to be deleted.
Examples
dome.cpp.

Definition at line 1027 of file defaultdevice.cpp.

◆ deleteProperty() [2/2]

bool INDI::DefaultDevice::deleteProperty ( INDI::Property property)

deleteProperty Delete a property and unregister it. It will also be deleted from all clients.

Parameters
propertyProperty to be deleted.
Returns
True if successful, false otherwise.
Note
This is a convience function that internally calls deleteProperty with the property name.

Definition at line 1022 of file defaultdevice.cpp.

◆ Disconnect()

bool INDI::DefaultDevice::Disconnect ( )
protectedvirtual

◆ getActiveConnection()

Connection::Interface * INDI::DefaultDevice::getActiveConnection ( )
protected
Returns
Return actively selected connection plugin

Definition at line 1307 of file defaultdevice.cpp.

◆ getCurrentPollingPeriod()

uint32_t INDI::DefaultDevice::getCurrentPollingPeriod ( ) const
protected

getCurrentPollingPeriod Return the current polling period.

Returns
Polling period in milliseconds.
Examples
simpleccd.cpp.

Definition at line 1201 of file defaultdevice.cpp.

◆ getDefaultName()

virtual const char* INDI::DefaultDevice::getDefaultName ( )
protectedpure virtual
Returns
Default name of the device.

Implemented in LX200SS2000PC, LX200_OpenAstroTech, Scope, SkywatcherAltAzSimple, LX200AstroPhysics, SimpleScope, SimpleCCD, ScopeSim, SimpleDevice, SimpleSkeleton, RainDetector, Dome, SimpleReceiver, WeatherWatcher, WeatherSimulator, WeatherMeta, WeatherSafetyProxy, Vantage, UranusMeteo, OpenWeatherMap, MBox, V4L2_Driver, TemmaMount, ScopeSim, ScopeScript, SynscanLegacyDriver, SynscanDriver, SkywatcherAPIMount, Rainbow, PMC8, Paramount, LX200ZEQ25, LX200Telescope, LX200Pulsar2, LX200GotoNova, LX200Gemini, LX200FS2, LX200Classic, LX200Basic, LX200Autostar, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200AM5, LX200_TeenAstro, LX200NYX101, LX200_OnStep, LX200_10MICRON, IOptronV3, ioptronHC8406, IEQProLegacy, IEQPro, DSC, TitanTCS, CelestronGPS, AstroTrac, ShelyakDriver, MountDriver, FocuserDriver, WandererRotatorLite, RotatorSimulator, Pyxis, PegasusFalcon, NightCrawler, nFrameRotator, Integra, Gemini, DeepSkyDadFR1, RadioSim, RTLSDR, USBFocusV3, TCFS, SteelDriveII, SteelDrive, SmartFocus, SIEFS, SestoSenso2, SestoSenso, RoboFocus, RBFOCUS, RainbowRSF, EFA, PerfectStar, PegasusScopsOAG, PegasusProdigyMF, PegasusFocusCube, OnFocus, NStep, NFocus, MyFocuserPro2, MoonLiteDRO, MoonLite, Microtouch, Lakeside, lacerta_mfoc_fmc, lacerta_mfoc, HitecAstroDCFocuser, FocusLynxBase, FocusLynxF2, FocusLynxF1, FocusSim, FCUSB, EsattoArco, Esatto, DMFC, DeepSkyDadAF3, DeepSkyDadAF2, DeepSkyDadAF1, CelestronSCT, ActiveFocuser, AAF2, XAGYLWheel, TruTech, QHYCFW3, QHYCFW2, QHYCFW1, PegasusINDIGO, ManualFilter, FilterIFW, ScopeDome, RollOff, RigelDome, Beaver, DomePro2, DomeSim, DomeScript, DDW, BaaderDome, GuideSim, CCDSim, WatchDog, WandererCover, USBDewpoint, STAR2000, SQMSimulator, SQM, SnapCap, SkySafari, DeltaT, PegasusUPB, PegasusUCH, PegasusPPBA, PegasusPPB, PegasusFlatMaster, myDewControllerPro, MyDCP4ESP, LPM, LightPanelSimulator, JoyStick, GPUSB, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, ArduinoST4, ALTO, Imager, WunderGround, FocusMaster, SkyCommander, LX200GPS, LX200_16, TeenAstroFocuser, QFW, FilterSim, and GPSSimulator.

◆ getDriverExec()

const char * INDI::DefaultDevice::getDriverExec ( )
virtual
Returns
driver executable filename

Definition at line 1271 of file defaultdevice.cpp.

◆ getDriverInterface()

uint16_t INDI::DefaultDevice::getDriverInterface ( ) const
Returns
getInterface Return the interface declared by the driver.

Definition at line 839 of file defaultdevice.cpp.

◆ getDriverName()

const char * INDI::DefaultDevice::getDriverName ( )
virtual
Returns
driver name

Reimplemented in LX200Telescope, and LX200_TeenAstro.

Definition at line 1276 of file defaultdevice.cpp.

◆ getMajorVersion()

uint16_t INDI::DefaultDevice::getMajorVersion ( ) const
Returns
Major driver version number.

Definition at line 1288 of file defaultdevice.cpp.

◆ getMinorVersion()

uint16_t INDI::DefaultDevice::getMinorVersion ( ) const
Returns
Minor driver version number.

Definition at line 1294 of file defaultdevice.cpp.

◆ getPollingPeriod()

uint32_t INDI::DefaultDevice::getPollingPeriod ( ) const
protected

getPollingPeriod Return the polling period.

Returns
Polling period in milliseconds.

Definition at line 1313 of file defaultdevice.cpp.

◆ initProperties()

bool INDI::DefaultDevice::initProperties ( )
protectedvirtual

Initilize properties initial state and value. The child class must implement this function.

Returns
True if initilization is successful, false otherwise.

Reimplemented in Scope, WunderGround, SkywatcherAltAzSimple, LX200AstroPhysics, FocusMaster, INDI::Weather, INDI::Telescope, INDI::Spectrograph, INDI::Rotator, INDI::Receiver, INDI::GPS, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::Detector, INDI::Correlator, INDI::CCD, SimpleScope, SimpleCCD, ScopeSim, SimpleSkeleton, RainDetector, Dome, SimpleReceiver, WeatherWatcher, WeatherSimulator, WeatherMeta, WeatherSafetyProxy, Vantage, UranusMeteo, OpenWeatherMap, MBox, V4L2_Driver, TemmaMount, ScopeSim, ScopeScript, SynscanLegacyDriver, SynscanDriver, SkywatcherAPIMount, Rainbow, PMC8, Paramount, LX200ZEQ25, LX200Telescope, LX200SS2000PC, LX200Pulsar2, LX200GotoNova, LX200Gemini, LX200FS2, LX200Classic, LX200Basic, LX200Autostar, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200AM5, LX200_TeenAstro, LX200NYX101, LX200_OpenAstroTech, LX200_OnStep, LX200_10MICRON, IOptronV3, ioptronHC8406, IEQProLegacy, IEQPro, EQ500X, DSC, TitanTCS, CelestronGPS, AstroTrac, MountDriver, FocuserDriver, WandererRotatorLite, Pyxis, PegasusFalcon, NightCrawler, nFrameRotator, Integra, Gemini, DeepSkyDadFR1, RadioSim, RTLSDR, USBFocusV3, TCFS, SteelDriveII, SteelDrive, SmartFocus, SIEFS, SestoSenso2, SestoSenso, RoboFocus, RBFOCUS, RainbowRSF, EFA, PerfectStar, PegasusScopsOAG, PegasusProdigyMF, PegasusFocusCube, OnFocus, NStep, NFocus, MyFocuserPro2, MoonLiteDRO, MoonLite, Microtouch, Lakeside, lacerta_mfoc_fmc, lacerta_mfoc, HitecAstroDCFocuser, FocusLynxBase, FocusLynxF2, FocusLynxF1, FocusSim, FCUSB, EsattoArco, Esatto, DMFC, DeepSkyDadAF3, DeepSkyDadAF2, DeepSkyDadAF1, CelestronSCT, ActiveFocuser, AAF2, XAGYLWheel, TruTech, QHYCFW3, QHYCFW2, QHYCFW1, PegasusINDIGO, ManualFilter, FilterIFW, ScopeDome, RollOff, RigelDome, Beaver, DomePro2, DomeSim, DomeScript, DDW, BaaderDome, GuideSim, CCDSim, WatchDog, WandererCover, USBDewpoint, STAR2000, SQMSimulator, SQM, SnapCap, SkySafari, DeltaT, PegasusUPB, PegasusUCH, PegasusPPBA, PegasusPPB, PegasusFlatMaster, myDewControllerPro, MyDCP4ESP, LPM, LightPanelSimulator, JoyStick, GPUSB, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, ArduinoST4, ALTO, Imager, INDI::SensorInterface, LX200GPS, LX200_16, TeenAstroFocuser, and QFW.

Examples
dome.cpp.

Definition at line 857 of file defaultdevice.cpp.

◆ isConfigLoading()

bool INDI::DefaultDevice::isConfigLoading ( ) const
protected

isConfigLoading Check if driver configuration is currently in the process of getting loaded.

Returns
True if property loading in progress, false otherwise.

Definition at line 1319 of file defaultdevice.cpp.

◆ isDebug()

bool INDI::DefaultDevice::isDebug ( ) const
protected
Returns
True if Debug is on, False otherwise.

Definition at line 664 of file defaultdevice.cpp.

◆ ISGetProperties()

void INDI::DefaultDevice::ISGetProperties ( const char *  dev)
virtual

define the driver's properties to the client. Usually, only a minimum set of properties are defined to the client in this function if the device is in disconnected state. Those properties should be enough to enable the client to establish a connection to the device. In addition to CONNECT/DISCONNECT, such properties may include port name, IP address, etc. You should check if the device is already connected, and if this is true, then you must define the remainder of the the properties to the client in this function. Otherwise, the remainder of the driver's properties are defined to the client in updateProperties() function which is called when a client connects/disconnects from a device.

Parameters
devname of the device
Note
This function is called by the INDI framework, do not call it directly. See LX200 Generic driver for an example implementation

Reimplemented in Scope, WunderGround, SkywatcherAltAzSimple, LX200AstroPhysics, INDI::Telescope, INDI::Spectrograph, INDI::Rotator, INDI::Receiver, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::Detector, INDI::Correlator, INDI::CCD, SimpleSkeleton, WeatherWatcher, WeatherMeta, WeatherSafetyProxy, OpenWeatherMap, V4L2_Driver, ScopeSim, ScopeScript, SkywatcherAPIMount, PMC8, LX200Telescope, LX200Pulsar2, LX200Gemini, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200_TeenAstro, LX200_OnStep, CelestronGPS, AstroTrac, nFrameRotator, lacerta_mfoc_fmc, lacerta_mfoc, FocusLynxBase, FocusSim, DMFC, ActiveFocuser, QHYCFW2, QHYCFW1, ManualFilter, DomeScript, GuideSim, CCDSim, WatchDog, WandererCover, STAR2000, SnapCap, SkySafari, PegasusFlatMaster, LightPanelSimulator, JoyStick, GIOTTO, FlipFlat, DeepSkyDadFP1, AstrometryDriver, Imager, LX200GPS, LX200_16, and QFW.

Examples
simpleskeleton.cpp.

Definition at line 686 of file defaultdevice.cpp.

◆ isInitializationComplete()

bool INDI::DefaultDevice::isInitializationComplete ( ) const
protected

isInitializationComplete Check if driver initialization is complete.

Returns
True if driver is initialized. It is initialized after initProperties() is completed and after the first ISGetProperties() is executed.

Definition at line 1325 of file defaultdevice.cpp.

◆ ISNewBLOB()

bool INDI::DefaultDevice::ISNewBLOB ( const char *  dev,
const char *  name,
int  sizes[],
int  blobsizes[],
char *  blobs[],
char *  formats[],
char *  names[],
int  n 
)
virtual

Process the client newBLOB command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented in Scope, SkywatcherAltAzSimple, INDI::Spectrograph, INDI::Receiver, INDI::Detector, INDI::Correlator, INDI::CCD, ScopeSim, TemmaMount, SynscanLegacyDriver, SkywatcherAPIMount, AstroTrac, AstrometryDriver, and Imager.

Definition at line 541 of file defaultdevice.cpp.

◆ ISNewNumber()

bool INDI::DefaultDevice::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
virtual

Process the client newNumber command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented in Scope, SkywatcherAltAzSimple, LX200AstroPhysics, FocusMaster, INDI::Weather, INDI::Telescope, INDI::Spectrograph, INDI::Rotator, INDI::Receiver, INDI::GPS, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::Detector, INDI::Correlator, INDI::CCD, ScopeSim, WeatherSimulator, WeatherSafetyProxy, UranusMeteo, MBox, V4L2_Driver, TemmaMount, ScopeSim, SynscanLegacyDriver, SynscanDriver, SkywatcherAPIMount, Rainbow, PMC8, Paramount, LX200ZEQ25, LX200Telescope, LX200SS2000PC, LX200Pulsar2, LX200Gemini, LX200FS2, LX200Classic, LX200Basic, LX200AstroPhysicsV2, LX200AstroPhysics, LX200AM5, LX200_TeenAstro, LX200NYX101, LX200_OpenAstroTech, LX200_OnStep, LX200_10MICRON, IOptronV3, IEQProLegacy, IEQPro, DSC, TitanTCS, CelestronGPS, AstroTrac, ShelyakDriver, MountDriver, Pyxis, PegasusFalcon, NightCrawler, nFrameRotator, Integra, Gemini, RadioSim, RTLSDR, USBFocusV3, TCFS, SteelDriveII, SteelDrive, SmartFocus, SestoSenso2, RoboFocus, EFA, PerfectStar, PegasusProdigyMF, PegasusFocusCube, OnFocus, NStep, NFocus, MyFocuserPro2, MoonLiteDRO, MoonLite, Microtouch, Lakeside, lacerta_mfoc_fmc, lacerta_mfoc, HitecAstroDCFocuser, FocusLynxBase, FocusSim, EsattoArco, DMFC, DeepSkyDadAF3, DeepSkyDadAF2, DeepSkyDadAF1, ActiveFocuser, XAGYLWheel, QHYCFW2, QHYCFW1, ManualFilter, ScopeDome, RigelDome, Beaver, DomePro2, GuideSim, CCDSim, WatchDog, WandererCover, USBDewpoint, STAR2000, SQMSimulator, SQM, SnapCap, DeltaT, PegasusUPB, PegasusPPBA, PegasusPPB, PegasusFlatMaster, myDewControllerPro, MyDCP4ESP, LightPanelSimulator, JoyStick, GPUSB, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, ArduinoST4, ALTO, Imager, LX200_16, and TeenAstroFocuser.

Definition at line 503 of file defaultdevice.cpp.

◆ ISNewSwitch()

bool INDI::DefaultDevice::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented in Scope, SkywatcherAltAzSimple, LX200AstroPhysics, FocusMaster, INDI::Weather, INDI::Telescope, INDI::Spectrograph, INDI::Rotator, INDI::Receiver, INDI::GPS, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::Detector, INDI::Correlator, INDI::CCD, ScopeSim, WeatherSafetyProxy, UranusMeteo, MBox, V4L2_Driver, TemmaMount, ScopeSim, SynscanLegacyDriver, SynscanDriver, SkywatcherAPIMount, Rainbow, PMC8, Paramount, LX200ZEQ25, LX200Telescope, LX200Pulsar2, LX200GotoNova, LX200Gemini, LX200FS2, LX200Classic, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200AM5, LX200_TeenAstro, LX200NYX101, LX200_OpenAstroTech, LX200_OnStep, LX200_10MICRON, IOptronV3, ioptronHC8406, IEQProLegacy, IEQPro, DSC, TitanTCS, CelestronGPS, AstroTrac, ShelyakDriver, FocuserDriver, WandererRotatorLite, Pyxis, PegasusFalcon, NightCrawler, nFrameRotator, Integra, Gemini, DeepSkyDadFR1, USBFocusV3, TCFS, SteelDriveII, SteelDrive, SestoSenso2, SestoSenso, RoboFocus, RBFOCUS, RainbowRSF, EFA, PegasusScopsOAG, PegasusProdigyMF, PegasusFocusCube, OnFocus, NStep, MyFocuserPro2, MoonLiteDRO, MoonLite, Microtouch, Lakeside, lacerta_mfoc_fmc, lacerta_mfoc, FocusLynxBase, FocusSim, FCUSB, EsattoArco, Esatto, DMFC, DeepSkyDadAF3, DeepSkyDadAF2, DeepSkyDadAF1, CelestronSCT, ActiveFocuser, XAGYLWheel, TruTech, ManualFilter, FilterIFW, ScopeDome, RollOff, RigelDome, Beaver, DomePro2, BaaderDome, GuideSim, CCDSim, WatchDog, WandererCover, USBDewpoint, STAR2000, SnapCap, SkySafari, DeltaT, PegasusUPB, PegasusUCH, PegasusPPBA, PegasusPPB, PegasusFlatMaster, myDewControllerPro, MyDCP4ESP, LPM, LightPanelSimulator, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, ALTO, Imager, LX200GPS, LX200_16, and TeenAstroFocuser.

Definition at line 459 of file defaultdevice.cpp.

◆ ISNewText()

bool INDI::DefaultDevice::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
virtual

◆ isSimulation()

bool INDI::DefaultDevice::isSimulation ( ) const
protected
Returns
True if Simulation is on, False otherwise.

Definition at line 670 of file defaultdevice.cpp.

◆ ISSnoopDevice()

bool INDI::DefaultDevice::ISSnoopDevice ( XMLEle root)
virtual

Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented in Scope, INDI::Weather, INDI::Telescope, INDI::Spectrograph, INDI::Receiver, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::Detector, INDI::Correlator, INDI::CCD, WeatherMeta, RollOff, GuideSim, CCDSim, WatchDog, WandererCover, STAR2000, SnapCap, PegasusFlatMaster, JoyStick, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, and Imager.

Definition at line 561 of file defaultdevice.cpp.

◆ loadConfig() [1/2]

bool INDI::DefaultDevice::loadConfig ( bool  silent = false,
const char *  property = nullptr 
)
protectedvirtual

Load the last saved configuration file.

Parameters
silentif true, don't report any error or notification messages.
propertyName of property to load configuration for. If nullptr, all properties in the configuration file are loaded which is the default behavior.
Returns
True if successful, false otherwise.

Reimplemented in FilterIFW, and FocusLynxBase.

Examples
simpleskeleton.cpp.

Definition at line 192 of file defaultdevice.cpp.

◆ loadConfig() [2/2]

bool INDI::DefaultDevice::loadConfig ( INDI::Property property)
protected

Load property config from the configuration file. If the property configuration is successfully parsed, the corresponding ISNewXXX is called with the values parsed from the config file.

Parameters
propertyProperty to load configuration for.
Returns
True if successful, false otherwise.
Note
This is a convenience function that calls loadConfig(true, property->getName())

Definition at line 187 of file defaultdevice.cpp.

◆ loadDefaultConfig()

bool INDI::DefaultDevice::loadDefaultConfig ( )
protectedvirtual

Load the default configuration file.

Returns
True if successful, false otherwise.

Definition at line 436 of file defaultdevice.cpp.

◆ purgeConfig()

bool INDI::DefaultDevice::purgeConfig ( )
protectedvirtual

purgeConfig Remove config file from disk.

Returns
True if successful, false otherwise.

Definition at line 253 of file defaultdevice.cpp.

◆ refCurrentPollingPeriod() [1/2]

uint32_t & INDI::DefaultDevice::refCurrentPollingPeriod ( )
protected

Definition at line 1207 of file defaultdevice.cpp.

◆ refCurrentPollingPeriod() [2/2]

uint32_t INDI::DefaultDevice::refCurrentPollingPeriod ( ) const
protected

Definition at line 1213 of file defaultdevice.cpp.

◆ registerConnection()

void INDI::DefaultDevice::registerConnection ( Connection::Interface newConnection)
protected

registerConnection Add new connection plugin to the existing connection pool. The connection type shall be defined to the client in ISGetProperties()

Parameters
newConnectionPointer to new connection plugin

Definition at line 1169 of file defaultdevice.cpp.

◆ RemoveTimer()

void INDI::DefaultDevice::RemoveTimer ( int  id)

Remove timer added with SetTimer.

Parameters
idID of the timer as returned from SetTimer

Definition at line 810 of file defaultdevice.cpp.

◆ resetProperties()

void INDI::DefaultDevice::resetProperties ( )

Set all properties to IDLE state.

Definition at line 774 of file defaultdevice.cpp.

◆ saveAllConfigItems()

bool INDI::DefaultDevice::saveAllConfigItems ( FILE *  fp)
protectedvirtual

saveAllConfigItems Save all the drivers' properties in the configuration file

Parameters
fppointer to config file handler
Returns
True if successful, false otherwise.

Definition at line 234 of file defaultdevice.cpp.

◆ saveConfig() [1/2]

bool INDI::DefaultDevice::saveConfig ( bool  silent = false,
const char *  property = nullptr 
)
protectedvirtual

Save the current properties in a configuration file.

Parameters
silentif true, don't report any error or notification messages.
propertyName of specific property to save while leaving all others properties in the file as is.
Returns
True if successful, false otherwise.

Definition at line 271 of file defaultdevice.cpp.

◆ saveConfig() [2/2]

bool INDI::DefaultDevice::saveConfig ( INDI::Property property)
protected

Save a property in the configuration file.

Parameters
propertyProperty to save in configuration file.
Returns
True if successful, false otherwise.
Note
This is a convenience function that calls saveConfig(true, property->getName())

Definition at line 266 of file defaultdevice.cpp.

◆ saveConfigItems()

bool INDI::DefaultDevice::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems Save specific properties in the provide config file handler. Child class usually override this function to save their own properties and the base class saveConfigItems(fp) must be explicitly called by each child class. The Default Device saveConfigItems(fp) only save Debug properties options in the config file.

Parameters
fpPointer to config file handler
Returns
True if successful, false otherwise.

Reimplemented in SkywatcherAltAzSimple, LX200AstroPhysics, INDI::Weather, INDI::Telescope, INDI::Rotator, INDI::GPS, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::CCD, WeatherWatcher, WeatherSimulator, WeatherMeta, WeatherSafetyProxy, UranusMeteo, OpenWeatherMap, V4L2_Driver, ScopeSim, ScopeScript, SkywatcherAPIMount, PMC8, LX200Telescope, LX200SS2000PC, LX200GotoNova, LX200Gemini, LX200FS2, LX200Classic, LX200Basic, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200_TeenAstro, LX200_OnStep, LX200_10MICRON, IOptronV3, ioptronHC8406, IEQProLegacy, IEQPro, DSC, CelestronGPS, AstroTrac, FocuserDriver, PegasusFalcon, NightCrawler, nFrameRotator, Integra, Gemini, TCFS, SteelDriveII, SteelDrive, SmartFocus, SestoSenso2, RoboFocus, EFA, PegasusScopsOAG, PegasusProdigyMF, PegasusFocusCube, NStep, NFocus, MyFocuserPro2, MoonLiteDRO, MoonLite, lacerta_mfoc_fmc, lacerta_mfoc, HitecAstroDCFocuser, FocusLynxBase, FocusSim, FCUSB, EsattoArco, DMFC, DeepSkyDadAF3, DeepSkyDadAF2, DeepSkyDadAF1, XAGYLWheel, QHYCFW2, QHYCFW1, ManualFilter, FilterIFW, ScopeDome, RollOff, Beaver, DomePro2, DomeScript, DDW, BaaderDome, GuideSim, CCDSim, WatchDog, WandererCover, STAR2000, SnapCap, SkySafari, DeltaT, PegasusUPB, PegasusUCH, PegasusPPBA, PegasusPPB, PegasusFlatMaster, JoyStick, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, ALTO, WunderGround, INDI::SensorInterface, and TeenAstroFocuser.

Definition at line 220 of file defaultdevice.cpp.

◆ setActiveConnection()

void INDI::DefaultDevice::setActiveConnection ( Connection::Interface existingConnection)
protected

setActiveConnection Switch the active connection to the passed connection plugin

Parameters
existingConnectionpointer to an existing connection to be made active.

Definition at line 1234 of file defaultdevice.cpp.

◆ setConnected()

void INDI::DefaultDevice::setConnected ( bool  status,
IPState  state = IPS_OK,
const char *  msg = nullptr 
)
virtual

Set connection switch status in the client.

Parameters
statusTrue to toggle CONNECT on, false to toggle DISCONNECT on.
stateState of CONNECTION properti, by default IPS_OK.
msgA message to be sent along with connect/disconnect command, by default nullptr.

Definition at line 783 of file defaultdevice.cpp.

◆ setCurrentPollingPeriod()

void INDI::DefaultDevice::setCurrentPollingPeriod ( uint32_t  msec)
protected

setCurrentPollingPeriod Change the current polling period to call TimerHit() function in the driver.

Parameters
msecperiod in milliseconds
Note
default period is 1000ms

Definition at line 1195 of file defaultdevice.cpp.

◆ setDebug()

void INDI::DefaultDevice::setDebug ( bool  enable)
protected

Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client.

Parameters
enableIf true, the Debug option is set to ON.

Definition at line 609 of file defaultdevice.cpp.

◆ setDefaultPollingPeriod()

void INDI::DefaultDevice::setDefaultPollingPeriod ( uint32_t  msec)
protected

setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver.

Parameters
msecperiod in milliseconds
Note
default period is 1000ms
Examples
simpleccd.cpp.

Definition at line 1219 of file defaultdevice.cpp.

◆ setDriverInterface()

void INDI::DefaultDevice::setDriverInterface ( uint16_t  value)

setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE. You may send an ORed list of DeviceInterface values.

Parameters
valueORed list of DeviceInterface values.
Warning
This only updates the internal driver interface property and does not send it to the client. To synchronize the client, use syncDriverInfo funciton.

Definition at line 845 of file defaultdevice.cpp.

◆ setDynamicPropertiesBehavior()

void INDI::DefaultDevice::setDynamicPropertiesBehavior ( bool  defineEnabled,
bool  deleteEnabled 
)
protected

setDynamicPropertiesBehavior controls handling of dynamic properties. Dyanmic properties are those generated from an external skeleton XML file. By default all properties, including dynamic properties, are defined to the client in ISGetProperties(). Furthermore, when űdeleteProperty(properyName) is called, the dynamic property is deleted by default, and can only be restored by calling buildSkeleton(filename) again. However, it is sometimes desirable to skip the definition of the dynamic properties on startup and delegate this task to the child class. To control this behavior, set enabled to false.

Parameters
defineEnabledTrue to define all dynamic properties in INDI::DefaultDevice own ISGetProperties() on startup. False to skip defining dynamic properties.
deleteEnabledTrue to delete dynamic properties from memory in deleteProperty(name). False to keep dynamic property in the properties list, but delete it from the client.
Note
This function has no effect on regular properties initialized directly by the driver.

Definition at line 1300 of file defaultdevice.cpp.

◆ setPollingPeriodRange()

void INDI::DefaultDevice::setPollingPeriodRange ( uint32_t  minimum,
uint32_t  maximum 
)
protected

setPollingPeriodRange Set the range permitted by the polling range in milliseconds

Parameters
minimumMinimum duration in ms.
maximumMaximum duration in ms.

Definition at line 1226 of file defaultdevice.cpp.

◆ setSimulation()

void INDI::DefaultDevice::setSimulation ( bool  enable)
protected

Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client.

Parameters
enableIf true, the Simulation option is set to ON.
Examples
simplescope.cpp.

Definition at line 639 of file defaultdevice.cpp.

◆ SetTimer()

int INDI::DefaultDevice::SetTimer ( uint32_t  ms)

Set a timer to call the function TimerHit after ms milliseconds.

Parameters
mstimer duration in milliseconds.
Returns
id of the timer to be used with RemoveTimer
Examples
simpleccd.cpp.

Definition at line 801 of file defaultdevice.cpp.

◆ setVersion()

void INDI::DefaultDevice::setVersion ( uint16_t  vMajor,
uint16_t  vMinor 
)

Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.

Parameters
vMajormajor revision number
vMinorminor revision number

Definition at line 1281 of file defaultdevice.cpp.

◆ simulationTriggered()

void INDI::DefaultDevice::simulationTriggered ( bool  enable)
protectedvirtual

Inform driver that the simulation option was triggered. This function is called after setSimulation is triggered by the client. Reimplement this function if your driver needs to take specific action after simulation is enabled/disabled. Otherwise, you can use isSimulation() to check if simulation is enabled or disabled.

Parameters
enableIf true, the simulation option is set to ON.

Reimplemented in PMC8, IOptronV3, IEQProLegacy, IEQPro, DSC, CelestronGPS, AstroTrac, FocusLynxF1, FilterIFW, and QFW.

Definition at line 681 of file defaultdevice.cpp.

◆ syncDriverInfo()

void INDI::DefaultDevice::syncDriverInfo ( )
protected

syncDriverInfo sends the current driver information to the client.

Definition at line 851 of file defaultdevice.cpp.

◆ TimerHit()

void INDI::DefaultDevice::TimerHit ( )
virtual

◆ unRegisterConnection()

bool INDI::DefaultDevice::unRegisterConnection ( Connection::Interface existingConnection)
protected

unRegisterConnection Remove connection from existing pool

Parameters
existingConnectionpointer to connection interface
Returns
True if connection is removed, false otherwise.

Definition at line 1175 of file defaultdevice.cpp.

◆ updateProperties()

bool INDI::DefaultDevice::updateProperties ( )
protectedvirtual

updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before.

Returns
True if update is successful, false otherwise.

Reimplemented in SkywatcherAltAzSimple, LX200AstroPhysics, FocusMaster, INDI::Weather, INDI::Telescope, INDI::Spectrograph, INDI::Rotator, INDI::Receiver, INDI::GPS, INDI::Focuser, INDI::FilterWheel, INDI::Dome, INDI::Detector, INDI::Correlator, INDI::CCD, SimpleCCD, RainDetector, Dome, SimpleReceiver, WeatherSimulator, WeatherMeta, WeatherSafetyProxy, UranusMeteo, MBox, V4L2_Driver, TemmaMount, ScopeSim, SynscanLegacyDriver, SynscanDriver, SkywatcherAPIMount, Rainbow, PMC8, Paramount, LX200ZEQ25, LX200Telescope, LX200SS2000PC, LX200Pulsar2, LX200GotoNova, LX200Gemini, LX200FS2, LX200Classic, LX200Basic, LX200Autostar, LX200AstroPhysicsV2, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, LX200AM5, LX200_TeenAstro, LX200NYX101, LX200_OpenAstroTech, LX200_OnStep, LX200_10MICRON, IOptronV3, ioptronHC8406, IEQProLegacy, IEQPro, DSC, TitanTCS, CelestronGPS, AstroTrac, MountDriver, FocuserDriver, WandererRotatorLite, Pyxis, PegasusFalcon, NightCrawler, nFrameRotator, Integra, Gemini, DeepSkyDadFR1, RadioSim, RTLSDR, USBFocusV3, TCFS, SteelDriveII, SteelDrive, SmartFocus, SestoSenso2, SestoSenso, RoboFocus, RBFOCUS, RainbowRSF, EFA, PerfectStar, PegasusScopsOAG, PegasusProdigyMF, PegasusFocusCube, OnFocus, NStep, NFocus, MyFocuserPro2, MoonLiteDRO, MoonLite, Microtouch, Lakeside, lacerta_mfoc_fmc, lacerta_mfoc, HitecAstroDCFocuser, FocusLynxBase, FocusLynxF1, FocusSim, FCUSB, EsattoArco, Esatto, DMFC, DeepSkyDadAF3, DeepSkyDadAF2, DeepSkyDadAF1, CelestronSCT, ActiveFocuser, AAF2, XAGYLWheel, TruTech, PegasusINDIGO, ManualFilter, FilterIFW, ScopeDome, RollOff, RigelDome, Beaver, DomePro2, DomeSim, DomeScript, DDW, BaaderDome, GuideSim, CCDSim, WandererCover, USBDewpoint, STAR2000, SQMSimulator, SQM, SnapCap, DeltaT, PegasusUPB, PegasusUCH, PegasusPPBA, PegasusPPB, PegasusFlatMaster, myDewControllerPro, MyDCP4ESP, LPM, LightPanelSimulator, JoyStick, GPUSB, GIOTTO, FlipFlat, Excalibur, DeepSkyDadFP1, AstrometryDriver, ArduinoST4, ALTO, Imager, INDI::SensorInterface, LX200GPS, LX200_16, and TeenAstroFocuser.

Examples
dome.cpp.

Definition at line 826 of file defaultdevice.cpp.

◆ watchDevice()

void INDI::DefaultDevice::watchDevice ( const char *  deviceName,
const std::function< void(INDI::BaseDevice)> &  callback 
)

Add a device to the watch list.

A driver may select to receive notifications of a specific other device.

Examples
dome.cpp.

Definition at line 568 of file defaultdevice.cpp.

Friends And Related Function Documentation

◆ Connection::Serial

friend class Connection::Serial
friend

Definition at line 568 of file defaultdevice.h.

◆ Connection::TCP

friend class Connection::TCP
friend

Definition at line 569 of file defaultdevice.h.

◆ FilterInterface

friend class FilterInterface
friend

Definition at line 570 of file defaultdevice.h.

◆ FocuserInterface

friend class FocuserInterface
friend

Definition at line 571 of file defaultdevice.h.


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