66 virtual ~OAPA()
override =
default;
70 bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
71 bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
100 char version[16] {0};
104 bool sendCommand(
const char *
cmd,
char *res);
110 bool queryStatus(Status &status);
113 static bool parseStatus(
const char *line, Status &status);
116 bool sendDriverSetting(
char type,
int axis,
double value);
119 bool pushDriverConfig();
124 IPState startMove(
double azDegrees,
double altDegrees);
127 double degreesToSteps(
double degrees,
int axis);
129 bool isReversed(
int axis);
130 void updatePosition(
const Status &status);
131 void checkMove(
const Status &status);
132 void finishMove(
IPState state,
const char *message);
159 using Clock = std::chrono::steady_clock;
161 bool m_MoveActive {
false};
162 double m_TargetX {0}, m_TargetY {0};
163 double m_LastX {0}, m_LastY {0};
164 Clock::time_point m_LastProgress;
165 Clock::time_point m_Deadline;
174 static constexpr int DRIVER_TIMEOUT {2};
175 static constexpr int DRIVER_LEN {128};
176 static constexpr char DRIVER_STOP_CHAR {
'\n'};
177 static constexpr int HANDSHAKE_ATTEMPTS {6};
178 static constexpr int DEFAULT_TCP_PORT {2323};
179 static constexpr int MIN_SPEED {50};
180 static constexpr int MAX_SPEED {3000};
181 static constexpr int DEFAULT_SPEED {1000};
182 static constexpr int MIN_RUN_CURRENT {100};
183 static constexpr int MAX_RUN_CURRENT {2000};
184 static constexpr int DEFAULT_RUN_CURRENT {600};
185 static constexpr int DEFAULT_HOLD_PERCENT {25};
186 static constexpr double ACCELERATION {1000};
187 static constexpr double POSITION_TOLERANCE {1.0};
188 static constexpr double STALL_SECONDS {3.0};
The Serial class manages connection with serial devices including Bluetooth. Serial communication is ...
The TCP class manages connection with devices over the network via TCP/IP. Upon successful connection...
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
The OAPA class drives an Open Automatic Polar Alignment platform running the OAPA reference firmware ...
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual ~OAPA() override=default
bool ReverseALT(bool enabled) override
ReverseALT Reverse the direction of altitude axis movement.
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
IPState MoveAZ(double degrees) override
Motion.
IPState MoveALT(double degrees) override
MoveALT Move the altitude axis by the given number of degrees.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
bool AbortMotion() override
AbortMotion Abort all axis motion immediately.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
bool ReverseAZ(bool enabled) override
ReverseAZ Reverse the direction of azimuth axis movement.
IPState MoveBoth(double azDegrees, double altDegrees) override
MoveBoth Move both axes in a single coordinated operation.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
const char * getDefaultName() override
Combines all INDI Connection Plugins. Each INDI connection plugin is responsible of managing communic...