Instrument Neutral Distributed Interface INDI  2.0.2
indidustcapinterface.h
Go to the documentation of this file.
1 /*
2  Dust Cap Interface
3  Copyright (C) 2015 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #pragma once
22 
23 #include "indibase.h"
24 #include "indidriver.h"
25 
35 namespace INDI
36 {
37 
39 {
40  public:
41  enum
42  {
45  };
46 
47  protected:
48  DustCapInterface() = default;
49  virtual ~DustCapInterface() = default;
50 
55  virtual IPState ParkCap();
56 
61  virtual IPState UnParkCap();
62 
67  void initDustCapProperties(const char *deviceName, const char *groupName);
68 
70  bool processDustCapSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
71 
72  // Open/Close cover
75 
76  private:
77  char dustCapName[MAXINDIDEVICE];
78 };
79 }
void initDustCapProperties(const char *deviceName, const char *groupName)
Initilize dust cap properties. It is recommended to call this function within initProperties() of you...
virtual IPState ParkCap()
Park dust cap (close cover). Must be implemented by child.
virtual ~DustCapInterface()=default
bool processDustCapSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process dust cap switch properties.
ISwitchVectorProperty ParkCapSP
virtual IPState UnParkCap()
unPark dust cap (open cover). Must be implemented by child.
ISState
Switch state.
Definition: indiapi.h:150
#define MAXINDIDEVICE
Definition: indiapi.h:193
IPState
Property state.
Definition: indiapi.h:160
Namespace to encapsulate INDI client, drivers, and mediator classes.
One switch descriptor.
Switch vector property descriptor.
Definition: indiapi.h:367