Instrument Neutral Distributed Interface INDI 2.2.5
indilightboxinterface.h
Go to the documentation of this file.
1/*
2 Light Box / Switch Interface
3 Copyright (C) 2015 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 "indipropertynumber.h"
25#include "indipropertyswitch.h"
26#include "indipropertytext.h"
27
28#include <stdint.h>
29
47// Alias
49
50namespace INDI
51{
52
54{
55 public:
56 enum
57 {
60 };
61
62 enum
63 {
64 CAN_DIM = 1 << 0,
66
67 protected:
69 virtual ~LightBoxInterface();
70
75 void initProperties(const char *group, uint32_t capabilities);
76
81 void ISGetProperties(const char *deviceName);
82
84 bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
85
87 bool processNumber(const char *dev, const char *name, double values[], char *names[], int n);
88
90 bool processText(const char *dev, const char *name, char *texts[], char *names[], int n);
91
92 bool updateProperties();
93 bool saveConfigItems(FILE *fp);
94 bool snoop(XMLEle *root);
95
101 virtual bool SetLightBoxBrightness(uint16_t value);
102
108 virtual bool EnableLightBox(bool enable);
109
110 // Turn on/off light
112
113 // Light Intensity
115
116 // Active devices to snoop
118
120
121 private:
122 void addFilterDuration(const char *filterName, uint16_t filterDuration);
123
124 DefaultDevice *m_DefaultDevice {nullptr};
125 uint8_t currentFilterSlot {0};
126 uint32_t m_Capabilities {0};
127};
128}
hid_device * device
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
void initProperties(const char *group, uint32_t capabilities)
Initialize light box properties. It is recommended to call this function within initProperties() of y...
void ISGetProperties(const char *deviceName)
isGetLightBoxProperties Get light box properties
enum INDI::LightBoxInterface::@455 LightBoxCapability
INDI::PropertyText ActiveDeviceTP
INDI::PropertyNumber LightIntensityNP
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process light box switch properties.
virtual bool EnableLightBox(bool enable)
EnableLightBox Turn on/off on a light box. Must be implemented in the child class.
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process light box text properties.
virtual bool SetLightBoxBrightness(uint16_t value)
setBrightness Set light level. Must be implemented in the child class, if supported.
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process light box number properties.
INDI::PropertyNumber FilterIntensityNP
ISState
Switch state.
Definition indiapi.h:148
Namespace to encapsulate INDI client, drivers, and mediator classes.