Instrument Neutral Distributed Interface INDI  2.0.2
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"
11 #include "indilightboxinterface.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 
25  protected:
26 
27  bool initProperties() override;
28  bool updateProperties() override;
29 
30  bool Connect() override
31  {
32  return true;
33  }
34  bool Disconnect() override
35  {
36  return true;
37  }
38  const char *getDefaultName() override
39  {
40  return "Light Panel Simulator";
41  }
42 
43  // From Light Box
44  virtual bool SetLightBoxBrightness(uint16_t value) override;
45  virtual bool EnableLightBox(bool enable) override;
46 };
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....
const char * getDefaultName() override
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 impelemented 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.
virtual bool EnableLightBox(bool enable) override
EnableLightBox Turn on/off on a light box. Must be impelemented 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
Initilize 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:150