Instrument Neutral Distributed Interface INDI 2.2.5
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 AvalonUPAS CelestronDewPower CheapoDC DeepSkyDadFP DeltaT Dome DragonLIGHT DustCoverSimulator Excalibur FlipFlat GIOTTO GPUSB GeminiFlatpanel GeminiPBH INDI::CCD INDI::Dome INDI::FilterWheel INDI::Focuser INDI::GPS INDI::IMU INDI::Rotator INDI::SensorInterface INDI::Telescope INDI::Weather INDIAlpacaServer IPX800 IPX800 Imager IndiAstroLink4mini2 IndiAstrolink4 JoyStick LPM LightPanelSimulator MLAstroRPA MyDCP4ESP OAPA PACSimulator PegasusFlatMaster PegasusFlatMasterNeo PegasusFlatMasterWifi PegasusPPB PegasusPPBA PegasusSPB PegasusUCH PegasusUPB PegasusUPB3 RainDetector SQM SQMSimulator STAR2000 SVBONYPowerBox SafetyMonitor ShelyakDriver SimpleDevice SimpleSkeleton SimulatorIO SkySafari SnapCap SpectraCyber StarTechHub TerransPowerBoxGoV2 TerransPowerBoxProV2 UPS USBDewpoint WakeOnLAN WandererBoxPlusV3 WandererBoxProV3 WandererCover WandererCoverV4EC WandererCoverV4ProEC WandererDewTerminator WandererETA WandererEclipse WatchDog WaveshareRelay WeatherMeta myDewControllerPro

Public Member Functions

 DefaultDevice ()
 
virtual ~DefaultDevice () override=default
 
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver.
 
void addDebugControl ()
 Add Debug control to the driver.
 
void addSimulationControl ()
 Add Simulation control to the driver.
 
void addConfigurationControl ()
 Add Configuration control to the driver.
 
void addPollPeriodControl ()
 Add Polling period control to the driver.
 
void addNicknameControl ()
 Add Nickname text property to the driver.
 
void resetProperties ()
 Set all properties to IDLE state.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
bool deleteProperty (INDI::Property &property)
 deleteProperty Delete a property and unregister it. It will also be deleted from all clients.
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=nullptr)
 Set connection switch status in the client.
 
int SetTimer (uint32_t ms)
 Set a timer to call the function TimerHit after ms milliseconds.
 
void RemoveTimer (int id)
 Remove timer added with SetTimer.
 
virtual void TimerHit ()
 Callback function to be called once SetTimer duration elapses.
 
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.
 
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.
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command.
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command.
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command.
 
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.
 
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.
 
bool ISNewProperty (INDI::Property &property, const std::string &elementName, const std::any &value)
 Generic convenience function to update a property element as if by client request, simulating an ISNew... call.
 
template<typename PropertyType , typename ValueType >
bool updateProperty (PropertyType &property, ValueType *values, char *names[], int n, std::function< bool()> updater, bool saveConfig=false)
 Generic helper function to update an INDI property based on an external operation.
 
uint32_t getDriverInterface () const
 
void setDriverInterface (uint32_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.
 
void watchDevice (const char *deviceName, const std::function< void(INDI::BaseDevice)> &callback)
 Add a device to the watch list.
 
- Public Member Functions inherited from INDI::ParentDevice
 ParentDevice (Type type)
 
 ~ParentDevice ()
 
 ParentDevice (ParentDevice &&other)=default
 
ParentDevice & operator= (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.
 
void registerProperty (const INDI::Property &property, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property.
 
void watchProperty (const char *name, const std::function< void(INDI::Property)> &callback, WATCH watch=WATCH_NEW)
 Call the callback function if property is available.
 
Property getProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN) const
 Return a property and its type given its name.
 
Properties getProperties ()
 Return a list of all properties in the device.
 
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.
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue.
 
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 isSameDevice (const BaseDevice &other) const
 
bool isConnected () const
 
void attach ()
 indicates that the device is ready
 
void detach ()
 indicates that the device is being removed
 
void setMediator (INDI::BaseMediator *mediator)
 Set the driver's mediator to receive notification of news devices and updated property values.
 
INDI::BaseMediator * getMediator () const
 
void setDeviceName (const char *dev)
 Set the device name.
 
const char * getDeviceName () const
 
bool isDeviceNameMatch (const char *otherName) const
 Check that the device name matches the argument.
 
bool isDeviceNameMatch (const std::string &otherName) const
 Check that the device name matches the argument.
 
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.
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file.
 
int buildProp (const INDI::LilXmlElement &root, char *errmsg, bool isDynamic=false)
 Build a property given the supplied XML element (defXXX)
 
int setValue (const INDI::LilXmlElement &root, char *errmsg)
 handle SetXXX commands from client
 
 operator BaseDevice * ()
 
BaseDevice * operator-> ()
 
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. Dynamic 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.
 
virtual bool loadConfig (bool silent=false, const char *property=nullptr)
 Load the last saved configuration file.
 
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.
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file.
 
bool saveConfig (INDI::Property &property)
 Save a property in the configuration file.
 
virtual bool purgeConfig ()
 purgeConfig Remove config file from disk.
 
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.
 
virtual bool saveAllConfigItems (FILE *fp)
 saveAllConfigItems Save all the drivers' properties in the configuration file
 
virtual bool loadDefaultConfig ()
 Load the default configuration file.
 
void setDebug (bool enable)
 Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client.
 
void setSimulation (bool enable)
 Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client.
 
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.
 
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.
 
bool isDebug () const
 
bool isSimulation () const
 
virtual bool initProperties ()
 Initialize properties initial state and value. The child class must implement this function.
 
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.
 
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.
 
virtual bool Disconnect ()
 Disconnect from device.
 
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()
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool
 
Connection::Interface * getActiveConnection ()
 
void setActiveConnection (Connection::Interface *existingConnection)
 setActiveConnection Switch the active connection to the passed connection plugin
 
void setDefaultPollingPeriod (uint32_t msec)
 setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver.
 
void setPollingPeriodRange (uint32_t minimum, uint32_t maximum)
 setPollingPeriodRange Set the range permitted by the polling range in milliseconds
 
uint32_t getPollingPeriod () const
 getPollingPeriod Return the polling period.
 
void setCurrentPollingPeriod (uint32_t msec)
 setCurrentPollingPeriod Change the current polling period to call TimerHit() function in the driver.
 
uint32_t getCurrentPollingPeriod () const
 getCurrentPollingPeriod Return the current polling period.
 
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.
 
bool isInitializationComplete () const
 isInitializationComplete Check if driver initialization is complete.
 
void syncDriverInfo ()
 syncDriverInfo sends the current driver information to the client.
 
virtual const char * getDefaultName ()=0
 
void setDeviceNickname (const char *nick)
 Set the device nickname.
 
const char * getDeviceNickname ()
 
const char * lookupDeviceNicknameFromId (const char *identifier, const char *device=nullptr)
 Lookup device nickname for an identifier.
 
bool setDeviceNicknameFromId (const char *identifier)
 Set device nickname based on an identifier.
 
void saveNicknameId (const char *nickname, const char *identifier)
 
virtual void nicknameSet (const char *nickname)
 Inform driver that the nickname has been set.
 
 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 Connection::I2C
 
class FilterInterface
 
class FocuserInterface
 
class WeatherInterface
 
class LightBoxInterface
 
class OutputInterface
 
class InputInterface
 
class PowerInterface
 
class IMUInterface
 
class PACInterface
 

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) , OUTPUT_INTERFACE = (1 << 16) , INPUT_INTERFACE = (1 << 17) , POWER_INTERFACE = (1 << 18) ,
  IMU_INTERFACE = (1 << 19) , PAC_INTERFACE = (1 << 20) , 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< BaseDevicePrivate > d_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 122 of file defaultdevice.h.

Constructor & Destructor Documentation

◆ DefaultDevice() [1/2]

INDI::DefaultDevice::DefaultDevice ( )

Definition at line 436 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 899 of file defaultdevice.cpp.

◆ addConfigurationControl()

void INDI::DefaultDevice::addConfigurationControl ( )

Add Configuration control to the driver.

Definition at line 881 of file defaultdevice.cpp.

◆ addDebugControl()

void INDI::DefaultDevice::addDebugControl ( )

Add Debug control to the driver.

Examples
simplescope.cpp.

Definition at line 867 of file defaultdevice.cpp.

◆ addNicknameControl()

void INDI::DefaultDevice::addNicknameControl ( )

Add Nickname text property to the driver.

Definition at line 893 of file defaultdevice.cpp.

◆ addPollPeriodControl()

void INDI::DefaultDevice::addPollPeriodControl ( )

Add Polling period control to the driver.

Definition at line 887 of file defaultdevice.cpp.

◆ addSimulationControl()

void INDI::DefaultDevice::addSimulationControl ( )

Add Simulation control to the driver.

Definition at line 874 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 FocusMaster, WunderGround, Imager, INDIAlpacaServer, AstrometryDriver, DragonLIGHT, DustCoverSimulator, GPSSimulator, GPUSB, JoyStick, LightPanelSimulator, PACSimulator, SafetyMonitor, SkySafari, SQMSimulator, STAR2000, WakeOnLAN, WatchDog, CCDSim, GuideSim, AlpacaCCD, SeestarCCD, AlpacaDome, DomeScript, DomeSim, DragonLAIR, HakosRoof, RollOff, UniversalROR, FilterSim, AlpacaFilterWheel, ManualFilter, Wheelly, ActiveFocuser, FCUSB, FocusSim, FocusLynxF1, FocusLynxF2, HitecAstroDCFocuser, AlpacaFocuser, MoonLiteDRO, PerfectStar, SIEFS, SimulatorIO, GeminiPBH, UPS, RTLSDR, RadioSim, RotatorSimulator, SpectraCyber, TitanTCS, alpacaTelescopeDriver, LX200AstroPhysicsV2, LX200Gemini, LX200Pulsar2, MXHDTelescope, SynscanLegacyDriver, ScopeScript, ScopeSim, V4L2_Driver, AAGSolo, HitechWeather, OpenWeatherMap, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherMeta, WeatherSimulator, WeatherWatcher, SimpleReceiver, Dome, RainDetector, SimpleSkeleton, SimpleDevice, ScopeSim, SimpleCCD, and LX200AstroPhysics.

Definition at line 1435 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 QFW, GPUSB, FocusLynxF1, FocusLynxF2, FocusLynxBase, SteelDrive, GeminiPBH, IEQPro, IEQProLegacy, IOptronV3, LX200_TeenAstro, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Basic, LX200Telescope, PMC8, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, and LX200AstroPhysics.

Definition at line 974 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 1430 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 1425 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 1410 of file defaultdevice.cpp.

◆ defineProperty() [1/6]

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

Definition at line 1398 of file defaultdevice.cpp.

◆ defineProperty() [2/6]

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

Definition at line 1392 of file defaultdevice.cpp.

◆ defineProperty() [3/6]

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

Definition at line 1404 of file defaultdevice.cpp.

◆ defineProperty() [4/6]

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

Definition at line 1374 of file defaultdevice.cpp.

◆ defineProperty() [5/6]

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

Definition at line 1386 of file defaultdevice.cpp.

◆ defineProperty() [6/6]

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

Definition at line 1380 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 1420 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 1415 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 1342 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 convenience function that internally calls deleteProperty with the property name.

Definition at line 1337 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 1710 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 1516 of file defaultdevice.cpp.

◆ getDefaultName()

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

Implemented in QFW, TeenAstroFocuser, LX200_16, LX200GPS, SkyCommander, FocusMaster, WunderGround, Imager, INDIAlpacaServer, ALTO, ArduinoST4, AstrometryDriver, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, DustCoverSimulator, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, GPSSimulator, GPUSB, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, LPM, MLAstroRPA, OAPA, PACSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, PegasusUCH, DeltaT, SafetyMonitor, SkySafari, SnapCap, SQM, SQMSimulator, STAR2000, StarTechHub, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererEclipse, WandererETA, WandererBoxPlusV3, WandererBoxProV3, WatchDog, CCDSim, GuideSim, AlpacaCCD, SeestarCCD, AlpacaDome, BaaderDome, DDW, DomeScript, DomeSim, DomePro2, DragonLAIR, HakosRoof, Beaver, RigelDome, RollOff, RTIDome, ScopeDome, UniversalROR, FilterSim, FilterIFW, AlpacaFilterWheel, iEFW, ManualFilter, PegasusINDIGO, QHYCFW1, QHYCFW2, QHYCFW3, RasaFilterCube, TruTech, WandererSnowflakeFW, Wheelly, XAGYLWheel, AAF2, ActiveFocuser, AllunaTCS2, AskarWAF, astromechanics_foc, CelestronSCT, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, DreamFocuser, Esatto, EsattoArco, FCUSB, FocusSim, FocusLynxF1, FocusLynxF2, FocusLynxBase, HitecAstroDCFocuser, iEAFFocus, IKunFocuser, AlpacaFocuser, lacerta_mfoc, lacerta_mfoc_fmc, Lakeside, Microtouch, MoonLite, MoonLiteDRO, MyFocuserPro2, NFocus, NStep, OnFocus, PegasusFocusCube, PegasusFocusCube3, PegasusProdigyMF, PegasusScopsOAG, PerfectStar, PinefeatCEF, EFA, RainbowRSF, RBFOCUS, RoboFocus, SestoSenso, SestoSenso2, SestoSenso3, SIEFS, SmartFocus, SteelDrive, SteelDriveII, TCFS, USBFocusV3, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, RTLSDR, RadioSim, Camelot, DeepSkyDadFR1, Gemini, iAFSRotator, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, Pyxis, RotatorSimulator, WandererRotatorLiteV1, WandererRotatorLiteV2, WandererRotatorMini, FocuserDriver, MountDriver, ShelyakDriver, SpectraCyber, AstroTrac, CelestronGPS, TitanTCS, DSC, IEQPro, IEQProLegacy, alpacaTelescopeDriver, ioptronHC8406, IOptronV3, LX200_10MICRON, LX200_esp32go, LX200_OnStep, LX200NYX101, LX200_Proxisky, LX200_TeenAstro, LX200AM5, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Autostar, LX200Basic, LX200Classic, LX200FS2, LX200Gemini, LX200GotoNova, LX200Pulsar2, LX200Telescope, LX200ZEQ25, MXHDTelescope, Paramount, PlaneWave, PMC8, Rainbow, SkywatcherAPIMount, SynscanDriver, SynscanLegacyDriver, ScopeScript, ScopeSim, TemmaMount, ToupSH20, V4L2_Driver, AAGSolo, HitechWeather, MBox, OpenWeatherMap, UranusMeteo, Vantage, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherMeta, WeatherSimulator, WeatherWatcher, SimpleReceiver, Dome, RainDetector, SimpleSkeleton, SimpleDevice, ScopeSim, SimpleCCD, SimpleScope, INDI::IMU, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, SkywatcherAltAzSimple, Scope, WandererRotatorBase, LX200_OpenAstroTech, and LX200SS2000PC.

◆ getDeviceNickname()

const char * INDI::DefaultDevice::getDeviceNickname ( )
protected
Returns
Nickname for the device

Definition at line 1625 of file defaultdevice.cpp.

◆ getDriverExec()

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

Definition at line 1586 of file defaultdevice.cpp.

◆ getDriverInterface()

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

Definition at line 1142 of file defaultdevice.cpp.

◆ getDriverName()

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

Reimplemented in LX200_TeenAstro, and LX200Telescope.

Definition at line 1591 of file defaultdevice.cpp.

◆ getMajorVersion()

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

Definition at line 1691 of file defaultdevice.cpp.

◆ getMinorVersion()

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

Definition at line 1697 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 1716 of file defaultdevice.cpp.

◆ initProperties()

bool INDI::DefaultDevice::initProperties ( )
protectedvirtual

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

Returns
True if initialization is successful, false otherwise.

Reimplemented in QFW, TeenAstroFocuser, LX200_16, LX200GPS, INDI::SensorInterface, Imager, INDIAlpacaServer, ALTO, ArduinoST4, AstrometryDriver, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, DustCoverSimulator, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, GPSSimulator, GPUSB, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, LPM, MLAstroRPA, OAPA, PACSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, PegasusUCH, DeltaT, SafetyMonitor, SkySafari, SnapCap, SQM, SQMSimulator, STAR2000, StarTechHub, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererEclipse, WandererETA, WandererBoxPlusV3, WandererBoxProV3, WatchDog, CCDSim, GuideSim, AlpacaCCD, SeestarCCD, AlpacaDome, BaaderDome, DDW, DomeScript, DomeSim, DomePro2, DragonLAIR, HakosRoof, Beaver, RigelDome, RollOff, RTIDome, ScopeDome, UniversalROR, FilterSim, FilterIFW, AlpacaFilterWheel, iEFW, ManualFilter, PegasusINDIGO, QHYCFW1, QHYCFW2, QHYCFW3, RasaFilterCube, TruTech, WandererSnowflakeFW, Wheelly, XAGYLWheel, AAF2, ActiveFocuser, AllunaTCS2, AskarWAF, astromechanics_foc, CelestronSCT, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, DreamFocuser, Esatto, EsattoArco, FCUSB, FocusSim, FocusLynxF1, FocusLynxF2, FocusLynxBase, HitecAstroDCFocuser, iEAFFocus, IKunFocuser, AlpacaFocuser, lacerta_mfoc, lacerta_mfoc_fmc, Lakeside, Microtouch, MoonLite, MoonLiteDRO, MyFocuserPro2, NFocus, NStep, OnFocus, PegasusFocusCube, PegasusFocusCube3, PegasusProdigyMF, PegasusScopsOAG, PerfectStar, PinefeatCEF, EFA, RainbowRSF, RBFOCUS, RoboFocus, SestoSenso, SestoSenso2, SestoSenso3, SIEFS, SmartFocus, SteelDrive, SteelDriveII, TCFS, USBFocusV3, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, RTLSDR, RadioSim, Camelot, DeepSkyDadFR1, Gemini, iAFSRotator, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, Pyxis, WandererRotatorBase, FocuserDriver, MountDriver, AstroTrac, CelestronGPS, TitanTCS, DSC, EQ500X, IEQPro, IEQProLegacy, alpacaTelescopeDriver, ioptronHC8406, IOptronV3, LX200_10MICRON, LX200_esp32go, LX200_OnStep, LX200_OpenAstroTech, LX200NYX101, LX200_Proxisky, LX200_TeenAstro, LX200AM5, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Autostar, LX200Basic, LX200Classic, LX200FS2, LX200Gemini, LX200GotoNova, LX200Pulsar2, LX200SS2000PC, LX200Telescope, LX200ZEQ25, MXHDTelescope, Paramount, PlaneWave, PMC8, Rainbow, SkywatcherAPIMount, SynscanDriver, SynscanLegacyDriver, ScopeScript, ScopeSim, TemmaMount, ToupSH20, V4L2_Driver, AAGSolo, HitechWeather, MBox, OpenWeatherMap, UranusMeteo, Vantage, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherMeta, WeatherSimulator, WeatherWatcher, SimpleReceiver, Dome, RainDetector, SimpleSkeleton, ScopeSim, SimpleCCD, SimpleScope, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::GPS, INDI::IMU, INDI::Receiver, INDI::Rotator, INDI::Spectrograph, INDI::Telescope, INDI::Weather, FocusMaster, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, SkywatcherAltAzSimple, WunderGround, and Scope.

Examples
dome.cpp.

Definition at line 1160 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 1722 of file defaultdevice.cpp.

◆ isDebug()

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

Definition at line 962 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 QFW, LX200_16, LX200GPS, Imager, INDIAlpacaServer, AstrometryDriver, DeepSkyDadFP, DragonLIGHT, FlipFlat, GIOTTO, JoyStick, LightPanelSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, SafetyMonitor, SkySafari, SnapCap, STAR2000, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WatchDog, CCDSim, GuideSim, AlpacaCCD, AlpacaDome, DomeScript, DragonLAIR, HakosRoof, AlpacaFilterWheel, ManualFilter, QHYCFW1, QHYCFW2, ActiveFocuser, DMFC, FocusSim, FocusLynxBase, lacerta_mfoc, lacerta_mfoc_fmc, IPX800, UPS, nFrameRotator, SpectraCyber, AstroTrac, CelestronGPS, LX200_10MICRON, LX200_esp32go, LX200_OnStep, LX200_TeenAstro, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Gemini, LX200Pulsar2, LX200Telescope, PMC8, SkywatcherAPIMount, ScopeScript, ScopeSim, V4L2_Driver, AAGSolo, OpenWeatherMap, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherMeta, WeatherWatcher, SimpleSkeleton, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::Receiver, INDI::Rotator, INDI::Spectrograph, INDI::Telescope, INDI::Weather, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, SkywatcherAltAzSimple, WunderGround, Scope, and GeminiFlatpanel.

Examples
simpleskeleton.cpp.

Definition at line 989 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 1728 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 Imager, AstrometryDriver, AstroTrac, SkywatcherAPIMount, SynscanLegacyDriver, TemmaMount, ScopeSim, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Receiver, INDI::Spectrograph, SkywatcherAltAzSimple, and Scope.

Definition at line 833 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 TeenAstroFocuser, LX200_16, LX200GPS, Imager, INDIAlpacaServer, ALTO, ArduinoST4, AstrometryDriver, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, DustCoverSimulator, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, GPSSimulator, GPUSB, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, MLAstroRPA, OAPA, PACSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, DeltaT, SnapCap, SQM, SQMSimulator, STAR2000, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererETA, WandererBoxPlusV3, WandererBoxProV3, WatchDog, CCDSim, GuideSim, AlpacaCCD, AlpacaDome, DomeSim, DomePro2, HakosRoof, Beaver, RigelDome, RTIDome, ScopeDome, FilterSim, ManualFilter, QHYCFW1, QHYCFW2, RasaFilterCube, WandererSnowflakeFW, Wheelly, XAGYLWheel, ActiveFocuser, AllunaTCS2, astromechanics_foc, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, EsattoArco, FocusSim, FocusLynxBase, HitecAstroDCFocuser, IKunFocuser, lacerta_mfoc, lacerta_mfoc_fmc, Lakeside, Microtouch, MoonLite, MoonLiteDRO, MyFocuserPro2, NFocus, NStep, OnFocus, PegasusFocusCube, PegasusFocusCube3, PegasusProdigyMF, PerfectStar, PinefeatCEF, EFA, RoboFocus, SestoSenso2, SestoSenso3, SmartFocus, SteelDrive, SteelDriveII, TCFS, USBFocusV3, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, RTLSDR, RadioSim, Camelot, Gemini, iAFSRotator, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, Pyxis, WandererRotatorBase, MountDriver, ShelyakDriver, SpectraCyber, AstroTrac, CelestronGPS, TitanTCS, DSC, IEQPro, IEQProLegacy, IOptronV3, LX200_10MICRON, LX200_esp32go, LX200_OnStep, LX200_OpenAstroTech, LX200NYX101, LX200_Proxisky, LX200_TeenAstro, LX200AM5, LX200AstroPhysicsV2, LX200Basic, LX200Classic, LX200FS2, LX200Gemini, LX200Pulsar2, LX200SS2000PC, LX200Telescope, LX200ZEQ25, MXHDTelescope, Paramount, PlaneWave, PMC8, Rainbow, SkywatcherAPIMount, SynscanDriver, SynscanLegacyDriver, ScopeSim, TemmaMount, ToupSH20, V4L2_Driver, MBox, UranusMeteo, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherSimulator, ScopeSim, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::GPS, INDI::IMU, INDI::Receiver, INDI::Rotator, INDI::Spectrograph, INDI::Telescope, INDI::Weather, FocusMaster, LX200AstroPhysics, LX200AstroPhysics, SkywatcherAltAzSimple, and Scope.

Definition at line 795 of file defaultdevice.cpp.

◆ ISNewProperty()

bool INDI::DefaultDevice::ISNewProperty ( INDI::Property &  property,
const std::string &  elementName,
const std::any &  value 
)

Generic convenience function to update a property element as if by client request, simulating an ISNew... call.

This function determines the type of the property (Switch, Number, Text) and attempts to cast the std::any value to the appropriate type before calling the corresponding ISNew... function.

Parameters
propertyReference to the INDI::Property object to be updated.
elementNameThe name of the element within the property to update.
valueThe new value for the element, wrapped in std::any.
  • For Switch properties: std::any should contain an ISState.
  • For Number properties: std::any should contain a double or int.
  • For Text properties: std::any should contain a const char* or std::string.
Returns
True if the update was successfully dispatched via the appropriate ISNew... function, false otherwise (e.g., type mismatch, element not found, property not found).

Definition at line 1734 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 TeenAstroFocuser, LX200_16, LX200GPS, Imager, INDIAlpacaServer, ALTO, AstrometryDriver, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, DustCoverSimulator, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, LPM, MLAstroRPA, OAPA, PACSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, PegasusUCH, DeltaT, SafetyMonitor, SkySafari, SnapCap, STAR2000, StarTechHub, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererEclipse, WandererETA, WandererBoxPlusV3, WandererBoxProV3, WatchDog, CCDSim, GuideSim, AlpacaCCD, AlpacaDome, BaaderDome, DomeScript, DomePro2, DragonLAIR, HakosRoof, Beaver, RigelDome, RollOff, RTIDome, ScopeDome, UniversalROR, FilterIFW, iEFW, ManualFilter, TruTech, WandererSnowflakeFW, Wheelly, XAGYLWheel, ActiveFocuser, AllunaTCS2, CelestronSCT, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, DreamFocuser, Esatto, EsattoArco, FCUSB, FocusSim, FocusLynxBase, iEAFFocus, IKunFocuser, AlpacaFocuser, lacerta_mfoc, lacerta_mfoc_fmc, Lakeside, Microtouch, MoonLite, MoonLiteDRO, MyFocuserPro2, NStep, OnFocus, PegasusFocusCube, PegasusScopsOAG, PinefeatCEF, EFA, RainbowRSF, RBFOCUS, RoboFocus, SestoSenso, SestoSenso2, SestoSenso3, SteelDrive, SteelDriveII, TCFS, USBFocusV3, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, USBDewpoint, Camelot, DeepSkyDadFR1, Gemini, iAFSRotator, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, Pyxis, WandererRotatorBase, FocuserDriver, ShelyakDriver, SpectraCyber, AstroTrac, CelestronGPS, TitanTCS, DSC, IEQProLegacy, ioptronHC8406, IOptronV3, LX200_10MICRON, LX200_OnStep, LX200NYX101, LX200_Proxisky, LX200_TeenAstro, LX200AM5, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Classic, LX200FS2, LX200Gemini, LX200GotoNova, LX200Pulsar2, LX200Telescope, MXHDTelescope, PlaneWave, PMC8, Rainbow, SkywatcherAPIMount, SynscanDriver, SynscanLegacyDriver, ScopeSim, TemmaMount, ToupSH20, V4L2_Driver, AAGSolo, MBox, UranusMeteo, WeatherSafetyProxy, WeatherWatcher, ScopeSim, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::GPS, INDI::IMU, INDI::Receiver, INDI::Rotator, INDI::Spectrograph, INDI::Telescope, INDI::Weather, FocusMaster, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, SkywatcherAltAzSimple, and Scope.

Definition at line 751 of file defaultdevice.cpp.

◆ ISNewText()

bool INDI::DefaultDevice::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
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 Imager, INDIAlpacaServer, AstrometryDriver, DeepSkyDadFP, DragonLIGHT, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, LPM, MLAstroRPA, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, SafetyMonitor, SkySafari, SnapCap, STAR2000, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WatchDog, CCDSim, AlpacaCCD, AlpacaDome, DomeScript, DragonLAIR, HakosRoof, ScopeDome, UniversalROR, FilterIFW, AlpacaFilterWheel, Wheelly, FocusLynxBase, AlpacaFocuser, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, Gemini, ShelyakDriver, SpectraCyber, AstroTrac, DSC, LX200_10MICRON, LX200_OpenAstroTech, LX200_TeenAstro, LX200Pulsar2, LX200Telescope, PlaneWave, SkywatcherAPIMount, SynscanLegacyDriver, ScopeScript, ScopeSim, TemmaMount, V4L2_Driver, AAGSolo, OpenWeatherMap, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherMeta, WeatherWatcher, ScopeSim, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::IMU, INDI::Receiver, INDI::Spectrograph, INDI::Telescope, INDI::Weather, SkywatcherAltAzSimple, WunderGround, and Scope.

Definition at line 814 of file defaultdevice.cpp.

◆ isSimulation()

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

Definition at line 968 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 Imager, AstrometryDriver, DeepSkyDadFP, DragonLIGHT, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, JoyStick, LightPanelSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, SnapCap, STAR2000, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WatchDog, CCDSim, GuideSim, DragonLAIR, RollOff, UniversalROR, CheapoDC, SpectraCyber, ScopeSim, WeatherMeta, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::Receiver, INDI::Spectrograph, INDI::Telescope, INDI::Weather, and Scope.

Definition at line 853 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 FocusLynxBase, FilterIFW, UPS, and WeatherSafetyAlpaca.

Examples
simpleskeleton.cpp.

Definition at line 450 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 445 of file defaultdevice.cpp.

◆ loadDefaultConfig()

bool INDI::DefaultDevice::loadDefaultConfig ( )
protectedvirtual

Load the default configuration file.

Returns
True if successful, false otherwise.

Definition at line 728 of file defaultdevice.cpp.

◆ lookupDeviceNicknameFromId()

const char * INDI::DefaultDevice::lookupDeviceNicknameFromId ( const char *  identifier,
const char *  device = nullptr 
)
protected

Lookup device nickname for an identifier.

Parameters
identifierThe id to look up
deviceThe device name for the identifier. If null or empty string, will look up for current device's default name.

Returns the nickname if found, if not found returns nullptr.

Definition at line 1631 of file defaultdevice.cpp.

◆ nicknameSet()

void INDI::DefaultDevice::nicknameSet ( const char *  nickname)
protectedvirtual

Inform driver that the nickname has been set.

Reimplement this function to get notified on nickname update to save with saveNicknameId(). To just read the nickname if already set, use getDeviceNickname();

Parameters
nicknameThe nickname. Emptystring or nullptr means no nickname set.

Definition at line 984 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 511 of file defaultdevice.cpp.

◆ refCurrentPollingPeriod() [1/2]

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

Definition at line 1522 of file defaultdevice.cpp.

◆ refCurrentPollingPeriod() [2/2]

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

Definition at line 1528 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 1484 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 1113 of file defaultdevice.cpp.

◆ resetProperties()

void INDI::DefaultDevice::resetProperties ( )

Set all properties to IDLE state.

Definition at line 1077 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 492 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 529 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 524 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 TeenAstroFocuser, LX200GPS, INDI::SensorInterface, WunderGround, INDIAlpacaServer, ALTO, AstrometryDriver, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, DustCoverSimulator, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, GPSSimulator, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, MLAstroRPA, OAPA, PACSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, PegasusUCH, DeltaT, SafetyMonitor, SkySafari, SnapCap, STAR2000, StarTechHub, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererETA, WandererBoxPlusV3, WandererBoxProV3, WatchDog, CCDSim, GuideSim, AlpacaCCD, AlpacaDome, BaaderDome, DDW, DomeScript, DomeSim, DomePro2, DragonLAIR, HakosRoof, Beaver, RollOff, ScopeDome, UniversalROR, FilterIFW, AlpacaFilterWheel, ManualFilter, QHYCFW1, QHYCFW2, WandererSnowflakeFW, Wheelly, XAGYLWheel, AllunaTCS2, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, EsattoArco, FCUSB, FocusSim, FocusLynxBase, HitecAstroDCFocuser, lacerta_mfoc, lacerta_mfoc_fmc, MoonLite, MoonLiteDRO, MyFocuserPro2, NFocus, NStep, PegasusFocusCube, PegasusProdigyMF, PegasusScopsOAG, EFA, RoboFocus, SestoSenso2, SestoSenso3, SmartFocus, SteelDrive, SteelDriveII, TCFS, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, Camelot, Gemini, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, WandererRotatorBase, FocuserDriver, AstroTrac, CelestronGPS, DSC, IEQPro, IEQProLegacy, alpacaTelescopeDriver, ioptronHC8406, IOptronV3, LX200_10MICRON, LX200_OnStep, LX200_TeenAstro, LX200AM5, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Basic, LX200Classic, LX200FS2, LX200Gemini, LX200GotoNova, LX200SS2000PC, LX200Telescope, PlaneWave, PMC8, SkywatcherAPIMount, ScopeScript, ScopeSim, V4L2_Driver, AAGSolo, OpenWeatherMap, UranusMeteo, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherFlow, WeatherMeta, WeatherSimulator, WeatherWatcher, INDI::CCD, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::GPS, INDI::IMU, INDI::Rotator, INDI::Telescope, INDI::Weather, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, and SkywatcherAltAzSimple.

Definition at line 478 of file defaultdevice.cpp.

◆ saveNicknameId()

void INDI::DefaultDevice::saveNicknameId ( const char *  nickname,
const char *  identifier 
)
protected

Definition at line 1665 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 1549 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 1086 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 1510 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 907 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 1534 of file defaultdevice.cpp.

◆ setDeviceNickname()

void INDI::DefaultDevice::setDeviceNickname ( const char *  nick)
protected

Set the device nickname.

Parameters
nicknew device nickname

When a nickname is set, the full device name will be "DefaultName Nickname". Setting the nickname will also set the device name. If nick is already prefixed with the defaultname, it will be removed.

Definition at line 1596 of file defaultdevice.cpp.

◆ setDeviceNicknameFromId()

bool INDI::DefaultDevice::setDeviceNicknameFromId ( const char *  identifier)
protected

Set device nickname based on an identifier.

Parameters
identifierThe id to look up

Definition at line 1657 of file defaultdevice.cpp.

◆ setDriverInterface()

void INDI::DefaultDevice::setDriverInterface ( uint32_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 function.

Definition at line 1148 of file defaultdevice.cpp.

◆ setDynamicPropertiesBehavior()

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

setDynamicPropertiesBehavior controls handling of dynamic properties. Dynamic 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 1703 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 1541 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 937 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 1104 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 1684 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 QFW, FilterIFW, FocusLynxF1, AstroTrac, CelestronGPS, DSC, IEQPro, IEQProLegacy, IOptronV3, and PMC8.

Definition at line 979 of file defaultdevice.cpp.

◆ syncDriverInfo()

void INDI::DefaultDevice::syncDriverInfo ( )
protected

syncDriverInfo sends the current driver information to the client.

Definition at line 1154 of file defaultdevice.cpp.

◆ TimerHit()

void INDI::DefaultDevice::TimerHit ( )
virtual

Callback function to be called once SetTimer duration elapses.

Reimplemented in TeenAstroFocuser, FocusMaster, INDIAlpacaServer, ALTO, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, Excalibur, FlipFlat, GeminiFlatpanel, IndiAstrolink4, IndiAstroLink4mini2, IPX800, LPM, MLAstroRPA, OAPA, PegasusFlatMasterNeo, PegasusFlatMasterWifi, PegasusUCH, DeltaT, SkySafari, SnapCap, SQM, STAR2000, StarTechHub, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererEclipse, WandererETA, WandererBoxPlusV3, WandererBoxProV3, WatchDog, CCDSim, GuideSim, AlpacaCCD, AlpacaDome, BaaderDome, DDW, DomeScript, DomeSim, DomePro2, DragonLAIR, HakosRoof, Beaver, RigelDome, RollOff, RTIDome, ScopeDome, UniversalROR, FilterSim, FilterIFW, PegasusINDIGO, TruTech, Wheelly, AAF2, ActiveFocuser, AllunaTCS2, AskarWAF, CelestronSCT, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, DreamFocuser, Esatto, EsattoArco, FCUSB, FocusLynxBase, HitecAstroDCFocuser, iEAFFocus, IKunFocuser, AlpacaFocuser, Lakeside, Microtouch, MoonLite, MoonLiteDRO, MyFocuserPro2, NFocus, NStep, OnFocus, PegasusFocusCube, PegasusFocusCube3, PegasusProdigyMF, PegasusScopsOAG, PerfectStar, PinefeatCEF, EFA, RainbowRSF, RBFOCUS, RoboFocus, SestoSenso, SestoSenso2, SestoSenso3, SIEFS, SmartFocus, SteelDrive, SteelDriveII, TCFS, USBFocusV3, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, RTLSDR, RadioSim, Camelot, DeepSkyDadFR1, Gemini, iAFSRotator, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, Pyxis, RotatorSimulator, WandererRotatorBase, FocuserDriver, SpectraCyber, MXHDTelescope, SkywatcherAPIMount, UranusMeteo, SimpleReceiver, ScopeSim, SimpleCCD, INDI::Telescope, and SkywatcherAltAzSimple.

Definition at line 1124 of file defaultdevice.cpp.

◆ 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 1490 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 TeenAstroFocuser, LX200_16, LX200GPS, INDI::SensorInterface, Imager, INDIAlpacaServer, ALTO, ArduinoST4, AstrometryDriver, AvalonUPAS, DeepSkyDadFP, DragonLIGHT, DustCoverSimulator, Excalibur, FlipFlat, GeminiFlatpanel, GIOTTO, GPUSB, IndiAstrolink4, IndiAstroLink4mini2, IPX800, JoyStick, LightPanelSimulator, LPM, MLAstroRPA, OAPA, PACSimulator, PegasusFlatMaster, PegasusFlatMasterNeo, PegasusFlatMasterWifi, PegasusUCH, DeltaT, SafetyMonitor, SnapCap, SQM, SQMSimulator, STAR2000, StarTechHub, WakeOnLAN, WandererCover, WandererCoverV4EC, WandererCoverV4ProEC, WandererDewTerminator, WandererEclipse, WandererETA, WandererBoxPlusV3, WandererBoxProV3, CCDSim, GuideSim, AlpacaCCD, SeestarCCD, AlpacaDome, BaaderDome, DDW, DomeScript, DomeSim, DomePro2, DragonLAIR, HakosRoof, Beaver, RigelDome, RollOff, RTIDome, ScopeDome, UniversalROR, FilterSim, FilterIFW, AlpacaFilterWheel, iEFW, ManualFilter, PegasusINDIGO, RasaFilterCube, TruTech, WandererSnowflakeFW, Wheelly, XAGYLWheel, AAF2, ActiveFocuser, AllunaTCS2, AskarWAF, astromechanics_foc, CelestronSCT, DeepSkyDadAF1, DeepSkyDadAF2, DeepSkyDadAF3, DMFC, DreamFocuser, Esatto, EsattoArco, FCUSB, FocusSim, FocusLynxF1, FocusLynxBase, HitecAstroDCFocuser, iEAFFocus, IKunFocuser, AlpacaFocuser, lacerta_mfoc, lacerta_mfoc_fmc, Lakeside, Microtouch, MoonLite, MoonLiteDRO, MyFocuserPro2, NFocus, NStep, OnFocus, PegasusFocusCube, PegasusFocusCube3, PegasusProdigyMF, PegasusScopsOAG, PerfectStar, PinefeatCEF, EFA, RainbowRSF, RBFOCUS, RoboFocus, SestoSenso, SestoSenso2, SestoSenso3, SmartFocus, SteelDrive, SteelDriveII, TCFS, USBFocusV3, IPX800, SimulatorIO, WaveshareRelay, CheapoDC, CelestronDewPower, GeminiPBH, MyDCP4ESP, myDewControllerPro, PegasusPPB, PegasusPPBA, PegasusSPB, PegasusUPB, PegasusUPB3, SVBONYPowerBox, TerransPowerBoxGoV2, TerransPowerBoxProV2, UPS, USBDewpoint, RTLSDR, RadioSim, Camelot, DeepSkyDadFR1, Gemini, iAFSRotator, Integra, nFrameRotator, NightCrawler, PegasusFalcon, PegasusFalconV2, PlaneWaveRotator, Pyxis, WandererRotatorBase, FocuserDriver, MountDriver, AstroTrac, CelestronGPS, TitanTCS, DSC, IEQPro, IEQProLegacy, alpacaTelescopeDriver, ioptronHC8406, IOptronV3, LX200_10MICRON, LX200_esp32go, LX200_OnStep, LX200_OpenAstroTech, LX200NYX101, LX200_Proxisky, LX200_TeenAstro, LX200AM5, LX200AstroPhysicsGTOCP2, LX200AstroPhysicsV2, LX200Autostar, LX200Basic, LX200Classic, LX200FS2, LX200Gemini, LX200GotoNova, LX200Pulsar2, LX200SS2000PC, LX200Telescope, LX200ZEQ25, MXHDTelescope, Paramount, PlaneWave, PMC8, Rainbow, SkywatcherAPIMount, SynscanDriver, SynscanLegacyDriver, ScopeSim, TemmaMount, ToupSH20, V4L2_Driver, AAGSolo, MBox, UranusMeteo, WeatherSafetyAlpaca, WeatherSafetyProxy, WeatherMeta, WeatherSimulator, WeatherWatcher, SimpleReceiver, Dome, RainDetector, SimpleCCD, INDI::CCD, INDI::Correlator, INDI::Detector, INDI::Dome, INDI::FilterWheel, INDI::Focuser, INDI::GPS, INDI::IMU, INDI::Receiver, INDI::Rotator, INDI::Spectrograph, INDI::Telescope, INDI::Weather, FocusMaster, LX200AstroPhysics, LX200AstroPhysicsGTOCP2, LX200AstroPhysics, and SkywatcherAltAzSimple.

Examples
dome.cpp.

Definition at line 1129 of file defaultdevice.cpp.

◆ updateProperty()

template<typename PropertyType , typename ValueType >
bool INDI::DefaultDevice::updateProperty ( PropertyType &  property,
ValueType *  values,
char *  names[],
int  n,
std::function< bool()>  updater,
bool  saveConfig = false 
)
inline

Generic helper function to update an INDI property based on an external operation.

This function encapsulates the common pattern of:

  1. Checking if a property's values have actually changed.
  2. Executing an external update function (e.g., communicating with hardware).
  3. Updating the INDI property's internal state and applying changes if the external update was successful.
  4. Optionally saving the configuration.
Template Parameters
PropertyTypeThe type of the INDI property (e.g., INDI::PropertyNumber, INDI::PropertyText, INDI::PropertySwitch).
ValueTypeThe type of the array elements (e.g., double, char*, ISState).
Parameters
propertyThe INDI property to update.
valuesThe array of new values for the property elements.
namesThe array of names corresponding to the values.
nThe number of elements in the values and names arrays.
updaterA std::function that performs the actual device update. It should return true on success, false on failure.
saveConfigIf true, save the property's configuration after a successful update. Defaults to false.
Returns
True if the property was updated and the external operation was successful, false otherwise.

Definition at line 356 of file defaultdevice.h.

◆ 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 860 of file defaultdevice.cpp.

Friends And Related Symbol Documentation

◆ Connection::I2C

friend class Connection::I2C
friend

Definition at line 683 of file defaultdevice.h.

◆ Connection::Serial

friend class Connection::Serial
friend

Definition at line 681 of file defaultdevice.h.

◆ Connection::TCP

friend class Connection::TCP
friend

Definition at line 682 of file defaultdevice.h.

◆ FilterInterface

friend class FilterInterface
friend

Definition at line 684 of file defaultdevice.h.

◆ FocuserInterface

friend class FocuserInterface
friend

Definition at line 685 of file defaultdevice.h.

◆ IMUInterface

friend class IMUInterface
friend

Definition at line 691 of file defaultdevice.h.

◆ InputInterface

friend class InputInterface
friend

Definition at line 689 of file defaultdevice.h.

◆ LightBoxInterface

friend class LightBoxInterface
friend

Definition at line 687 of file defaultdevice.h.

◆ OutputInterface

friend class OutputInterface
friend

Definition at line 688 of file defaultdevice.h.

◆ PACInterface

friend class PACInterface
friend

Definition at line 692 of file defaultdevice.h.

◆ PowerInterface

friend class PowerInterface
friend

Definition at line 690 of file defaultdevice.h.

◆ WeatherInterface

friend class WeatherInterface
friend

Definition at line 686 of file defaultdevice.h.


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