Instrument Neutral Distributed Interface INDI  2.0.2
dome.h

The dome driver snoops on the rain detector signal and watches whether rain is detected or not. If it is detector and the dome is closed, it performs no action, but it also prevents you from opening the dome due to rain. If the dome is open, it will automatically starts closing the shutter. In order snooping to work, both drivers must be started by the same indiserver (or chained INDI servers):

indiserver tutorial_dome tutorial_rain

The dome driver keeps a copy of RainL light property from the rain driver. This makes it easy to parse the property status once an update from the rain driver arrives in the dome driver. Alternatively, you can directly parse the XML root element in ISSnoopDevice(XMLEle *root) to extract the required data.

/*
INDI Developers Manual
Tutorial #5 - Snooping
Dome
Refer to README, which contains instruction on how to build this driver, and use it
with an INDI-compatible client.
*/
#pragma once
#include <defaultdevice.h>
class Dome : public INDI::DefaultDevice
{
public:
Dome() = default;
public:
void closeShutter();
void openShutter();
protected:
// General device functions
bool Connect() override;
bool Disconnect() override;
const char *getDefaultName() override;
bool initProperties() override;
bool updateProperties() override;
private:
INDI::PropertySwitch mShutterSwitch {2};
INDI::PropertyLight mRainLight {1};
};
Definition: dome.h:33
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: dome.cpp:38
Dome()=default
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: dome.cpp:64
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: dome.cpp:118
void openShutter()
Definition: dome.cpp:152
bool Disconnect() override
Disconnect from device.
Definition: dome.cpp:47
const char * getDefaultName() override
Definition: dome.cpp:56
void closeShutter()
Definition: dome.cpp:135
Class to provide extended functionality for devices in addition to the functionality provided by INDI...