Instrument Neutral Distributed Interface INDI  2.0.2
indidriver.h
Go to the documentation of this file.
1 
24 #pragma once
25 
26 #include "indiapi.h"
27 #include "lilxml.h"
28 #include "indicom.h"
29 
30 #include <stdio.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 extern int verbose; /* chatty */
37 extern char *me; /* a.out name */
38 //extern LilXML *clixml; /* XML parser context */
39 
40 extern int dispatch(XMLEle *root, char msg[]);
41 //extern void clientMsgCB(int fd, void *arg);
42 
69 /* @{ */
70 
79 extern FILE *IUGetConfigFP(const char *filename, const char *dev, const char *mode, char errmsg[]);
80 
88 extern int IUPurgeConfig(const char *filename, const char *dev, char errmsg[]);
89 
104 extern int IUReadConfig(const char *filename, const char *dev, const char *property, int silent, char errmsg[]);
105 
118 extern int IUSaveDefaultConfig(const char *source_config, const char *dest_config, const char *dev);
119 
127 extern void IUSaveConfigTag(FILE *fp, int ctag, const char *dev, int silent);
128 
136 extern int IUGetConfigNumber(const char *dev, const char *property, const char *member, double *value);
137 
145 extern int IUGetConfigSwitch(const char *dev, const char *property, const char *member, ISState *value);
146 
153 extern int IUGetConfigOnSwitchIndex(const char *dev, const char *property, int *index);
154 
162 extern int IUGetConfigOnSwitchName(const char *dev, const char *property, char *name, size_t size);
163 
170 extern int IUGetConfigOnSwitch(const ISwitchVectorProperty *property, int *index);
171 
180 extern int IUGetConfigText(const char *dev, const char *property, const char *member, char *value, int len);
181 
189 extern int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n);
190 
198 extern int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n);
199 
207 extern int IUUpdateText(ITextVectorProperty *tvp, char *texts[], char *names[], int n);
208 
219 extern int IUUpdateBLOB(IBLOBVectorProperty *bvp, int sizes[], int blobsizes[], char *blobs[], char *formats[],
220  char *names[], int n);
221 
229 extern void IUUpdateMinMax(const INumberVectorProperty *nvp);
230 
231 /* @} */
232 
233 #ifdef __cplusplus
234 }
235 #endif
Constants and Data structure definitions for the interface to the reference INDI C API implementation...
ISState
Switch state.
Definition: indiapi.h:150
Implementations for common driver routines.
int IUUpdateBLOB(IBLOBVectorProperty *bvp, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Update all BLOB members in a BLOB vector property.
Definition: indidriver.c:1422
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
Definition: indidriver.c:1308
int verbose
Definition: indidriver.c:49
int IUUpdateText(ITextVectorProperty *tvp, char *texts[], char *names[], int n)
Update all text members in a text vector property.
Definition: indidriver.c:1396
void IUSaveConfigTag(FILE *fp, int ctag, const char *dev, int silent)
Add opening or closing tag to a configuration file. A configuration file root XML element is <INDIDri...
Definition: indidriver.c:1043
int IUGetConfigOnSwitch(const ISwitchVectorProperty *property, int *index)
IUGetConfigOnSwitch Opens configuration file and reads a single switch vector property to find the in...
Definition: indidriver.c:592
int IUGetConfigOnSwitchName(const char *dev, const char *property, char *name, size_t size)
IUGetConfigOnSwitchLabel Opens configuration file and returns the name of the ON switch property,...
Definition: indidriver.c:771
int IUGetConfigText(const char *dev, const char *property, const char *member, char *value, int len)
IUGetConfigText Opens configuration file and reads single text property.
Definition: indidriver.c:889
int IUGetConfigNumber(const char *dev, const char *property, const char *member, double *value)
IUGetConfigNumber Opens configuration file and reads single number property.
Definition: indidriver.c:831
int IUReadConfig(const char *filename, const char *dev, const char *property, int silent, char errmsg[])
Loads and processes a configuration file. Once a configuration file is successful loaded,...
Definition: indidriver.c:485
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
Definition: indidriver.c:1362
int IUPurgeConfig(const char *filename, const char *dev, char errmsg[])
Definition: indidriver.c:968
int IUSaveDefaultConfig(const char *source_config, const char *dest_config, const char *dev)
Copies an existing configuration file into a default configuration file. If no default configuration ...
Definition: indidriver.c:542
int IUGetConfigOnSwitchIndex(const char *dev, const char *property, int *index)
IUGetConfigOnSwitchIndex Opens configuration file and reads single switch property to find ON switch ...
Definition: indidriver.c:711
void IUUpdateMinMax(const INumberVectorProperty *nvp)
Function to update the min and max elements of a number in the client.
Definition: indidriver.c:1296
int dispatch(XMLEle *root, char msg[])
Definition: indidriver.c:180
int IUGetConfigSwitch(const char *dev, const char *property, const char *member, ISState *value)
IUGetConfigSwitch Opens configuration file and reads single switch property.
Definition: indidriver.c:653
char * me
Definition: indidriver.c:50
FILE * IUGetConfigFP(const char *filename, const char *dev, const char *mode, char errmsg[])
Open a configuration file for writing and return a configuration file FILE pointer.
Definition: indidriver.c:994
A little DOM-style library to handle parsing and processing an XML file.
BLOB (Binary Large Object) vector property descriptor.
Definition: indiapi.h:471
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367
Text vector property descriptor.
Definition: indiapi.h:246