Instrument Neutral Distributed Interface INDI  1.9.2
raindetector.h
Go to the documentation of this file.
1 /*
2  INDI Developers Manual
3  Tutorial #5 - Snooping
4 
5  Rain Detector
6 
7  Refer to README, which contains instruction on how to build this driver, and use it
8  with an INDI-compatible client.
9 
10 */
11 
21 #pragma once
22 
23 #include "defaultdevice.h"
24 
26 {
27 public:
28  RainDetector() = default;
29 
30 protected:
31  // General device functions
32  bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
33  bool Connect() override;
34  bool Disconnect() override;
35  const char *getDefaultName() override;
36  bool initProperties() override;
37  bool updateProperties() override;
38 
39 private:
40  ILight RainL[1];
41  ILightVectorProperty RainLP;
42 
43  ISwitch RainS[2];
44  ISwitchVectorProperty RainSP;
45 };
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