Instrument Neutral Distributed Interface INDI  1.7.6
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 
125 /*******************************************************************************
126  * INDI wire protocol version implemented by this API.
127  * N.B. this is indepedent of the API itself.
128  */
129 
130 #define INDIV 1.7
131 
132 /* INDI Library version */
133 #define INDI_VERSION_MAJOR 1
134 #define INDI_VERSION_MINOR 7
135 #define INDI_VERSION_RELEASE 6
136 
137 /*******************************************************************************
138  * Manifest constants
139  */
140 
145 typedef enum {
146  ISS_OFF = 0,
148 } ISState;
149 
154 typedef enum {
155  IPS_IDLE = 0,
159 } IPState;
160 
165 typedef enum {
169 } ISRule;
170 
175 typedef enum {
179 } IPerm;
180 
181 // The XML strings for these attributes may be any length but implementations
182 // are only obligued to support these lengths for the various string attributes.
183 #define MAXINDINAME 64
184 #define MAXINDILABEL 64
185 #define MAXINDIDEVICE 64
186 #define MAXINDIGROUP 64
187 #define MAXINDIFORMAT 64
188 #define MAXINDIBLOBFMT 64
189 #define MAXINDITSTAMP 64
190 #define MAXINDIMESSAGE 255
191 
192 /*******************************************************************************
193  * Typedefs for each INDI Property type.
194  *
195  * INumber.format may be any printf-style appropriate for double
196  * or style "m" to create sexigesimal using the form "%<w>.<f>m" where
197  * <w> is the total field width.
198  * <f> is the width of the fraction. valid values are:
199  * 9 -> :mm:ss.ss
200  * 8 -> :mm:ss.s
201  * 6 -> :mm:ss
202  * 5 -> :mm.m
203  * 3 -> :mm
204  *
205  * examples:
206  *
207  * to produce use
208  *
209  * "-123:45" %7.3m
210  * " 0:01:02" %9.6m
211  */
212 
217 typedef struct
218 {
222  char label[MAXINDILABEL];
224  char *text;
228  void *aux0;
230  void *aux1;
231 } IText;
232 
237 typedef struct _ITextVectorProperty
238 {
250  double timeout;
256  int ntp;
260  void *aux;
262 
267 typedef struct
268 {
274  char format[MAXINDIFORMAT];
276  double min;
278  double max;
280  double step;
282  double value;
286  void *aux0;
288  void *aux1;
289 } INumber;
290 
311 {
323  double timeout;
329  int nnp;
333  void *aux;
335 
340 typedef struct
341 {
351  void *aux;
352 } ISwitch;
353 
359 {
373  double timeout;
379  int nsp;
383  void *aux;
385 
390 typedef struct
391 {
401  void *aux;
402 } ILight;
403 
408 typedef struct _ILightVectorProperty
409 {
423  int nlp;
427  void *aux;
429 
434 typedef struct /* one BLOB descriptor */
435 {
441  char format[MAXINDIBLOBFMT];
443  void *blob;
445  int bloblen;
447  int size;
451  void *aux0;
453  void *aux1;
455  void *aux2;
456 } IBLOB;
457 
462 typedef struct _IBLOBVectorProperty /* BLOB vector property descriptor */
463 {
475  double timeout;
481  int nbp;
485  void *aux;
487 
492 #define NARRAY(a) (sizeof(a) / sizeof(a[0]))
struct _IBLOBVectorProperty IBLOBVectorProperty
void * aux0
Definition: indiapi.h:228
void * aux0
Definition: indiapi.h:451
struct _ISwitchVectorProperty * svp
Definition: indiapi.h:349
struct _ITextVectorProperty * tvp
Definition: indiapi.h:226
void * aux1
Definition: indiapi.h:288
Light vector property descriptor.
Definition: indiapi.h:408
void * aux
Definition: indiapi.h:351
char device[MAXINDIDEVICE]
Definition: indiapi.h:240
#define MAXINDINAME
Definition: indiapi.h:183
char * text
Definition: indiapi.h:224
ISState s
Definition: indiapi.h:347
#define MAXINDIDEVICE
Definition: indiapi.h:185
double step
Definition: indiapi.h:280
IPState
Property state.
Definition: indiapi.h:154
One light descriptor.
Definition: indiapi.h:390
#define MAXINDIGROUP
Definition: indiapi.h:186
One number descriptor.
Definition: indiapi.h:267
#define MAXINDITSTAMP
Definition: indiapi.h:189
One Blob (Binary Large Object) descriptor.
Definition: indiapi.h:434
Definition: indiapi.h:177
#define MAXINDIBLOBFMT
Definition: indiapi.h:188
Definition: indiapi.h:176
int size
Definition: indiapi.h:447
IPState s
Definition: indiapi.h:397
Definition: indiapi.h:178
const char * name
Definition: indiserver.c:115
struct _IBLOBVectorProperty * bvp
Definition: indiapi.h:449
Switch vector property descriptor.
Definition: indiapi.h:358
Namespace to encapsulate INDI client, drivers, and mediator classes. Developers can subclass the base...
struct _INumberVectorProperty INumberVectorProperty
int bloblen
Definition: indiapi.h:445
One switch descriptor.
Definition: indiapi.h:340
struct _ILightVectorProperty * lvp
Definition: indiapi.h:399
struct _INumberVectorProperty * nvp
Definition: indiapi.h:284
char label[MAXINDILABEL]
Definition: indiapi.h:244
void * aux2
Definition: indiapi.h:455
struct _ISwitchVectorProperty ISwitchVectorProperty
BLOB (Binary Large Object) vector property descriptor.
Definition: indiapi.h:462
void * blob
Definition: indiapi.h:443
Number vector property descriptor.
Definition: indiapi.h:310
One text descriptor.
Definition: indiapi.h:217
struct _ILightVectorProperty ILightVectorProperty
#define MAXINDIFORMAT
Definition: indiapi.h:187
double min
Definition: indiapi.h:276
void * aux1
Definition: indiapi.h:453
char name[MAXINDINAME]
Definition: indiapi.h:242
void * aux1
Definition: indiapi.h:230
double max
Definition: indiapi.h:278
void * aux0
Definition: indiapi.h:286
IPerm
Permission hint, with respect to client.
Definition: indiapi.h:175
ISState
Switch state.
Definition: indiapi.h:145
char timestamp[MAXINDITSTAMP]
Definition: indiapi.h:258
struct _ITextVectorProperty ITextVectorProperty
#define MAXINDILABEL
Definition: indiapi.h:184
Text vector property descriptor.
Definition: indiapi.h:237
void * aux
Definition: indiapi.h:401
ISRule
Switch vector rule hint.
Definition: indiapi.h:165
char group[MAXINDIGROUP]
Definition: indiapi.h:246
double value
Definition: indiapi.h:282