Instrument Neutral Distributed Interface INDI 2.2.5
giotto.h
Go to the documentation of this file.
1/*
2 Giotto driver
3 Copyright (C) 2023 Jasem Mutlaq
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
24#include "defaultdevice.h"
25#include "../focuser/primalucacommandset.h"
26
28{
29 public:
30 GIOTTO();
31 virtual ~GIOTTO();
32
33 const char *getDefaultName() override;
34 virtual void ISGetProperties(const char *dev) override;
35 virtual bool initProperties() override;
36 virtual bool updateProperties() override;
37
38 virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
39 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
40 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
41 virtual bool ISSnoopDevice(XMLEle *root) override;
42
43 protected:
44 bool Handshake();
45
46 bool Disconnect() override;
47
48 // From Light Box
49 virtual bool SetLightBoxBrightness(uint16_t value) override;
50 virtual bool EnableLightBox(bool enable) override;
51
52 virtual bool saveConfigItems(FILE *fp) override;
53
54
55 private:
56 Connection::Serial *serialConnection{ nullptr };
57 int PortFD{ -1 };
58 std::unique_ptr<PrimalucaLabs::GIOTTO> m_GIOTTO;
59};
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
Definition giotto.cpp:43
virtual bool SetLightBoxBrightness(uint16_t value) override
setBrightness Set light level. Must be implemented in the child class, if supported.
Definition giotto.cpp:178
virtual ~GIOTTO()
Definition giotto.cpp:34
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition giotto.cpp:135
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
Definition giotto.cpp:168
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
Definition giotto.cpp:78
virtual bool EnableLightBox(bool enable) override
EnableLightBox Turn on/off on a light box. Must be implemented in the child class.
Definition giotto.cpp:186
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition giotto.cpp:68
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
Definition giotto.cpp:194
const char * getDefaultName() override
Definition giotto.cpp:127
bool Disconnect() override
Disconnect from device.
Definition giotto.cpp:89
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
Definition giotto.cpp:146
bool Handshake()
Definition giotto.cpp:98
GIOTTO()
Definition giotto.cpp:29
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition giotto.cpp:157
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
ISState
Switch state.
Definition indiapi.h:148