Instrument Neutral Distributed Interface INDI
1.9.5
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
27
#include <stdio.h>
28
128
/*******************************************************************************
129
* INDI wire protocol version implemented by this API.
130
* N.B. this is indepedent of the API itself.
131
*/
132
133
#define INDIV 1.7
134
135
/* INDI Library version */
136
#define INDI_VERSION_MAJOR 1
137
#define INDI_VERSION_MINOR 9
138
#define INDI_VERSION_RELEASE 5
139
140
/*******************************************************************************
141
* Manifest constants
142
*/
143
148
typedef
enum
149
{
150
ISS_OFF
= 0,
151
ISS_ON
152
}
ISState
;
153
158
typedef
enum
159
{
160
IPS_IDLE
= 0,
161
IPS_OK
,
162
IPS_BUSY
,
163
IPS_ALERT
164
}
IPState
;
165
170
typedef
enum
171
{
172
ISR_1OFMANY
,
173
ISR_ATMOST1
,
174
ISR_NOFMANY
175
}
ISRule
;
176
181
typedef
enum
182
{
183
IP_RO
,
184
IP_WO
,
185
IP_RW
186
}
IPerm
;
187
188
// The XML strings for these attributes may be any length but implementations
189
// are only obligued to support these lengths for the various string attributes.
190
#define MAXINDINAME 64
191
#define MAXINDILABEL 64
192
#define MAXINDIDEVICE 64
193
#define MAXINDIGROUP 64
194
#define MAXINDIFORMAT 64
195
#define MAXINDIBLOBFMT 64
196
#define MAXINDITSTAMP 64
197
#define MAXINDIMESSAGE 255
198
199
/*******************************************************************************
200
* Typedefs for each INDI Property type.
201
*
202
* INumber.format may be any printf-style appropriate for double
203
* or style "m" to create sexigesimal using the form "%<w>.<f>m" where
204
* <w> is the total field width.
205
* <f> is the width of the fraction. valid values are:
206
* 9 -> :mm:ss.ss
207
* 8 -> :mm:ss.s
208
* 6 -> :mm:ss
209
* 5 -> :mm.m
210
* 3 -> :mm
211
*
212
* examples:
213
*
214
* to produce use
215
*
216
* "-123:45" %7.3m
217
* " 0:01:02" %9.6m
218
*/
219
224
typedef
struct
_IText
225
{
227
char
name
[
MAXINDINAME
];
229
char
label
[
MAXINDILABEL
];
231
char
*
text
;
233
struct
_ITextVectorProperty
*
tvp
;
235
void
*
aux0
;
237
void
*
aux1
;
238
}
IText
;
239
244
typedef
struct
_ITextVectorProperty
245
{
247
char
device
[
MAXINDIDEVICE
];
249
char
name
[
MAXINDINAME
];
251
char
label
[
MAXINDILABEL
];
253
char
group
[
MAXINDIGROUP
];
255
IPerm
p
;
257
double
timeout
;
259
IPState
s
;
261
IText
*
tp
;
263
int
ntp
;
265
char
timestamp
[
MAXINDITSTAMP
];
267
void
*
aux
;
268
}
ITextVectorProperty
;
269
274
typedef
struct
_INumber
275
{
277
char
name
[
MAXINDINAME
];
279
char
label
[
MAXINDILABEL
];
281
char
format
[
MAXINDIFORMAT
];
283
double
min
;
285
double
max
;
287
double
step
;
289
double
value
;
291
struct
_INumberVectorProperty
*
nvp
;
293
void
*
aux0
;
295
void
*
aux1
;
296
}
INumber
;
297
317
typedef
struct
_INumberVectorProperty
318
{
320
char
device
[
MAXINDIDEVICE
];
322
char
name
[
MAXINDINAME
];
324
char
label
[
MAXINDILABEL
];
326
char
group
[
MAXINDIGROUP
];
328
IPerm
p
;
330
double
timeout
;
332
IPState
s
;
334
INumber
*
np
;
336
int
nnp
;
338
char
timestamp
[
MAXINDITSTAMP
];
340
void
*
aux
;
341
}
INumberVectorProperty
;
342
347
typedef
struct
_ISwitch
348
{
350
char
name
[
MAXINDINAME
];
352
char
label
[
MAXINDILABEL
];
354
ISState
s
;
356
struct
_ISwitchVectorProperty
*
svp
;
358
void
*
aux
;
359
}
ISwitch
;
360
365
typedef
struct
_ISwitchVectorProperty
366
{
368
char
device
[
MAXINDIDEVICE
];
370
char
name
[
MAXINDINAME
];
372
char
label
[
MAXINDILABEL
];
374
char
group
[
MAXINDIGROUP
];
376
IPerm
p
;
378
ISRule
r
;
380
double
timeout
;
382
IPState
s
;
384
ISwitch
*
sp
;
386
int
nsp
;
388
char
timestamp
[
MAXINDITSTAMP
];
390
void
*
aux
;
391
}
ISwitchVectorProperty
;
392
397
typedef
struct
_ILight
398
{
400
char
name
[
MAXINDINAME
];
402
char
label
[
MAXINDILABEL
];
404
IPState
s
;
406
struct
_ILightVectorProperty
*
lvp
;
408
void
*
aux
;
409
}
ILight
;
410
415
typedef
struct
_ILightVectorProperty
416
{
418
char
device
[
MAXINDIDEVICE
];
420
char
name
[
MAXINDINAME
];
422
char
label
[
MAXINDILABEL
];
424
char
group
[
MAXINDIGROUP
];
426
IPState
s
;
428
ILight
*
lp
;
430
int
nlp
;
432
char
timestamp
[
MAXINDITSTAMP
];
434
void
*
aux
;
435
}
ILightVectorProperty
;
436
441
typedef
struct
_IBLOB
/* one BLOB descriptor */
442
{
444
char
name
[
MAXINDINAME
];
446
char
label
[
MAXINDILABEL
];
448
char
format
[
MAXINDIBLOBFMT
];
450
void
*
blob
;
452
int
bloblen
;
454
int
size
;
456
struct
_IBLOBVectorProperty
*
bvp
;
458
void
*
aux0
;
460
void
*
aux1
;
462
void
*
aux2
;
463
}
IBLOB
;
464
469
typedef
struct
_IBLOBVectorProperty
/* BLOB vector property descriptor */
470
{
472
char
device
[
MAXINDIDEVICE
];
474
char
name
[
MAXINDINAME
];
476
char
label
[
MAXINDILABEL
];
478
char
group
[
MAXINDIGROUP
];
480
IPerm
p
;
482
double
timeout
;
484
IPState
s
;
486
IBLOB
*
bp
;
488
int
nbp
;
490
char
timestamp
[
MAXINDITSTAMP
];
492
void
*
aux
;
493
}
IBLOBVectorProperty
;
494
499
#define NARRAY(a) (sizeof(a) / sizeof(a[0]))
500
504
#define assert_mem(p) if((p) == 0) { fprintf(stderr, "%s(%s): Failed to allocate memory\n", __FILE__, __func__); exit(1); }
505
MAXINDIDEVICE
#define MAXINDIDEVICE
Definition:
indiapi.h:192
MAXINDIGROUP
#define MAXINDIGROUP
Definition:
indiapi.h:193
IP_RO
@ IP_RO
Definition:
indiapi.h:183
_ITextVectorProperty::timeout
double timeout
Definition:
indiapi.h:257
_IBLOBVectorProperty::device
char device[MAXINDIDEVICE]
Definition:
indiapi.h:472
_IBLOB::aux1
void * aux1
Definition:
indiapi.h:460
_ILightVectorProperty::timestamp
char timestamp[MAXINDITSTAMP]
Definition:
indiapi.h:432
_IBLOBVectorProperty::nbp
int nbp
Definition:
indiapi.h:488
IP_WO
@ IP_WO
Definition:
indiapi.h:184
_IText::label
char label[MAXINDILABEL]
Definition:
indiapi.h:229
_IBLOB::bvp
struct _IBLOBVectorProperty * bvp
Definition:
indiapi.h:456
ISwitch
struct _ISwitch ISwitch
IPState
IPState
Property state.
Definition:
indiapi.h:158
_INumber::name
char name[MAXINDINAME]
Definition:
indiapi.h:277
_IBLOBVectorProperty::s
IPState s
Definition:
indiapi.h:484
_ISwitchVectorProperty::device
char device[MAXINDIDEVICE]
Definition:
indiapi.h:368
Aux::ANY
@ ANY
Definition:
celestronauxpacket.h:86
_ISwitchVectorProperty::timestamp
char timestamp[MAXINDITSTAMP]
Definition:
indiapi.h:388
_ILight::label
char label[MAXINDILABEL]
Definition:
indiapi.h:402
IPS_OK
@ IPS_OK
Definition:
indiapi.h:161
_ITextVectorProperty::aux
void * aux
Definition:
indiapi.h:267
_INumberVectorProperty::s
IPState s
Definition:
indiapi.h:332
MAXINDITSTAMP
#define MAXINDITSTAMP
Definition:
indiapi.h:196
_ILightVectorProperty
Light vector property descriptor.
Definition:
indiapi.h:415
ISwitch
One switch descriptor.
ISS_OFF
@ ISS_OFF
Definition:
indiapi.h:150
IBLOB
struct _IBLOB IBLOB
_IBLOB::aux2
void * aux2
Definition:
indiapi.h:462
_IText::name
char name[MAXINDINAME]
Definition:
indiapi.h:227
IPS_ALERT
@ IPS_ALERT
Definition:
indiapi.h:163
INumber
One number descriptor.
_INumberVectorProperty::nnp
int nnp
Definition:
indiapi.h:336
MAXINDINAME
#define MAXINDINAME
Definition:
indiapi.h:190
ISR_NOFMANY
@ ISR_NOFMANY
Definition:
indiapi.h:174
_IBLOBVectorProperty
BLOB (Binary Large Object) vector property descriptor.
Definition:
indiapi.h:469
INumberVectorProperty
struct _INumberVectorProperty INumberVectorProperty
_ITextVectorProperty::p
IPerm p
Definition:
indiapi.h:255
_IText::text
char * text
Definition:
indiapi.h:231
_ILightVectorProperty::device
char device[MAXINDIDEVICE]
Definition:
indiapi.h:418
_ITextVectorProperty::group
char group[MAXINDIGROUP]
Definition:
indiapi.h:253
_IText::aux0
void * aux0
Definition:
indiapi.h:235
MAXINDIBLOBFMT
#define MAXINDIBLOBFMT
Definition:
indiapi.h:195
_ISwitchVectorProperty::aux
void * aux
Definition:
indiapi.h:390
_ITextVectorProperty::ntp
int ntp
Definition:
indiapi.h:263
_ILightVectorProperty::s
IPState s
Definition:
indiapi.h:426
_INumber::step
double step
Definition:
indiapi.h:287
_IText::tvp
struct _ITextVectorProperty * tvp
Definition:
indiapi.h:233
_IBLOB::blob
void * blob
Definition:
indiapi.h:450
_IBLOBVectorProperty::bp
IBLOB * bp
Definition:
indiapi.h:486
_ILightVectorProperty::aux
void * aux
Definition:
indiapi.h:434
_IBLOBVectorProperty::timeout
double timeout
Definition:
indiapi.h:482
ISwitchVectorProperty
struct _ISwitchVectorProperty ISwitchVectorProperty
_ILight
Definition:
indiapi.h:397
_ILightVectorProperty::nlp
int nlp
Definition:
indiapi.h:430
_ITextVectorProperty::device
char device[MAXINDIDEVICE]
Definition:
indiapi.h:247
_IText
Definition:
indiapi.h:224
_ILightVectorProperty::name
char name[MAXINDINAME]
Definition:
indiapi.h:420
_ISwitch::svp
struct _ISwitchVectorProperty * svp
Definition:
indiapi.h:356
_IBLOBVectorProperty::aux
void * aux
Definition:
indiapi.h:492
_ITextVectorProperty
Text vector property descriptor.
Definition:
indiapi.h:244
_IBLOB
Definition:
indiapi.h:441
_ISwitchVectorProperty::label
char label[MAXINDILABEL]
Definition:
indiapi.h:372
_ILightVectorProperty::label
char label[MAXINDILABEL]
Definition:
indiapi.h:422
ILight
One light descriptor.
_INumberVectorProperty::timeout
double timeout
Definition:
indiapi.h:330
_IBLOBVectorProperty::p
IPerm p
Definition:
indiapi.h:480
_ITextVectorProperty::tp
IText * tp
Definition:
indiapi.h:261
_INumberVectorProperty
Number vector property descriptor.
Definition:
indiapi.h:317
_IBLOB::name
char name[MAXINDINAME]
Definition:
indiapi.h:444
_INumber::aux1
void * aux1
Definition:
indiapi.h:295
IText
One text descriptor.
_ILight::lvp
struct _ILightVectorProperty * lvp
Definition:
indiapi.h:406
_ISwitchVectorProperty::nsp
int nsp
Definition:
indiapi.h:386
_IBLOB::label
char label[MAXINDILABEL]
Definition:
indiapi.h:446
_ILightVectorProperty::group
char group[MAXINDIGROUP]
Definition:
indiapi.h:424
IPS_BUSY
@ IPS_BUSY
Definition:
indiapi.h:162
ISR_1OFMANY
@ ISR_1OFMANY
Definition:
indiapi.h:172
_INumberVectorProperty::np
INumber * np
Definition:
indiapi.h:334
IPS_IDLE
@ IPS_IDLE
Definition:
indiapi.h:160
_IBLOB::format
char format[MAXINDIBLOBFMT]
Definition:
indiapi.h:448
_ISwitch::s
ISState s
Definition:
indiapi.h:354
_ITextVectorProperty::timestamp
char timestamp[MAXINDITSTAMP]
Definition:
indiapi.h:265
_INumber::min
double min
Definition:
indiapi.h:283
_ILight::name
char name[MAXINDINAME]
Definition:
indiapi.h:400
ISR_ATMOST1
@ ISR_ATMOST1
Definition:
indiapi.h:173
_INumberVectorProperty::name
char name[MAXINDINAME]
Definition:
indiapi.h:322
_ISwitch::aux
void * aux
Definition:
indiapi.h:358
_INumberVectorProperty::timestamp
char timestamp[MAXINDITSTAMP]
Definition:
indiapi.h:338
_ILight::s
IPState s
Definition:
indiapi.h:404
_ITextVectorProperty::name
char name[MAXINDINAME]
Definition:
indiapi.h:249
_IText::aux1
void * aux1
Definition:
indiapi.h:237
INumber
struct _INumber INumber
IPerm
IPerm
Permission hint, with respect to client.
Definition:
indiapi.h:181
_ITextVectorProperty::label
char label[MAXINDILABEL]
Definition:
indiapi.h:251
MAXINDIFORMAT
#define MAXINDIFORMAT
Definition:
indiapi.h:194
IBLOBVectorProperty
struct _IBLOBVectorProperty IBLOBVectorProperty
_INumber::value
double value
Definition:
indiapi.h:289
_ILight::aux
void * aux
Definition:
indiapi.h:408
_IBLOB::aux0
void * aux0
Definition:
indiapi.h:458
_INumber::max
double max
Definition:
indiapi.h:285
_IBLOBVectorProperty::label
char label[MAXINDILABEL]
Definition:
indiapi.h:476
ILight
struct _ILight ILight
ITextVectorProperty
struct _ITextVectorProperty ITextVectorProperty
_IBLOBVectorProperty::group
char group[MAXINDIGROUP]
Definition:
indiapi.h:478
_INumberVectorProperty::label
char label[MAXINDILABEL]
Definition:
indiapi.h:324
ILightVectorProperty
struct _ILightVectorProperty ILightVectorProperty
_ISwitch::label
char label[MAXINDILABEL]
Definition:
indiapi.h:352
_ISwitchVectorProperty::s
IPState s
Definition:
indiapi.h:382
_ITextVectorProperty::s
IPState s
Definition:
indiapi.h:259
_INumberVectorProperty::device
char device[MAXINDIDEVICE]
Definition:
indiapi.h:320
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition:
AlignmentSubsystemForClients.cpp:11
_INumber
Definition:
indiapi.h:274
_INumberVectorProperty::p
IPerm p
Definition:
indiapi.h:328
IText
struct _IText IText
_INumber::nvp
struct _INumberVectorProperty * nvp
Definition:
indiapi.h:291
_ILightVectorProperty::lp
ILight * lp
Definition:
indiapi.h:428
_IBLOBVectorProperty::name
char name[MAXINDINAME]
Definition:
indiapi.h:474
_INumberVectorProperty::aux
void * aux
Definition:
indiapi.h:340
IP_RW
@ IP_RW
Definition:
indiapi.h:185
MAXINDILABEL
#define MAXINDILABEL
Definition:
indiapi.h:191
ISState
ISState
Switch state.
Definition:
indiapi.h:148
_INumberVectorProperty::group
char group[MAXINDIGROUP]
Definition:
indiapi.h:326
_ISwitchVectorProperty::r
ISRule r
Definition:
indiapi.h:378
_ISwitchVectorProperty::sp
ISwitch * sp
Definition:
indiapi.h:384
ISRule
ISRule
Switch vector rule hint.
Definition:
indiapi.h:170
_INumber::aux0
void * aux0
Definition:
indiapi.h:293
_ISwitch::name
char name[MAXINDINAME]
Definition:
indiapi.h:350
_ISwitchVectorProperty::p
IPerm p
Definition:
indiapi.h:376
_INumber::format
char format[MAXINDIFORMAT]
Definition:
indiapi.h:281
_ISwitch
Definition:
indiapi.h:347
_ISwitchVectorProperty::group
char group[MAXINDIGROUP]
Definition:
indiapi.h:374
_INumber::label
char label[MAXINDILABEL]
Definition:
indiapi.h:279
_IBLOBVectorProperty::timestamp
char timestamp[MAXINDITSTAMP]
Definition:
indiapi.h:490
IBLOB
One Blob (Binary Large Object) descriptor.
_ISwitchVectorProperty::timeout
double timeout
Definition:
indiapi.h:380
_IBLOB::bloblen
int bloblen
Definition:
indiapi.h:452
_ISwitchVectorProperty
Switch vector property descriptor.
Definition:
indiapi.h:365
_IBLOB::size
int size
Definition:
indiapi.h:454
_ISwitchVectorProperty::name
char name[MAXINDINAME]
Definition:
indiapi.h:370
ISS_ON
@ ISS_ON
Definition:
indiapi.h:151
Generated on Tue Jan 25 2022 14:40:57 for Instrument Neutral Distributed Interface INDI by
1.8.17