Instrument Neutral Distributed Interface INDI 2.2.5
wanderer_snowflake.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2026 Jérémie Klein. All rights reserved.
3 Copyright(c) 2026 WandererAstro. All rights reserved. (modifications)
4
5 Wanderer Snowflake Filter Wheel Driver
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License version 2 as published by the Free Software Foundation.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*******************************************************************************/
21
22#pragma once
23
24#include "indifilterwheel.h"
25
27{
28 public:
30
31 protected:
32
33 const char *getDefaultName() override;
34 bool initProperties() override;
35 bool updateProperties() override;
36 bool Handshake() override;
37 bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) 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 saveConfigItems(FILE *fp) override;
43
44 private:
45 bool readCurrentFilterFromStatus(int &position);
46 bool sendCommand(const char *command, char *response, int responseLen, int timeoutSeconds);
47 bool sendAutomaticCalibration();
48 bool sendZeroDetection();
49
50 ISwitch CalibrationCmdS[2] {};
51 ISwitchVectorProperty CalibrationCmdSP {};
52
53 int mDeviceID {0};
54 INumber DeviceIDN[1] {};
55 INumberVectorProperty DeviceIDNP {};
56
57 char mModel[16] {};
58 char mFirmware[16] {};
59 IText DeviceInfoT[2] {};
60 ITextVectorProperty DeviceInfoTP {};
61};
62
63
const char * getDefaultName() override
int QueryFilter() override
Return current filter position.
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool SelectFilter(int position) override
Select a new filter position.
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
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
ISState
Switch state.
Definition indiapi.h:148
One number descriptor.
One switch descriptor.
One text descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Switch vector property descriptor.
Definition indiapi.h:365
Text vector property descriptor.
Definition indiapi.h:244