Instrument Neutral Distributed Interface INDI 2.2.5
dust_cover_simulator.h
Go to the documentation of this file.
1/*******************************************************************************
2 Dust Cover Simulator
3
4 SPDX-FileCopyrightText: 2025 Jasem Mutlaq
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*******************************************************************************/
7
8#pragma once
9
10#include "defaultdevice.h"
12
14{
15 public:
17 virtual ~DustCoverSimulator() override = default;
18
19 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
20 bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
21
22 protected:
23 bool initProperties() override;
24 bool updateProperties() override;
25 bool saveConfigItems(FILE *fp) override;
26
27 bool Connect() override
28 {
29 return true;
30 }
31 bool Disconnect() override
32 {
33 return true;
34 }
35 const char *getDefaultName() override
36 {
37 return "Dust Cover Simulator";
38 }
39
40 // From Dust Cap Interface
41 virtual IPState ParkCap() override;
42 virtual IPState UnParkCap() override;
43
44 private:
45 // Duration of park/unpark operations
46 INDI::PropertyNumber OperationDurationNP {1};
47};
virtual ~DustCoverSimulator() override=default
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual IPState ParkCap() override
Park dust cap (close cover). Must be implemented by child.
virtual IPState UnParkCap() override
unPark dust cap (open cover). Must be implemented by child.
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
const char * getDefaultName() override
bool Disconnect() override
Disconnect from device.
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
ISState
Switch state.
Definition indiapi.h:148
IPState
Property state.
Definition indiapi.h:158