Instrument Neutral Distributed Interface INDI 2.2.5
light_panel_simulator.h
Go to the documentation of this file.
1/*******************************************************************************
2 Light Panel Simulator
3
4 SPDX-FileCopyrightText: 2021 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 ~LightPanelSimulator() override = default;
18
19 void ISGetProperties(const char *dev) override;
20
21 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
22 bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
23 bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
24 bool ISSnoopDevice(XMLEle *root) override;
25
26 protected:
27
28 bool initProperties() override;
29 bool updateProperties() override;
30 bool saveConfigItems(FILE *fp) override;
31
32 bool Connect() override
33 {
34 return true;
35 }
36 bool Disconnect() override
37 {
38 return true;
39 }
40 const char *getDefaultName() override
41 {
42 return "Light Panel Simulator";
43 }
44
45 // From Light Box
46 virtual bool SetLightBoxBrightness(uint16_t value) override;
47 virtual bool EnableLightBox(bool enable) override;
48};
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool SetLightBoxBrightness(uint16_t value) override
setBrightness Set light level. Must be implemented in the child class, if supported.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
bool Disconnect() override
Disconnect from device.
bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
const char * getDefaultName() override
virtual bool EnableLightBox(bool enable) override
EnableLightBox Turn on/off on a light box. Must be implemented in the child class.
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.
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual ~LightPanelSimulator() override=default
ISState
Switch state.
Definition indiapi.h:148