Instrument Neutral Distributed Interface INDI 2.2.5
indiapi.h
Go to the documentation of this file.
1#if 0
3Copyright (C) 2003 Elwood C. Downey
42022 Ludovic Pollet
5
6This library is free software;
7you can redistribute it and / or
8modify it under the terms of the GNU Lesser General Public
9License as published by the Free Software Foundation;
10either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY;
15without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public
20License along with this library;
21if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
23
24#endif
25
26#pragma once
27
28#include <stdio.h>
29
129/*******************************************************************************
130 * INDI wire protocol version implemented by this API.
131 * N.B. this is independent of the API itself.
132 */
133
134#define INDIV 1.7
135
136/* INDI Library version */
137#include "indiversion.h"
138
139/*******************************************************************************
140 * Manifest constants
141 */
142
147typedef enum
148{
150ISS_ON
152
164
175
180typedef enum
181{
184IP_RW
186
187// The XML strings for these attributes may be any length but implementations
188// are only obligued to support these lengths for the various string attributes.
189#define MAXINDINAME 64
190#define MAXINDILABEL 64
191#define MAXINDIDEVICE 64
192#define MAXINDIGROUP 64
193#define MAXINDIFORMAT 64
194#define MAXINDIBLOBFMT 64
195#define MAXINDITSTAMP 64
196#define MAXINDIMESSAGE 255
197
198/*******************************************************************************
199 * Typedefs for each INDI Property type.
200 *
201 * INumber.format may be any printf-style appropriate for double
202 * or style "m" to create sexigesimal using the form "%<w>.<f>m" where
203 * <w> is the total field width.
204 * <f> is the width of the fraction. valid values are:
205 * 9 -> :mm:ss.ss
206 * 8 -> :mm:ss.s
207 * 6 -> :mm:ss
208 * 5 -> :mm.m
209 * 3 -> :mm
210 *
211 * examples:
212 *
213 * to produce use
214 *
215 * "-123:45" %7.3m
216 * " 0:01:02" %9.6m
217 */
218
223typedef struct _IText
224{
230 char *text;
234 void *aux0;
236 void *aux1;
238
268
273typedef struct _INumber
274{
282 double min;
284 double max;
286 double step;
288 double value;
292 void *aux0;
294 void *aux1;
296
341
359
391
409
435
440typedef struct _IBLOB/* one BLOB descriptor */
441{
449 void *blob;
453 int size;
457 void *aux0;
459 void *aux1;
461 void *aux2;
463
493
498#define NARRAY(a) (sizeof(a) / sizeof(a[0]))
499
503#define assert_mem(p) if((p) == 0) { fprintf(stderr, "%s(%s): Failed to allocate memory\n", __FILE__, __func__); exit(1); }
504
505
506#ifdef __cplusplus
507extern "C" {
508#endif
509
510// FIXME: duplicated from indidevapi.h. Can we share ?
511#ifdef __cplusplus
512}
513#endif
ISState
Switch state.
Definition indiapi.h:148
@ ISS_OFF
Definition indiapi.h:149
@ ISS_ON
Definition indiapi.h:150
#define MAXINDIBLOBFMT
Definition indiapi.h:194
#define MAXINDIDEVICE
Definition indiapi.h:191
struct _IBLOBVectorProperty IBLOBVectorProperty
#define MAXINDIFORMAT
Definition indiapi.h:193
#define MAXINDITSTAMP
Definition indiapi.h:195
struct _IBLOB IBLOB
IPerm
Permission hint, with respect to client.
Definition indiapi.h:181
@ IP_RW
Definition indiapi.h:184
@ IP_RO
Definition indiapi.h:182
@ IP_WO
Definition indiapi.h:183
IPState
Property state.
Definition indiapi.h:158
@ IPS_BUSY
Definition indiapi.h:161
@ IPS_ALERT
Definition indiapi.h:162
@ IPS_IDLE
Definition indiapi.h:159
@ IPS_OK
Definition indiapi.h:160
#define MAXINDILABEL
Definition indiapi.h:190
struct _ISwitchVectorProperty ISwitchVectorProperty
struct _INumber INumber
ISRule
Switch vector rule hint.
Definition indiapi.h:170
@ ISR_1OFMANY
Definition indiapi.h:171
@ ISR_NOFMANY
Definition indiapi.h:173
@ ISR_ATMOST1
Definition indiapi.h:172
#define MAXINDIGROUP
Definition indiapi.h:192
#define MAXINDINAME
Definition indiapi.h:189
struct _ITextVectorProperty ITextVectorProperty
struct _ISwitch ISwitch
struct _ILightVectorProperty ILightVectorProperty
struct _ILight ILight
struct _INumberVectorProperty INumberVectorProperty
struct _IText IText
Namespace to encapsulate INDI client, drivers, and mediator classes.
BLOB (Binary Large Object) vector property descriptor.
Definition indiapi.h:469
char label[MAXINDILABEL]
Definition indiapi.h:475
char group[MAXINDIGROUP]
Definition indiapi.h:477
char timestamp[MAXINDITSTAMP]
Definition indiapi.h:489
char name[MAXINDINAME]
Definition indiapi.h:473
char device[MAXINDIDEVICE]
Definition indiapi.h:471
char label[MAXINDILABEL]
Definition indiapi.h:445
void * aux0
Definition indiapi.h:457
struct _IBLOBVectorProperty * bvp
Definition indiapi.h:455
char format[MAXINDIBLOBFMT]
Definition indiapi.h:447
void * blob
Definition indiapi.h:449
void * aux2
Definition indiapi.h:461
int bloblen
Definition indiapi.h:451
char name[MAXINDINAME]
Definition indiapi.h:443
int size
Definition indiapi.h:453
void * aux1
Definition indiapi.h:459
Light vector property descriptor.
Definition indiapi.h:415
char label[MAXINDILABEL]
Definition indiapi.h:421
char name[MAXINDINAME]
Definition indiapi.h:419
char device[MAXINDIDEVICE]
Definition indiapi.h:417
char group[MAXINDIGROUP]
Definition indiapi.h:423
char timestamp[MAXINDITSTAMP]
Definition indiapi.h:431
void * aux
Definition indiapi.h:407
struct _ILightVectorProperty * lvp
Definition indiapi.h:405
char name[MAXINDINAME]
Definition indiapi.h:399
IPState s
Definition indiapi.h:403
char label[MAXINDILABEL]
Definition indiapi.h:401
Number vector property descriptor.
Definition indiapi.h:317
char group[MAXINDIGROUP]
Definition indiapi.h:325
char device[MAXINDIDEVICE]
Definition indiapi.h:319
char name[MAXINDINAME]
Definition indiapi.h:321
char label[MAXINDILABEL]
Definition indiapi.h:323
char timestamp[MAXINDITSTAMP]
Definition indiapi.h:337
char name[MAXINDINAME]
Definition indiapi.h:276
char label[MAXINDILABEL]
Definition indiapi.h:278
double max
Definition indiapi.h:284
void * aux0
Definition indiapi.h:292
double value
Definition indiapi.h:288
double step
Definition indiapi.h:286
double min
Definition indiapi.h:282
char format[MAXINDIFORMAT]
Definition indiapi.h:280
void * aux1
Definition indiapi.h:294
struct _INumberVectorProperty * nvp
Definition indiapi.h:290
Switch vector property descriptor.
Definition indiapi.h:365
char device[MAXINDIDEVICE]
Definition indiapi.h:367
char name[MAXINDINAME]
Definition indiapi.h:369
char label[MAXINDILABEL]
Definition indiapi.h:371
char group[MAXINDIGROUP]
Definition indiapi.h:373
char timestamp[MAXINDITSTAMP]
Definition indiapi.h:387
char label[MAXINDILABEL]
Definition indiapi.h:351
struct _ISwitchVectorProperty * svp
Definition indiapi.h:355
ISState s
Definition indiapi.h:353
char name[MAXINDINAME]
Definition indiapi.h:349
void * aux
Definition indiapi.h:357
Text vector property descriptor.
Definition indiapi.h:244
char label[MAXINDILABEL]
Definition indiapi.h:250
char device[MAXINDIDEVICE]
Definition indiapi.h:246
char timestamp[MAXINDITSTAMP]
Definition indiapi.h:264
char name[MAXINDINAME]
Definition indiapi.h:248
char group[MAXINDIGROUP]
Definition indiapi.h:252
char name[MAXINDINAME]
Definition indiapi.h:226
void * aux0
Definition indiapi.h:234
struct _ITextVectorProperty * tvp
Definition indiapi.h:232
char label[MAXINDILABEL]
Definition indiapi.h:228
char * text
Definition indiapi.h:230
void * aux1
Definition indiapi.h:236