131 # define INDI_UNUSED(x) (void)x
135 #ifndef ATTRIBUTE_FORMAT_PRINTF
137 # define ATTRIBUTE_FORMAT_PRINTF(A, B) __attribute__((format(printf, (A), (B))))
139 # define ATTRIBUTE_FORMAT_PRINTF(A, B)
276 extern void IDSnoopDevice(
const char *snooped_device,
const char *snooped_property);
299 typedef void(
IE_CBF)(
int readfiledes,
void *userpointer);
427 extern int IUSaveBLOB(
IBLOB *bp,
int size,
int blobsize,
char *blob,
char *format);
477 extern int IUFindIndex(
const char *needle,
char **hay,
unsigned int n);
528 double step,
double value);
536 extern void IUFillText(
IText *tp,
const char *name,
const char *label,
const char *initialText);
544 extern void IUFillBLOB(
IBLOB *bp,
const char *name,
const char *label,
const char *format);
573 const char *label,
const char *group,
IPState s);
588 const char *label,
const char *group,
IPerm p,
double timeout,
IPState s);
603 const char *label,
const char *group,
IPerm p,
double timeout,
IPState s);
618 const char *label,
const char *group,
IPerm p,
double timeout,
IPState s);
700 extern void ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n);
710 extern void ISNewNumber(
const char *dev,
const char *name,
double *values,
char *names[],
int n);
720 extern void ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n);
734 extern void ISNewBLOB(
const char *dev,
const char *name,
int sizes[],
int blobsizes[],
char *blobs[],
char *formats[],
735 char *names[],
int n);
754 extern int crackDN(
XMLEle *root,
char **dev,
char **name,
char msg[]);
800 #define INDI_SHARED_BLOB_SUPPORT
Constants and Data structure definitions for the interface to the reference INDI C API implementation...
IPerm
Permission hint, with respect to client.
ISRule
Switch vector rule hint.
int IUSnoopSwitch(XMLEle *root, ISwitchVectorProperty *svp)
Update a snooped switch vector property from the given XML root element.
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
const char * ruleStr(ISRule r)
void void void void void void void IDSetLight(const ILightVectorProperty *l, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing light vector property.
void IUFillLight(ILight *lp, const char *name, const char *label, IPState s)
Assign attributes for a light property. The light's auxiliary elements will be set to NULL.
void() IE_CBF(int readfiledes, void *userpointer)
void void IDMessageVA(const char *dev, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void void void void void void void void void void IDSetBLOBVA(const IBLOBVectorProperty *b, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
int IUFindOnSwitchIndex(const ISwitchVectorProperty *sp)
Returns the index of first ON switch it finds in the vector switch property.
void IDSnoopBLOBs(const char *snooped_device, const char *snooped_property, BLOBHandling bh)
Function a Driver calls to control whether they will receive BLOBs from snooped devices.
void void void void void void void void IDDefLightVA(const ILightVectorProperty *l, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void void void void void void IDDefSwitchVA(const ISwitchVectorProperty *s, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void IERmCallback(int callbackid)
Remove a callback function.
void void void void void void void void void IDSetBLOB(const IBLOBVectorProperty *b, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing BLOB vector property.
void IERmWorkProc(int workprocid)
Remove a work procedure.
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
void ISNewNumber(const char *dev, const char *name, double *values, char *names[], int n)
Update the value of an existing number vector property.
BLOBHandling
How drivers handle BLOBs incoming from snooping drivers.
void void IDSetTextVA(const ITextVectorProperty *t, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
INumber * IUFindNumber(const INumberVectorProperty *nvp, const char *name)
Find an INumber member in a number text property.
void ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Update data of an existing blob vector property.
void void IDDefTextVA(const ITextVectorProperty *t, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void IDSetText(const ITextVectorProperty *t, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing text vector property.
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
void IUFillLightVector(ILightVectorProperty *lvp, ILight *lp, int nlp, const char *dev, const char *name, const char *label, const char *group, IPState s)
Assign attributes for a light vector property. The vector's auxiliary elements will be set to NULL.
void IUFillTextVector(ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a text vector property. The vector's auxiliary elements will be set to NULL.
const char * IUFindOnSwitchName(ISState *states, char *names[], int n)
Returns the name of the first ON switch it finds in the supplied arguments.
void void void void void void IDSetSwitchVA(const ISwitchVectorProperty *s, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
void void void IDSetNumber(const INumberVectorProperty *n, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing number vector property.
int IUFindIndex(const char *needle, char **hay, unsigned int n)
Returns the index of the string in a string array.
int IUSnoopBLOB(XMLEle *root, IBLOBVectorProperty *bvp)
Update a snooped BLOB vector property from the given XML root element.
int crackDN(XMLEle *root, char **dev, char **name, char msg[])
Extract dev and name attributes from an XML element.
void void void void void void IDLogVA(const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(1
int IUSnoopLight(XMLEle *root, ILightVectorProperty *lvp)
Update a snooped light vector property from the given XML root element.
void ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Update the value of an existing switch vector property.
void void void void void void void IDDefLight(const ILightVectorProperty *l, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to create a light vector property.
void void void void IDDefNumberVA(const INumberVectorProperty *n, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Update the value of an existing text vector property.
int IUSaveBLOB(IBLOB *bp, int size, int blobsize, char *blob, char *format)
Function to save blob metadata in the corresponding blob.
void IUSaveConfigBLOB(FILE *fp, const IBLOBVectorProperty *bvp)
Add a BLOB vector property value to the configuration file.
void void void IDDefNumber(const INumberVectorProperty *n, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to create a number number property.
void void void void IDDeleteVA(const char *dev, const char *name, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(3
void IERmTimer(int timerid)
Remove the timer with the given timerid, as returned from IEAddTimer() or IEAddPeriodicTimer().
void void void void void void void void void IDDefBLOB(const IBLOBVectorProperty *b, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to create a BLOB vector property.
int IUSnoopText(XMLEle *root, ITextVectorProperty *tvp)
Update a snooped text vector property from the given XML root element.
void IDMessage(const char *dev, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Function Drivers call to send log messages to Clients. If dev is specified the Client shall associate...
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
void ISGetProperties(const char *dev)
Get Device Properties.
void IDSnoopDevice(const char *snooped_device, const char *snooped_property)
Function a Driver calls to snoop on another Device. Snooped messages will then arrive via ISSnoopDevi...
int IUSnoopNumber(XMLEle *root, INumberVectorProperty *nvp)
Update a snooped number vector property from the given XML root element.
int IEAddTimer(int millisecs, IE_TCF *fp, void *userpointer)
Register a new single-shot timer function, fp, to be called with ud as argument after ms.
void void void void void IDDefSwitch(const ISwitchVectorProperty *s, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to create a switch vector property.
void xmlv1()
print the boilerplate comment introducing xml
const char * pstateStr(IPState s)
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
void void void IDDelete(const char *dev, const char *name, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(3
Function Drivers call to inform Clients a Property is no longer available, or the entire device is go...
void IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text's auxiliary elements will be set to NULL.
void IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number's auxiliary elements will be set to NULL.
int crackIPerm(const char *str, IPerm *ip)
Extract property permission state (RW, RO, WO) from the supplied string.
void IUSaveConfigText(FILE *fp, const ITextVectorProperty *tvp)
Add a text vector property value to the configuration file.
void void void void void IDLog(const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(1
Function Drivers call to log a message locally. The message is not sent to any Clients.
int crackIPState(const char *str, IPState *ip)
Extract property state (Idle, OK, Busy, Alert) from the supplied string.
int IEAddPeriodicTimer(int millisecs, IE_TCF *fp, void *userpointer)
Register a new periodic timer function, fp, to be called with ud as argument after ms.
void void void void void IDSetSwitch(const ISwitchVectorProperty *s, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing switch vector property.
IBLOB * IUFindBLOB(const IBLOBVectorProperty *bvp, const char *name)
Find an IBLOB member in a vector BLOB property.
void void void void IDSetNumberVA(const INumberVectorProperty *n, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void ISSnoopDevice(XMLEle *root)
Function defined by Drivers that is called when another Driver it is snooping (by having previously c...
void void void void void void void void IDSetLightVA(const ILightVectorProperty *l, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
void IDDefText(const ITextVectorProperty *t, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to create a text vector property.
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
void() IE_TCF(void *userpointer)
int IEDeferLoop(int maxms, int *flagp)
wait in-line for a flag to set, presumably by another event function
IText * IUFindText(const ITextVectorProperty *tvp, const char *name)
Find an IText member in a vector text property.
int IERemainingTimer(int timerid)
Returns the timer's remaining value in milliseconds left until the timeout.
void IUFillBLOBVector(IBLOBVectorProperty *bvp, IBLOB *bp, int nbp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a BLOB vector property. The vector's auxiliary elements will be set to NULL.
void IUFillBLOB(IBLOB *bp, const char *name, const char *label, const char *format)
Assign attributes for a BLOB property. The BLOB's data and auxiliary elements will be set to NULL.
void() IE_WPF(void *userpointer)
#define ATTRIBUTE_FORMAT_PRINTF(A, B)
ISwitch * IUFindOnSwitch(const ISwitchVectorProperty *sp)
Returns the first ON switch it finds in the vector switch property.
int IEAddCallback(int readfiledes, IE_CBF *fp, void *userpointer)
Register a new callback, fp, to be called with userpointer as argument when readfiledes is ready.
ILight * IUFindLight(const ILightVectorProperty *lvp, const char *name)
Find an ILight member in a vector Light property.
int crackISRule(const char *str, ISRule *ip)
Extract switch rule (OneOfMany, OnlyOne..etc) from the supplied string.
const char * sstateStr(ISState s)
int IENSecRemainingTimer(int tid)
Returns the timer's remaining value in nanoseconds left until the timeout.
int IEAddWorkProc(IE_WPF *fp, void *userpointer)
Add a new work procedure, fp, to be called with ud when nothing else to do.
int IEDeferLoop0(int maxms, int *flagp)
void void void void void void void void void void IDDefBLOBVA(const IBLOBVectorProperty *b, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2
const char * permStr(IPerm p)
int crackISState(const char *str, ISState *ip)
Extract switch state (On or Off) from the supplied string.
ISwitch * IUFindSwitch(const ISwitchVectorProperty *svp, const char *name)
Find an ISwitch member in a vector switch property.
A little DOM-style library to handle parsing and processing an XML file.
One Blob (Binary Large Object) descriptor.
BLOB (Binary Large Object) vector property descriptor.
Light vector property descriptor.
Number vector property descriptor.
Switch vector property descriptor.
Text vector property descriptor.