Instrument Neutral Distributed Interface INDI  1.9.2
raindetector.h

The rain detector emits a signal each time it detects raid. This signal is snooped by the dome driver.

/*
INDI Developers Manual
Tutorial #5 - Snooping
Rain Detector
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"
{
public:
RainDetector() = default;
protected:
// General device functions
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
bool Connect() override;
bool Disconnect() override;
const char *getDefaultName() override;
bool initProperties() override;
bool updateProperties() override;
private:
ILight RainL[1];
ISwitch RainS[2];
};
RainDetector
Definition: raindetector.h:25
_ILightVectorProperty
Light vector property descriptor.
Definition: indiapi.h:415
ISwitch
One switch descriptor.
RainDetector::initProperties
bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: raindetector.cpp:54
RainDetector::Disconnect
bool Disconnect() override
Disconnect from device.
Definition: raindetector.cpp:37
ILight
One light descriptor.
RainDetector::getDefaultName
const char * getDefaultName() override
Definition: raindetector.cpp:46
defaultdevice.h
RainDetector::RainDetector
RainDetector()=default
RainDetector::Connect
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: raindetector.cpp:28
RainDetector::ISNewSwitch
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: raindetector.cpp:97
ISState
ISState
Switch state.
Definition: indiapi.h:148
INDI::DefaultDevice
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
Definition: defaultdevice.h:118
RainDetector::updateProperties
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: raindetector.cpp:74
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365