Instrument Neutral Distributed Interface INDI 2.2.5
lx200_esp32go.h
Go to the documentation of this file.
1/*
2 LX200 esp32go
3 based on LX200 generic with some bits from LX200_onStep driver
4
5 Copyright (C) 2003 Jasem Mutlaq ([email protected])
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21*/
22
23#pragma once
24
25#include "lx200generic.h"
26
27#include "lx200driver.h"
28#include "indicom.h"
31
32
33#include <cstring>
34#include <unistd.h>
35#include <termios.h>
36#include <stdlib.h>
37
38#define RBB_MAX_LEN 256
39#define CMDB_MAX_LEN 32
40
42{
43 public:
46
47 const char *getDefaultName() override;
48 bool initProperties() override;
49 bool updateProperties() override;
50 void ISGetProperties(const char *dev) override;
51 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
52
53 protected:
54
55 virtual bool UnPark() override;
56 virtual bool Park() override;
57 virtual bool ReadScopeStatus() override;
58 virtual void getBasicData() override;
59 virtual bool SetTrackEnabled(bool enabled) override;
60 virtual bool SetTrackMode(uint8_t mode) override;
61 virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override;
62
63 bool goHome();
64 bool setHome();
65
68
69 bool guideUpdate = false; // support for :cg# / :cj# commands
70 bool trackmodeUpdate = false; //
71 bool picgotoMode = false; // old boards
72 bool activeFocus = true; // support for stepper focuser
73 bool canGetStatus = false; // support for status (:GU#) and trackMode (:T*#) commands
81
82 long int OSTimeoutSeconds = 0;
83 long int OSTimeoutMicroSeconds = 100000;
84 long int longPollCounter = 0;
85 long int longPollCycle = 30;
86
87 int flushIO(int fd); // copied from LX200_OnStep driver
88 int getCommandSingleCharErrorOrLongResponse(int fd, char *data, const char *cmd, bool shortTimeout); // copied from LX200_OnStep driver
89 bool sendCommandBlind(const char *cmd); // copied from LX200_OnStep driver
90 int getCommandSingleCharResponse(int fd, char *data, const char *cmd);
91 void splitString(const char *str, char array[][100], int *count);
92
93 // ------------ FocuserInterface
94 IPState MoveAbsFocuser (uint32_t targetTicks) override;
95 IPState MoveRelFocuser (FocusDirection dir, uint32_t ticks) override;
96 bool AbortFocuser () override;
97 int UpdateFocuser(); //Return = 0 good, -1 = Communication error
98
99};
void splitString(const char *str, char array[][100], int *count)
IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
const char * getDefaultName() override
IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
bool initProperties() override
Called to initialize basic properties required all the time.
long int OSTimeoutMicroSeconds
long int longPollCounter
INDI::PropertyText VersionTP
bool sendCommandBlind(const char *cmd)
int getCommandSingleCharResponse(int fd, char *data, const char *cmd)
virtual void getBasicData() override
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
int flushIO(int fd)
bool AbortFocuser() override
AbortFocuser all focus motion.
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
int getCommandSingleCharErrorOrLongResponse(int fd, char *data, const char *cmd, bool shortTimeout)
virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override
Execute a homing action.
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool UnPark() override
Unpark the telescope if already parked.
INDI::PropertyNumber GuideRateNP
bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
long int longPollCycle
long int OSTimeoutSeconds
virtual bool Park() override
Park the telescope to its home position.
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
IPState
Property state.
Definition indiapi.h:158
Implementations for common driver routines.
int fd
uint8_t cmd[4]
Definition pwc-ioctl.h:2