Instrument Neutral Distributed Interface INDI 2.2.5
lx200apdriver.h
Go to the documentation of this file.
1/*
2 LX200 AP Driver
3 Copyright (C) 2007 Markus Wildi
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
23// Used by cp2 driver
24#define setAPPark(fd) write(fd, "#:KA#", 4)
25#define setAPUnPark(fd) write(fd, "#:PO#", 4)
26
27// Used by several drivers
28#define getAPVersionNumber(fd, x) getCommandString(fd, x, "#:V#")
29#define setAPClearBuffer(fd) write(fd, "#", 1) /* AP key pad manual startup sequence */
30#define setAPBackLashCompensation(fd, x, y, z) setCommandXYZ(fd, x, y, z, "#:Br")
31
32#define AP_TRACKING_SIDEREAL 0
33#define AP_TRACKING_SOLAR 1
34#define AP_TRACKING_LUNAR 2
35#define AP_TRACKING_CUSTOM 3
36#define AP_TRACKING_OFF 4
37
38#define AP_PEC_OFF 0
39#define AP_PEC_ON 1
40#define AP_PEC_RECORD 2
41#define AP_PEC_ENCODER 3
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47void set_lx200ap_name(const char *deviceName, unsigned int debug_level);
49int getAPUTCOffset(int fd, double *value);
50int setAPObjectAZ(int fd, double az);
51int setAPObjectAlt(int fd, double alt);
52int setAPUTCOffset(int fd, double hours);
53int setAPSlewMode(int fd, int slewMode);
54int APSyncCM(int fd, char *matchedObject);
55int APSyncCMR(int fd, char *matchedObject);
56
65
66// Rate selection for legacy drivers
67int selectAPMoveToRate(int fd, int moveToIndex);
68int selectAPSlewRate(int fd, int slewIndex);
69int selectAPCenterRate(int fd, int centerIndex);
70// Support rate tables in newer drivers
71int selectAPV2CenterRate(int fd, int centerIndex, APRateTableState rateTable);
72
73int selectAPTrackingMode(int fd, int trackMode);
74int selectAPGuideRate(int fd, int guideRate);
75int selectAPPECState(int fd, int pecstate);
76int swapAPButtons(int fd, int currentSwap);
77int setAPObjectRA(int fd, double ra);
78int setAPObjectDEC(int fd, double dec);
79int setAPSiteLongitude(int fd, double Long);
80int setAPSiteLatitude(int fd, double Lat);
81int setAPRATrackRate(int fd, double rate);
82int setAPDETrackRate(int fd, double rate);
83int APSendPulseCmd(int fd, int direction, int duration_msec);
84void set_lx200ap_exp_name(const char *deviceName, unsigned int debug_level);
85int check_lx200ap_status(int fd, char *parkStatus, char *slewStatus);
86int APParkMount(int fd);
87int APUnParkMount(int fd);
88int getAPWormPosition(int fd, int *position);
89
90// Make sure the buffer passed in to getApStatusString (statusString) is at least 32 bytes.
91int getApStatusString(int fd, char *statusString);
92bool apStatusParked(const char *statusString);
93bool apStatusSlewing(const char *statusString);
94const char *apMountStatus(const char *statusString);
95int isAPInitialized(int fd, bool *isInitialized);
96
97APRateTableState apRateTable(const char *statusString);
98int getApMountFeatures(int fd, bool *hasEncoder, bool *clutchAware);
99bool apCanHome(int fd);
100int apHomeAndSync(int fd);
101
102#ifdef __cplusplus
103}
104#endif
double ra
double dec
int fd
int selectAPMoveToRate(int fd, int moveToIndex)
bool apStatusParked(const char *statusString)
APRateTableState
@ AP_RATE_TABLE_1
@ AP_RATE_TABLE_2
@ AP_RATE_TABLE_DEFAULT
@ AP_RATE_TABLE_3
@ AP_RATE_TABLE_0
int check_lx200ap_connection(int fd)
int setAPUTCOffset(int fd, double hours)
int setAPSiteLatitude(int fd, double Lat)
int getAPWormPosition(int fd, int *position)
void set_lx200ap_name(const char *deviceName, unsigned int debug_level)
int setAPRATrackRate(int fd, double rate)
int apHomeAndSync(int fd)
int setAPObjectRA(int fd, double ra)
int APSyncCMR(int fd, char *matchedObject)
int setAPObjectAlt(int fd, double alt)
int swapAPButtons(int fd, int currentSwap)
int setAPObjectDEC(int fd, double dec)
int isAPInitialized(int fd, bool *isInitialized)
int APSendPulseCmd(int fd, int direction, int duration_msec)
void set_lx200ap_exp_name(const char *deviceName, unsigned int debug_level)
int selectAPCenterRate(int fd, int centerIndex)
int APParkMount(int fd)
int selectAPSlewRate(int fd, int slewIndex)
const char * apMountStatus(const char *statusString)
int getApStatusString(int fd, char *statusString)
int check_lx200ap_status(int fd, char *parkStatus, char *slewStatus)
int APUnParkMount(int fd)
bool apCanHome(int fd)
int selectAPPECState(int fd, int pecstate)
int selectAPGuideRate(int fd, int guideRate)
APRateTableState apRateTable(const char *statusString)
int setAPObjectAZ(int fd, double az)
int APSyncCM(int fd, char *matchedObject)
int getApMountFeatures(int fd, bool *hasEncoder, bool *clutchAware)
int getAPUTCOffset(int fd, double *value)
int setAPSlewMode(int fd, int slewMode)
int setAPDETrackRate(int fd, double rate)
bool apStatusSlewing(const char *statusString)
int setAPSiteLongitude(int fd, double Long)
int selectAPV2CenterRate(int fd, int centerIndex, APRateTableState rateTable)
int selectAPTrackingMode(int fd, int trackMode)