Instrument Neutral Distributed Interface INDI 2.2.5
magellandriver.h
Go to the documentation of this file.
1/*
2 MAGELLAN Driver
3 Copyright (C) 2011 Onno Hommes ([email protected])
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,
18 Boston, MA 02110-1301 USA
19
20*/
21
22#pragma once
23
24/* Just use Default tracking for what ever telescope is feeding Magellan I */
31
32/* Time Format */
39
40#define MAGELLAN_TIMEOUT 5 /* FD timeout in seconds */
41#define MAGELLAN_ERROR -1 /* Default Error Code */
42#define MAGELLAN_OK 0 /* Default Success Code */
43#define MAGELLAN_ACK 'P' /* Default Success Code */
44
45#define CENTURY_THRESHOLD 91 /* When to goto 21st Century */
46#define CONNECTION_RETRIES 2 /* Retry Attempt cut-off */
47
48/* GET formatted sexagisemal value from device, return as double */
49#define getMAGELLANRA(fd, x) getCommandSexa(fd, x, "#:GR#")
50#define getMAGELLANDEC(fd, x) getCommandSexa(fd, x, "#:GD#")
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56/**************************************************************************
57 Diagnostics
58 **************************************************************************/
59char ACK(int fd);
61
62/**************************************************************************
63 Get Commands: store data in the supplied buffer. Return 0 on success or -1
64 on failure
65 **************************************************************************/
66
67/* Get Double from Sexagisemal */
68int getCommandSexa(int fd, double *value, const char *cmd);
69
70/* Get Calendar data */
71int getCalendarDate(int fd, char *date);
72
73#ifdef __cplusplus
74}
75#endif
int fd
TTimeFormat
Definition lx200driver.h:63
TFreq
int check_magellan_connection(int fd)
@ MAGELLAN_AM
@ MAGELLAN_PM
@ MAGELLAN_24
@ MAGELLAN_TRACK_MANUAL
@ MAGELLAN_TRACK_DEFAULT
@ MAGELLAN_TRACK_LUNAR
int getCommandSexa(int fd, double *value, const char *cmd)
int getCalendarDate(int fd, char *date)
uint8_t cmd[4]
Definition pwc-ioctl.h:2
#define ACK
Definition stvdriver.h:35