Instrument Neutral Distributed Interface INDI  1.9.5
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 
34 namespace INDI
35 {
36 
38 {
39  public:
40  enum
41  {
44  };
45 
46  protected:
47  DustCapInterface() = default;
48  virtual ~DustCapInterface() = default;
49 
54  virtual IPState ParkCap();
55 
60  virtual IPState UnParkCap();
61 
66  void initDustCapProperties(const char *deviceName, const char *groupName);
67 
69  bool processDustCapSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
70 
71  // Open/Close cover
74 
75  private:
76  char dustCapName[MAXINDIDEVICE];
77 };
78 }
MAXINDIDEVICE
#define MAXINDIDEVICE
Definition: indiapi.h:192
INDI::DustCapInterface::CAP_PARK
@ CAP_PARK
Definition: indidustcapinterface.h:42
indibase.h
IPState
IPState
Property state.
Definition: indiapi.h:158
ISwitch
One switch descriptor.
INDI::DustCapInterface::UnParkCap
virtual IPState UnParkCap()
unPark dust cap (open cover). Must be implemented by child.
Definition: indidustcapinterface.cpp:72
INDI::DustCapInterface
Definition: indidustcapinterface.h:37
INDI::DustCapInterface::ParkCapSP
ISwitchVectorProperty ParkCapSP
Definition: indidustcapinterface.h:72
INDI::DustCapInterface::initDustCapProperties
void initDustCapProperties(const char *deviceName, const char *groupName)
Initilize dust cap properties. It is recommended to call this function within initProperties() of you...
Definition: indidustcapinterface.cpp:28
INDI::DustCapInterface::~DustCapInterface
virtual ~DustCapInterface()=default
INDI::DustCapInterface::ParkCapS
ISwitch ParkCapS[2]
Definition: indidustcapinterface.h:73
INDI::DustCapInterface::DustCapInterface
DustCapInterface()=default
INDI::DustCapInterface::CAP_UNPARK
@ CAP_UNPARK
Definition: indidustcapinterface.h:43
name
const char * name
Definition: indiserver.c:116
INDI::DustCapInterface::ParkCap
virtual IPState ParkCap()
Park dust cap (close cover). Must be implemented by child.
Definition: indidustcapinterface.cpp:66
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::DustCapInterface::processDustCapSwitch
bool processDustCapSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process dust cap switch properties.
Definition: indidustcapinterface.cpp:39
ISState
ISState
Switch state.
Definition: indiapi.h:148
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365