Instrument Neutral Distributed Interface INDI  1.9.2
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 2
139 
140 /*******************************************************************************
141  * Manifest constants
142  */
143 
148 typedef enum
149 {
150 ISS_OFF = 0,
152 } ISState;
153 
158 typedef enum
159 {
160 IPS_IDLE = 0,
164 } IPState;
165 
170 typedef enum
171 {
175 } ISRule;
176 
181 typedef enum
182 {
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 {
231  char *text;
235  void *aux0;
237  void *aux1;
238 } IText;
239 
244 typedef struct _ITextVectorProperty
245 {
257  double timeout;
263  int ntp;
267  void *aux;
269 
274 typedef struct _INumber
275 {
283  double min;
285  double max;
287  double step;
289  double value;
293  void *aux0;
295  void *aux1;
296 } INumber;
297 
318 {
330  double timeout;
336  int nnp;
340  void *aux;
342 
347 typedef struct _ISwitch
348 {
358  void *aux;
359 } ISwitch;
360 
366 {
380  double timeout;
386  int nsp;
390  void *aux;
392 
397 typedef struct _ILight
398 {
408  void *aux;
409 } ILight;
410 
415 typedef struct _ILightVectorProperty
416 {
430  int nlp;
434  void *aux;
436 
441 typedef struct _IBLOB/* one BLOB descriptor */
442 {
450  void *blob;
452  int bloblen;
454  int size;
458  void *aux0;
460  void *aux1;
462  void *aux2;
463 } IBLOB;
464 
469 typedef struct _IBLOBVectorProperty /* BLOB vector property descriptor */
470 {
482  double timeout;
488  int nbp;
492  void *aux;
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