kstars
indiapi.h
Go to the documentation of this file.00001 #if 0
00002 INDI
00003 Copyright (C) 2003 Elwood C. Downey
00004
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013 Lesser General Public License for more details.
00014
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00018
00019 #endif
00020
00021 #ifndef INDI_API_H
00022 #define INDI_API_H
00023
00058
00059
00060
00061
00062
00063 #define INDIV 1.5
00064
00065
00066
00067
00068
00072 typedef enum {
00073 ISS_OFF, ISS_ON
00074 } ISState;
00075
00079 typedef enum {
00080 IPS_IDLE, IPS_OK, IPS_BUSY, IPS_ALERT
00081 } IPState;
00082
00086 typedef enum {
00087 ISR_1OFMANY, ISR_ATMOST1, ISR_NOFMANY
00088 } ISRule;
00089
00093 typedef enum {
00094 IP_RO, IP_WO, IP_RW
00095 } IPerm;
00096
00097
00098
00099
00100 #define MAXINDINAME 32
00101 #define MAXINDILABEL 32
00102 #define MAXINDIDEVICE 32
00103 #define MAXINDIGROUP 32
00104 #define MAXINDIFORMAT 32
00105 #define MAXINDIBLOBFMT 32
00106 #define MAXINDITSTAMP 32
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00132 typedef struct {
00134 char name[MAXINDINAME];
00136 char label[MAXINDILABEL];
00138 char *text;
00140 struct _ITextVectorProperty *tvp;
00142 void *aux0;
00144 void *aux1;
00145 } IText;
00146
00150 typedef struct _ITextVectorProperty {
00152 char device[MAXINDIDEVICE];
00154 char name[MAXINDINAME];
00156 char label[MAXINDILABEL];
00158 char group[MAXINDIGROUP];
00160 IPerm p;
00162 double timeout;
00164 IPState s;
00166 IText *tp;
00168 int ntp;
00170 char timestamp[MAXINDITSTAMP];
00172 void *aux;
00173 } ITextVectorProperty;
00174
00178 typedef struct {
00179 char name[MAXINDINAME];
00180 char label[MAXINDILABEL];
00181 char format[MAXINDIFORMAT];
00182 double min, max;
00183 double step;
00184 double value;
00185 struct _INumberVectorProperty *nvp;
00186 void *aux0, *aux1;
00187 } INumber;
00188
00206 typedef struct _INumberVectorProperty {
00208 char device[MAXINDIDEVICE];
00210 char name[MAXINDINAME];
00212 char label[MAXINDILABEL];
00214 char group[MAXINDIGROUP];
00216 IPerm p;
00218 double timeout;
00220 IPState s;
00222 INumber *np;
00224 int nnp;
00226 char timestamp[MAXINDITSTAMP];
00228 void *aux;
00229 } INumberVectorProperty;
00230
00234 typedef struct {
00235 char name[MAXINDINAME];
00236 char label[MAXINDILABEL];
00237 ISState s;
00238 struct _ISwitchVectorProperty *svp;
00239 void *aux;
00240 } ISwitch;
00241
00245 typedef struct _ISwitchVectorProperty {
00247 char device[MAXINDIDEVICE];
00249 char name[MAXINDINAME];
00251 char label[MAXINDILABEL];
00253 char group[MAXINDIGROUP];
00255 IPerm p;
00257 ISRule r;
00259 double timeout;
00261 IPState s;
00263 ISwitch *sp;
00265 int nsp;
00267 char timestamp[MAXINDITSTAMP];
00269 void *aux;
00270 } ISwitchVectorProperty;
00271
00275 typedef struct {
00276 char name[MAXINDINAME];
00277 char label[MAXINDILABEL];
00278 IPState s;
00279 struct _ILightVectorProperty *lvp;
00280 void *aux;
00281 } ILight;
00282
00286 typedef struct _ILightVectorProperty {
00288 char device[MAXINDIDEVICE];
00290 char name[MAXINDINAME];
00292 char label[MAXINDILABEL];
00294 char group[MAXINDIGROUP];
00296 IPState s;
00298 ILight *lp;
00300 int nlp;
00302 char timestamp[MAXINDITSTAMP];
00304 void *aux;
00305 } ILightVectorProperty;
00306
00310 typedef struct {
00312 char name[MAXINDINAME];
00314 char label[MAXINDILABEL];
00316 char format[MAXINDIBLOBFMT];
00318 void *blob;
00320 int bloblen;
00322 int size;
00324 struct _IBLOBVectorProperty *bvp;
00326 void *aux0, *aux1, *aux2;
00327 } IBLOB;
00328
00333 typedef struct _IBLOBVectorProperty {
00335 char device[MAXINDIDEVICE];
00337 char name[MAXINDINAME];
00339 char label[MAXINDILABEL];
00341 char group[MAXINDIGROUP];
00343 IPerm p;
00345 double timeout;
00347 IPState s;
00349 IBLOB *bp;
00351 int nbp;
00353 char timestamp[MAXINDITSTAMP];
00355 void *aux;
00356 } IBLOBVectorProperty;
00357
00358
00361 #define NARRAY(a) (sizeof(a)/sizeof(a[0]))
00362
00363 #endif