Instrument Neutral Distributed Interface INDI 2.2.5
rasa_filtercube.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2026 WandererAstro. All rights reserved.
3
4 RASA FilterCube Filter Wheel Driver
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
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 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*******************************************************************************/
20
21#pragma once
22
23#include "indifilterwheel.h"
24
25static constexpr int FILTERCUBE_MAX_FILTERS = 5;
26
28{
29 public:
31
32 protected:
33
34 const char *getDefaultName() override;
35 bool initProperties() override;
36 bool updateProperties() override;
37 bool Handshake() override;
38 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
39
40 int QueryFilter() override;
41 bool SelectFilter(int position) override;
42 bool GetFilterNames() override;
43 bool SetFilterNames() override;
44
45 private:
46 bool readCurrentFilterFromStatus(int &position);
47 bool sendCommand(const char *command, char *response, int responseLen, int timeoutSeconds);
48
49 char mFirmware[32] {};
50 char mModel[16] {};
51 int mDeviceID {0};
52 char mFilterLetters[FILTERCUBE_MAX_FILTERS] {};
53
54 INumber DeviceIDN[1] {};
55 INumberVectorProperty DeviceIDNP {};
56
57 IText DeviceInfoT[2] {};
58 ITextVectorProperty DeviceInfoTP {};
59};
60
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
bool Handshake() override
perform handshake with device to check communication
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool GetFilterNames() override
Obtains a list of filter names from the hardware and initializes the FilterNameTP property....
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool SelectFilter(int position) override
Select a new filter position.
bool SetFilterNames() override
Set filter names as defined by the client for each filter position. The desired filter names are stor...
const char * getDefaultName() override
int QueryFilter() override
Return current filter position.
One number descriptor.
One text descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Text vector property descriptor.
Definition indiapi.h:244