Instrument Neutral Distributed Interface INDI 2.2.5
indidustcapinterface.h
Go to the documentation of this file.
1/*
2 Dust Cap Interface
3 Copyright (C) 2015-2025 Jasem Mutlaq ([email protected])
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#include "indipropertyswitch.h"
26#include <cstdint>
27
38// Alias
40namespace INDI
41{
42
44{
45 public:
46 enum
47 {
50 };
51
52 enum
53 {
54 CAN_ABORT = 1 << 0,
56 CAN_SET_LIMITS = 1 << 2,
58
59 protected:
61 virtual ~DustCapInterface() = default;
62
67 virtual IPState ParkCap();
68
73 virtual IPState UnParkCap();
74
79 virtual IPState AbortCap();
80
85 void initProperties(const char *group, uint32_t capabilities = 0);
86
91 bool updateProperties();
92
94 bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
95
96 // Open/Close cover
98 // Abort Motion
100
101 private:
102 DefaultDevice *m_DefaultDevice { nullptr };
103 uint32_t m_Capabilities {0};
104};
105}
hid_device * device
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
virtual IPState ParkCap()
Park dust cap (close cover). Must be implemented by child.
virtual ~DustCapInterface()=default
INDI::PropertySwitch ParkCapSP
virtual IPState AbortCap()
Abort motion. Must be implemented by child.
enum INDI::DustCapInterface::@445 DustCapCapability
virtual IPState UnParkCap()
unPark dust cap (open cover). Must be implemented by child.
bool updateProperties()
updateProperties Defines or Delete properties based on default device connection status
INDI::PropertySwitch AbortCapSP
void initProperties(const char *group, uint32_t capabilities=0)
Initialize dust cap properties. It is recommended to call this function within initProperties() of yo...
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process dust cap switch properties.
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158
Namespace to encapsulate INDI client, drivers, and mediator classes.