48 return "Rain Detector";
62 mRainSwitch[0].
fill(
"On",
"");
63 mRainSwitch[1].
fill(
"Off",
"");
67 if (mRainSwitch[0].getState() ==
ISS_ON)
71 mRainLight.
apply(
"Alert! Alert! Rain detected!");
77 mRainLight.
apply(
"Rain threat passed. The skies are clear.");
const char * getDeviceName() const
virtual bool updateProperties()
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
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)
bool Disconnect() override
Disconnect from device.
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....
const char * getDefaultName() override
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
void IDMessage(const char *dev, const char *fmt,...)
std::unique_ptr< RainDetector > rainDetector(new RainDetector())
Construct a rain detector device that the user may operate to raise a rain alert. This rain light pro...