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.
#include <memory>
#include <cstring>
#include <unistd.h>
{
return true;
}
{
return true;
}
{
return "Dome";
}
{
{
if (mShutterSwitch[0].getState() ==
ISS_ON)
else
});
{
{
mRainLight = rain;
{
{
if (mShutterSwitch[0].getState() ==
ISS_ON)
else
}
{
}
oldRainState = newRainState;
});
});
});
return true;
}
{
else
return true;
}
{
mShutterSwitch.
apply(
"Shutter is closing...");
mShutterSwitch.
apply(
"Shutter is closed.");
});
}
{
{
mShutterSwitch.
apply(
"It is raining, cannot open Shutter.");
return;
}
mShutterSwitch.
apply(
"Shutter is opening...");
mShutterSwitch.
apply(
"Shutter is open.");
});
}
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool Disconnect() override
Disconnect from device.
const char * getDefaultName() override
Class to provide basic INDI device functionality.
const char * getDeviceName() const
virtual bool updateProperties()
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
void watchDevice(const char *deviceName, const std::function< void(INDI::BaseDevice)> &callback)
Add a device to the watch list.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
virtual bool initProperties()
Initilize properties initial state and value. The child class must implement this function.
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
void fill(const char *device, const char *name, const char *label, const char *group, IPState state)
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, ISRule rule, double timeout, IPState state)
void onUpdate(const std::function< void()> &callback)
static void singleShot(int msec, const std::function< void()> &callback)
This static function calls a the given function after a given time interval.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
std::unique_ptr< Dome > dome(new Dome())
Construct a dome device that the user may operate to open or close the dome shutter door....
void IDMessage(const char *dev, const char *fmt,...)