254 void setVersion(uint16_t vMajor, uint16_t vMinor);
284 virtual
bool ISNewSwitch(const
char *dev, const
char *name,
ISState *states,
char *names[],
int n);
291 virtual
bool ISNewNumber(const
char *dev, const
char *name,
double values[],
char *names[],
int n);
298 virtual
bool ISNewText(const
char *dev, const
char *name,
char *texts[],
char *names[],
int n);
305 virtual
bool ISNewBLOB(const
char *dev, const
char *name,
int sizes[],
int blobsizes[],
char *blobs[],
306 char *formats[],
char *names[],
int n);
355 template<typename PropertyType, typename ValueType>
359 if (property.isUpdated(values, names,
n))
363 property.update(values, names, n);
364 property.setState(IPS_OK);
366 this->saveConfig(property);
372 property.setState(IPS_ALERT);
380 property.setState(
IPS_OK);
389 uint32_t getDriverInterface()
const;
398 void setDriverInterface(uint32_t value);
405 void watchDevice(
const char *deviceName,
const std::function<
void (INDI::BaseDevice)> &callback);
422 void setDynamicPropertiesBehavior(
bool defineEnabled,
bool deleteEnabled);
433 virtual bool loadConfig(
bool silent =
false,
const char *property =
nullptr);
442 bool loadConfig(INDI::Property &property);
451 virtual bool saveConfig(
bool silent =
false,
const char *property =
nullptr);
459 bool saveConfig(INDI::Property &property);
465 virtual bool purgeConfig();
475 virtual bool saveConfigItems(FILE *fp);
482 virtual bool saveAllConfigItems(FILE *fp);
488 virtual bool loadDefaultConfig();
497 void setDebug(
bool enable);
504 void setSimulation(
bool enable);
513 virtual void debugTriggered(
bool enable);
522 virtual void simulationTriggered(
bool enable);
525 bool isDebug()
const;
528 bool isSimulation()
const;
534 virtual bool initProperties();
543 virtual bool updateProperties();
558 virtual bool Disconnect();
565 void registerConnection(Connection::Interface *newConnection);
572 bool unRegisterConnection(Connection::Interface *existingConnection);
575 Connection::Interface *getActiveConnection();
581 void setActiveConnection(Connection::Interface *existingConnection);
589 void setDefaultPollingPeriod(uint32_t msec);
596 void setPollingPeriodRange(uint32_t minimum, uint32_t maximum);
602 uint32_t getPollingPeriod()
const;
609 void setCurrentPollingPeriod(uint32_t msec);
615 uint32_t getCurrentPollingPeriod()
const;
618 uint32_t &refCurrentPollingPeriod()
__attribute__((deprecated));
619 uint32_t refCurrentPollingPeriod() const
__attribute__((deprecated));
620#define POLLMS refCurrentPollingPeriod()
627 bool isConfigLoading()
const;
634 bool isInitializationComplete()
const;
637 void syncDriverInfo();
668 void saveNicknameId(
const char *nickname,
const char *identifier);
__attribute__((__format__(__printf__, 2, 0))) void CelestronDriver
The I2C class manages connection with I2C devices on Linux systems. I2C communication is commonly use...
The Interface class is the base class for all INDI connection plugins.
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
The TCP class manages connection with devices over the network via TCP/IP. Upon successful connection...
void defineSwitch(ISwitchVectorProperty *svp)
Define switch vector to client & register it. Alternatively, IDDefswitch can be used but the property...
void addPollPeriodControl()
Add Polling period control to the driver.
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.
void defineBLOB(IBLOBVectorProperty *bvp)
Define BLOB vector to client & register it. Alternatively, IDDefBLOB can be used but the property wil...
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void addConfigurationControl()
Add Configuration control to the driver.
virtual ~DefaultDevice() override=default
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process the client newSwitch command.
uint16_t getMajorVersion() const
void addSimulationControl()
Add Simulation control to the driver.
friend class IMUInterface
const char * lookupDeviceNicknameFromId(const char *identifier, const char *device=nullptr)
Lookup device nickname for an identifier.
void defineNumber(INumberVectorProperty *nvp)
Define number vector to client & register it. Alternatively, IDDefNumber can be used but the property...
virtual void ISGetProperties(const char *dev)
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual void setConnected(bool status, IPState state=IPS_OK, const char *msg=nullptr)
Set connection switch status in the client.
virtual bool ISSnoopDevice(XMLEle *root)
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
friend class WeatherInterface
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
friend class FilterInterface
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
void saveNicknameId(const char *nickname, const char *identifier)
virtual void TimerHit()
Callback function to be called once SetTimer duration elapses.
void defineText(ITextVectorProperty *tvp)
Define text vector to client & register it. Alternatively, IDDefText can be used but the property wil...
friend class OutputInterface
virtual const char * getDefaultName()=0
friend class InputInterface
friend class FocuserInterface
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
void setDeviceNickname(const char *nick)
Set the device nickname.
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,...
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 const char * getDriverName()
void defineLight(ILightVectorProperty *lvp)
Define light vector to client & register it. Alternatively, IDDeflight can be used but the property w...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process the client newNumber command.
void resetProperties()
Set all properties to IDLE state.
void RemoveTimer(int id)
Remove timer added with SetTimer.
void addNicknameControl()
Add Nickname text property to the driver.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
const char * getDeviceNickname()
bool setDeviceNicknameFromId(const char *identifier)
Set device nickname based on an identifier.
friend class LightBoxInterface
DefaultDevice(const std::shared_ptr< DefaultDevicePrivate > &dd)
virtual const char * getDriverExec()
uint16_t getMinorVersion() const
virtual void nicknameSet(const char *nickname)
Inform driver that the nickname has been set.
friend class PowerInterface
void addDebugControl()
Add Debug control to the driver.
friend class PACInterface
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process the client newSwitch command.
Provides generic container for INDI properties.
const char * GUIDE_TAB
GUIDE_TAB Where all the properties for guiding are located.
const char * CONNECTION_TAB
CONNECTION_TAB Where all device connection settings (serial, usb, ethernet) are defined and controlle...
const char * FILTER_TAB
FILTER_TAB Where all the properties for filter wheels are located.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * DATETIME_TAB
DATETIME_TAB Where all date and time setting properties are located.
const char * SATELLITE_TAB
SATELLITE_TAB.
const char * COMMUNICATION_TAB
COMMUNICATION_TAB Where all the properties required to connect/disconnect from a device are located....
const char * INFO_TAB
INFO_TAB Where all the properties for general information are located.
const char * MOTION_TAB
MOTION_TAB Where all the motion control properties of the device are located.
const char * SITE_TAB
SITE_TAB Where all site information setting are located.
const char * FOCUS_TAB
FOCUS_TAB Where all the properties for focuser are located.
const char * OPTIONS_TAB
OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls,...
struct _IBLOBVectorProperty IBLOBVectorProperty
struct _ISwitchVectorProperty ISwitchVectorProperty
struct _ITextVectorProperty ITextVectorProperty
struct _ILightVectorProperty ILightVectorProperty
struct _INumberVectorProperty INumberVectorProperty
*brief user defined string literal for JSON values *sa std::size_t n
#define INDI_DEPRECATED(message)
Combines all INDI Connection Plugins. Each INDI connection plugin is responsible of managing communic...
Namespace to encapsulate INDI client, drivers, and mediator classes.