Instrument Neutral Distributed Interface INDI  1.6.0
indiapi.h
Go to the documentation of this file.
1 #if 0
2 INDI
3 Copyright (C) 2003 Elwood C. Downey
4 
5 This library is free software;
6 you can redistribute it and / or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation;
9 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;
14 without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library;
20 if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
22 
23 #endif
24 
25 #pragma once
26 
114 /*******************************************************************************
115  * INDI wire protocol version implemented by this API.
116  * N.B. this is indepedent of the API itself.
117  */
118 
119 #define INDIV 1.7
120 
121 /* INDI Library version */
122 #define INDI_VERSION_MAJOR 1
123 #define INDI_VERSION_MINOR 5
124 #define INDI_VERSION_RELEASE 0
125 
126 /*******************************************************************************
127  * Manifest constants
128  */
129 
134 typedef enum {
135  ISS_OFF = 0,
137 } ISState;
138 
143 typedef enum {
144  IPS_IDLE = 0,
148 } IPState;
149 
154 typedef enum {
158 } ISRule;
159 
164 typedef enum {
168 } IPerm;
169 
170 // The XML strings for these attributes may be any length but implementations
171 // are only obligued to support these lengths for the various string attributes.
172 #define MAXINDINAME 64
173 #define MAXINDILABEL 64
174 #define MAXINDIDEVICE 64
175 #define MAXINDIGROUP 64
176 #define MAXINDIFORMAT 64
177 #define MAXINDIBLOBFMT 64
178 #define MAXINDITSTAMP 64
179 #define MAXINDIMESSAGE 255
180 
181 /*******************************************************************************
182  * Typedefs for each INDI Property type.
183  *
184  * INumber.format may be any printf-style appropriate for double
185  * or style "m" to create sexigesimal using the form "%<w>.<f>m" where
186  * <w> is the total field width.
187  * <f> is the width of the fraction. valid values are:
188  * 9 -> :mm:ss.ss
189  * 8 -> :mm:ss.s
190  * 6 -> :mm:ss
191  * 5 -> :mm.m
192  * 3 -> :mm
193  *
194  * examples:
195  *
196  * to produce use
197  *
198  * "-123:45" %7.3m
199  * " 0:01:02" %9.6m
200  */
201 
206 typedef struct
207 {
211  char label[MAXINDILABEL];
213  char *text;
217  void *aux0;
219  void *aux1;
220 } IText;
221 
226 typedef struct _ITextVectorProperty
227 {
239  double timeout;
245  int ntp;
249  void *aux;
251 
256 typedef struct
257 {
263  char format[MAXINDIFORMAT];
265  double min;
267  double max;
269  double step;
271  double value;
275  void *aux0;
277  void *aux1;
278 } INumber;
279 
300 {
312  double timeout;
318  int nnp;
322  void *aux;
324 
329 typedef struct
330 {
340  void *aux;
341 } ISwitch;
342 
348 {
362  double timeout;
368  int nsp;
372  void *aux;
374 
379 typedef struct
380 {
390  void *aux;
391 } ILight;
392 
397 typedef struct _ILightVectorProperty
398 {
412  int nlp;
416  void *aux;
418 
423 typedef struct /* one BLOB descriptor */
424 {
430  char format[MAXINDIBLOBFMT];
432  void *blob;
434  int bloblen;
436  int size;
440  void *aux0;
442  void *aux1;
444  void *aux2;
445 } IBLOB;
446 
451 typedef struct _IBLOBVectorProperty /* BLOB vector property descriptor */
452 {
464  double timeout;
470  int nbp;
474  void *aux;
476 
481 #define NARRAY(a) (sizeof(a) / sizeof(a[0]))
struct _IBLOBVectorProperty IBLOBVectorProperty
void * aux0
Definition: indiapi.h:217
void * aux0
Definition: indiapi.h:440
struct _ISwitchVectorProperty * svp
Definition: indiapi.h:338
struct _ITextVectorProperty * tvp
Definition: indiapi.h:215
void * aux1
Definition: indiapi.h:277
Light vector property descriptor.
Definition: indiapi.h:397
void * aux
Definition: indiapi.h:340
char device[MAXINDIDEVICE]
Definition: indiapi.h:229
#define MAXINDINAME
Definition: indiapi.h:172
char * text
Definition: indiapi.h:213
ISState s
Definition: indiapi.h:336
#define MAXINDIDEVICE
Definition: indiapi.h:174
double step
Definition: indiapi.h:269
IPState
Property state.
Definition: indiapi.h:143
One light descriptor.
Definition: indiapi.h:379
#define MAXINDIGROUP
Definition: indiapi.h:175
One number descriptor.
Definition: indiapi.h:256
#define MAXINDITSTAMP
Definition: indiapi.h:178
One Blob (Binary Large Object) descriptor.
Definition: indiapi.h:423
Definition: indiapi.h:166
#define MAXINDIBLOBFMT
Definition: indiapi.h:177
Definition: indiapi.h:165
int size
Definition: indiapi.h:436
IPState s
Definition: indiapi.h:386
Definition: indiapi.h:167
const char * name
Definition: indiserver.c:113
struct _IBLOBVectorProperty * bvp
Definition: indiapi.h:438
Switch vector property descriptor.
Definition: indiapi.h:347
Namespace to encapsulate INDI client, drivers, and mediator classes. Developers can subclass the base...
struct _INumberVectorProperty INumberVectorProperty
int bloblen
Definition: indiapi.h:434
One switch descriptor.
Definition: indiapi.h:329
struct _ILightVectorProperty * lvp
Definition: indiapi.h:388
struct _INumberVectorProperty * nvp
Definition: indiapi.h:273
char label[MAXINDILABEL]
Definition: indiapi.h:233
void * aux2
Definition: indiapi.h:444
struct _ISwitchVectorProperty ISwitchVectorProperty
BLOB (Binary Large Object) vector property descriptor.
Definition: indiapi.h:451
void * blob
Definition: indiapi.h:432
Number vector property descriptor.
Definition: indiapi.h:299
One text descriptor.
Definition: indiapi.h:206
struct _ILightVectorProperty ILightVectorProperty
#define MAXINDIFORMAT
Definition: indiapi.h:176
double min
Definition: indiapi.h:265
void * aux1
Definition: indiapi.h:442
char name[MAXINDINAME]
Definition: indiapi.h:231
void * aux1
Definition: indiapi.h:219
double max
Definition: indiapi.h:267
void * aux0
Definition: indiapi.h:275
IPerm
Permission hint, with respect to client.
Definition: indiapi.h:164
ISState
Switch state.
Definition: indiapi.h:134
char timestamp[MAXINDITSTAMP]
Definition: indiapi.h:247
struct _ITextVectorProperty ITextVectorProperty
#define MAXINDILABEL
Definition: indiapi.h:173
Text vector property descriptor.
Definition: indiapi.h:226
void * aux
Definition: indiapi.h:390
ISRule
Switch vector rule hint.
Definition: indiapi.h:154
char group[MAXINDIGROUP]
Definition: indiapi.h:235
double value
Definition: indiapi.h:271