Instrument Neutral Distributed Interface INDI
2.0.2
|
Interface to the reference INDI C API device implementation on the Device Driver side. More...
Go to the source code of this file.
Macros | |
#define | INDI_UNUSED(x) (void)x |
#define | ATTRIBUTE_FORMAT_PRINTF(A, B) |
#define | INDI_SHARED_BLOB_SUPPORT |
Typedefs | |
typedef void() | IE_CBF(int readfiledes, void *userpointer) |
typedef void() | IE_TCF(void *userpointer) |
typedef void() | IE_WPF(void *userpointer) |
Enumerations | |
enum | BLOBHandling { B_NEVER = 0 , B_ALSO , B_ONLY } |
How drivers handle BLOBs incoming from snooping drivers. More... | |
Functions | |
void | IDDefText (const ITextVectorProperty *t, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2 |
Tell client to create a text vector property. More... | |
void void | IDDefTextVA (const ITextVectorProperty *t, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
void void void | IDDefNumber (const INumberVectorProperty *n, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2 |
Tell client to create a number number property. More... | |
void void void void | IDDefNumberVA (const INumberVectorProperty *n, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
void void void void void | IDDefSwitch (const ISwitchVectorProperty *s, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2 |
Tell client to create a switch vector property. More... | |
void void void void void void | IDDefSwitchVA (const ISwitchVectorProperty *s, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
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. More... | |
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 void void void | IDDefBLOB (const IBLOBVectorProperty *b, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2 |
Tell client to create a BLOB vector property. More... | |
void void void void void void void void void void | IDDefBLOBVA (const IBLOBVectorProperty *b, 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. More... | |
void void | IDSetTextVA (const ITextVectorProperty *t, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
void void void | IDSetNumber (const INumberVectorProperty *n, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2 |
Tell client to update an existing number vector property. More... | |
void void void void | IDSetNumberVA (const INumberVectorProperty *n, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
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. More... | |
void void void void void void | IDSetSwitchVA (const ISwitchVectorProperty *s, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
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. More... | |
void void void void void void void void | IDSetLightVA (const ILightVectorProperty *l, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
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. More... | |
void void void void void void void void void void | IDSetBLOBVA (const IBLOBVectorProperty *b, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
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 the message with that device; if dev is NULL the Client shall treat the message as generic from no specific Device. More... | |
void void | IDMessageVA (const char *dev, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(2 |
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 gone if name is NULL. More... | |
void void void void | IDDeleteVA (const char *dev, const char *name, const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(3 |
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. More... | |
void void void void void void | IDLogVA (const char *msg, va_list arg) ATTRIBUTE_FORMAT_PRINTF(1 |
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 ISSnoopDevice. More... | |
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. More... | |
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. More... | |
void | IERmCallback (int callbackid) |
Remove a callback function. More... | |
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. More... | |
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. More... | |
int | IERemainingTimer (int timerid) |
Returns the timer's remaining value in milliseconds left until the timeout. More... | |
int | IENSecRemainingTimer (int tid) |
Returns the timer's remaining value in nanoseconds left until the timeout. More... | |
void | IERmTimer (int timerid) |
Remove the timer with the given timerid, as returned from IEAddTimer() or IEAddPeriodicTimer(). More... | |
int | IEAddWorkProc (IE_WPF *fp, void *userpointer) |
Add a new work procedure, fp, to be called with ud when nothing else to do. More... | |
void | IERmWorkProc (int workprocid) |
Remove a work procedure. More... | |
int | IEDeferLoop (int maxms, int *flagp) |
wait in-line for a flag to set, presumably by another event function More... | |
int | IEDeferLoop0 (int maxms, int *flagp) |
void | IUSaveConfigNumber (FILE *fp, const INumberVectorProperty *nvp) |
Add a number vector property value to the configuration file. More... | |
void | IUSaveConfigText (FILE *fp, const ITextVectorProperty *tvp) |
Add a text vector property value to the configuration file. More... | |
void | IUSaveConfigSwitch (FILE *fp, const ISwitchVectorProperty *svp) |
Add a switch vector property value to the configuration file. More... | |
void | IUSaveConfigBLOB (FILE *fp, const IBLOBVectorProperty *bvp) |
Add a BLOB vector property value to the configuration file. More... | |
void | IUSaveText (IText *tp, const char *newtext) |
Function to reliably save new text in a IText. More... | |
int | IUSaveBLOB (IBLOB *bp, int size, int blobsize, char *blob, char *format) |
Function to save blob metadata in the corresponding blob. More... | |
IText * | IUFindText (const ITextVectorProperty *tvp, const char *name) |
Find an IText member in a vector text property. More... | |
INumber * | IUFindNumber (const INumberVectorProperty *nvp, const char *name) |
Find an INumber member in a number text property. More... | |
ISwitch * | IUFindSwitch (const ISwitchVectorProperty *svp, const char *name) |
Find an ISwitch member in a vector switch property. More... | |
ILight * | IUFindLight (const ILightVectorProperty *lvp, const char *name) |
Find an ILight member in a vector Light property. More... | |
IBLOB * | IUFindBLOB (const IBLOBVectorProperty *bvp, const char *name) |
Find an IBLOB member in a vector BLOB property. More... | |
ISwitch * | IUFindOnSwitch (const ISwitchVectorProperty *sp) |
Returns the first ON switch it finds in the vector switch property. More... | |
int | IUFindIndex (const char *needle, char **hay, unsigned int n) |
Returns the index of the string in a string array. More... | |
int | IUFindOnSwitchIndex (const ISwitchVectorProperty *sp) |
Returns the index of first ON switch it finds in the vector switch property. More... | |
const char * | IUFindOnSwitchName (ISState *states, char *names[], int n) |
Returns the name of the first ON switch it finds in the supplied arguments. More... | |
void | IUResetSwitch (ISwitchVectorProperty *svp) |
Reset all switches in a switch vector property to OFF. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | IUSnoopNumber (XMLEle *root, INumberVectorProperty *nvp) |
Update a snooped number vector property from the given XML root element. More... | |
int | IUSnoopText (XMLEle *root, ITextVectorProperty *tvp) |
Update a snooped text vector property from the given XML root element. More... | |
int | IUSnoopLight (XMLEle *root, ILightVectorProperty *lvp) |
Update a snooped light vector property from the given XML root element. More... | |
int | IUSnoopSwitch (XMLEle *root, ISwitchVectorProperty *svp) |
Update a snooped switch vector property from the given XML root element. More... | |
int | IUSnoopBLOB (XMLEle *root, IBLOBVectorProperty *bvp) |
Update a snooped BLOB vector property from the given XML root element. More... | |
void | ISGetProperties (const char *dev) |
Get Device Properties. More... | |
void | ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) |
Update the value of an existing text vector property. More... | |
void | ISNewNumber (const char *dev, const char *name, double *values, char *names[], int n) |
Update the value of an existing number vector property. More... | |
void | ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
Update the value of an existing switch vector property. More... | |
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. More... | |
void | ISSnoopDevice (XMLEle *root) |
Function defined by Drivers that is called when another Driver it is snooping (by having previously called IDSnoopDevice()) sent any INDI message. More... | |
int | crackDN (XMLEle *root, char **dev, char **name, char msg[]) |
Extract dev and name attributes from an XML element. More... | |
int | crackIPState (const char *str, IPState *ip) |
Extract property state (Idle, OK, Busy, Alert) from the supplied string. More... | |
int | crackISState (const char *str, ISState *ip) |
Extract switch state (On or Off) from the supplied string. More... | |
int | crackIPerm (const char *str, IPerm *ip) |
Extract property permission state (RW, RO, WO) from the supplied string. More... | |
int | crackISRule (const char *str, ISRule *ip) |
Extract switch rule (OneOfMany, OnlyOne..etc) from the supplied string. More... | |
const char * | pstateStr (IPState s) |
const char * | sstateStr (ISState s) |
const char * | ruleStr (ISRule r) |
const char * | permStr (IPerm p) |
void | xmlv1 () |
print the boilerplate comment introducing xml More... | |
Interface to the reference INDI C API device implementation on the Device Driver side.
INDI Copyright (C) 2003 - 2006 Elwood C. Downey
Modified by Jasem Mutlaq (2003 - 2015)
This library is free software; you can redistribute it and / or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
This file is divided into two main sections:
Functions the INDI device driver framework defines which the Driver may call:
Functions the INDI device driver framework calls which the Driver must define:
These functions are the interface to the INDI C-language Device Driver reference implementation library. Any driver that uses this interface is expected to #include "indidevapi.h" and to link with indidrivermain.o and eventloop.o. Indidevapi.h further includes indiapi.h. The former contains the prototypes for the functions documented here, although many functions take arguments defined in the latter.
These functions make it much easier to write a compliant INDI driver than starting from scratch, and also serve as a concrete example of the interactions an INDI driver, in any language, is expected to accommodate.
The reference driver framework and the optimizations made within the reference indiserver both assume and require that one driver program implements exactly one logical INDI device.
The functions in this framework fall into two broad categories. Some are functions that a driver must define because they are called by the reference framework; these functions begin with IS. The remaining functions are library utilities a driver may use to do important operations.
A major point to realize is that an INDI driver built with this framework does not contain the C main() function. As soon as a driver begins executing, it listens on stdin for INDI messages. Only when a valid and appropriate message is received will it then call the driver via one of the IS functions. The driver is then expected to respond promptly by calling one of the ID library functions. It may also use any of the IU utility functions as desired to make processing a message easier.
Rather separate from these IS, ID and IU functions are a collection of functions that utilize the notion of a callback. In a callback design, the driver registers a function with the framework to be called under certain circumstances. When said circumstances occur, the framework will call the callback function. The driver never calls these callbacks directly. These callback functions begin with IE. They can arrange for a callback function to be called under three kinds of circumstances: when a given file descriptor may be read without blocking (because either data is available or EOF has been encountered), when a given time interval has elapsed, or when the framework has nothing urgent to do. The callback functions for each circumstance must be written according to a well defined prototype since, after all, the framework must know how to call the callback correctlty.
Definition in file indidevapi.h.
#define ATTRIBUTE_FORMAT_PRINTF | ( | A, | |
B | |||
) |
Definition at line 139 of file indidevapi.h.
#define INDI_SHARED_BLOB_SUPPORT |
Definition at line 800 of file indidevapi.h.
#define INDI_UNUSED | ( | x | ) | (void)x |
Definition at line 131 of file indidevapi.h.
typedef void() IE_CBF(int readfiledes, void *userpointer) |
Definition at line 299 of file indidevapi.h.
typedef void() IE_TCF(void *userpointer) |
Definition at line 304 of file indidevapi.h.
typedef void() IE_WPF(void *userpointer) |
Definition at line 309 of file indidevapi.h.
enum BLOBHandling |
How drivers handle BLOBs incoming from snooping drivers.
Enumerator | |
---|---|
B_NEVER | Never receive BLOBs |
B_ALSO | Receive BLOBs along with normal messages |
B_ONLY | ONLY receive BLOBs from drivers, ignore all other traffic |
Definition at line 265 of file indidevapi.h.
int crackDN | ( | XMLEle * | root, |
char ** | dev, | ||
char ** | name, | ||
char | msg[] | ||
) |
Extract dev and name attributes from an XML element.
root | The XML element to be parsed. |
dev | pointer to an allocated buffer to save the extracted element device name attribute. The buffer size must be at least MAXINDIDEVICE bytes. |
name | pointer to an allocated buffer to save the extracted elemented name attribute. The buffer size must be at least MAXINDINAME bytes. |
msg | pointer to an allocated char buffer to store error messages. The minimum buffer size is MAXRBUF. |
Definition at line 553 of file indidevapi.c.
int crackIPerm | ( | const char * | str, |
IPerm * | ip | ||
) |
Extract property permission state (RW, RO, WO) from the supplied string.
str | A string representation of the permission state. |
ip | Pointer to IPerm structure to store the extracted permission state. |
Definition at line 602 of file indidevapi.c.
int crackIPState | ( | const char * | str, |
IPState * | ip | ||
) |
Extract property state (Idle, OK, Busy, Alert) from the supplied string.
str | A string representation of the state. |
ip | Pointer to IPState structure to store the extracted property state. |
Definition at line 576 of file indidevapi.c.
int crackISRule | ( | const char * | str, |
ISRule * | ip | ||
) |
Extract switch rule (OneOfMany, OnlyOne..etc) from the supplied string.
str | A string representation of the switch rule. |
ip | Pointer to ISRule structure to store the extracted switch rule. |
Definition at line 615 of file indidevapi.c.
int crackISState | ( | const char * | str, |
ISState * | ip | ||
) |
Extract switch state (On or Off) from the supplied string.
str | A string representation of the switch state. |
ip | Pointer to ISState structure to store the extracted switch state. |
Definition at line 591 of file indidevapi.c.
void void void void void void void void void IDDefBLOB | ( | const IBLOBVectorProperty * | b, |
const char * | msg, | ||
... | |||
) |
Tell client to create a BLOB vector property.
b | pointer to the vector BLOB property to be defined. |
msg | message in printf style to send to the client. May be NULL. |
void void void void void void void void void void IDDefBLOBVA | ( | const IBLOBVectorProperty * | b, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void void void void void IDDefLight | ( | const ILightVectorProperty * | l, |
const char * | msg, | ||
... | |||
) |
Tell client to create a light vector property.
l | pointer to the vector light property to be defined. |
msg | message in printf style to send to the client. May be NULL. |
void void void void void void void void IDDefLightVA | ( | const ILightVectorProperty * | l, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void IDDefNumber | ( | const INumberVectorProperty * | n, |
const char * | msg, | ||
... | |||
) |
Tell client to create a number number property.
n | pointer to the vector number property to be defined. |
msg | message in printf style to send to the client. May be NULL. |
void void void void IDDefNumberVA | ( | const INumberVectorProperty * | n, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void void void IDDefSwitch | ( | const ISwitchVectorProperty * | s, |
const char * | msg, | ||
... | |||
) |
Tell client to create a switch vector property.
s | pointer to the vector switch property to be defined. |
msg | message in printf style to send to the client. May be NULL. |
void void void void void void IDDefSwitchVA | ( | const ISwitchVectorProperty * | s, |
const char * | msg, | ||
va_list | arg | ||
) |
void IDDefText | ( | const ITextVectorProperty * | t, |
const char * | msg, | ||
... | |||
) |
Tell client to create a text vector property.
t | pointer to the vector text property to be defined. |
msg | message in printf style to send to the client. May be NULL. |
void void IDDefTextVA | ( | const ITextVectorProperty * | t, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void IDDelete | ( | const char * | dev, |
const char * | name, | ||
const char * | msg, | ||
... | |||
) |
Function Drivers call to inform Clients a Property is no longer available, or the entire device is gone if name is NULL.
dev | device name. If device name is NULL, the entire device will be deleted. |
name | property name to be deleted. |
msg | message in printf style to send to the client. |
void void void void IDDeleteVA | ( | const char * | dev, |
const char * | name, | ||
const char * | msg, | ||
va_list | arg | ||
) |
void void void void void IDLog | ( | const char * | msg, |
... | |||
) |
Function Drivers call to log a message locally. The message is not sent to any Clients.
msg | message in printf style to send to the client. |
void void void void void void IDLogVA | ( | const char * | msg, |
va_list | arg | ||
) |
void IDMessage | ( | const char * | dev, |
const char * | msg, | ||
... | |||
) |
Function Drivers call to send log messages to Clients. If dev is specified the Client shall associate the message with that device; if dev is NULL the Client shall treat the message as generic from no specific Device.
dev | device name |
msg | message in printf style to send to the client. |
void void IDMessageVA | ( | const char * | dev, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void void void void void void void IDSetBLOB | ( | const IBLOBVectorProperty * | b, |
const char * | msg, | ||
... | |||
) |
Tell client to update an existing BLOB vector property.
b | pointer to the vector BLOB property. |
msg | message in printf style to send to the client. May be NULL. |
void void void void void void void void void void IDSetBLOBVA | ( | const IBLOBVectorProperty * | b, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void void void void void IDSetLight | ( | const ILightVectorProperty * | l, |
const char * | msg, | ||
... | |||
) |
Tell client to update an existing light vector property.
l | pointer to the vector light property. |
msg | message in printf style to send to the client. May be NULL. |
void void void void void void void void IDSetLightVA | ( | const ILightVectorProperty * | l, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void IDSetNumber | ( | const INumberVectorProperty * | n, |
const char * | msg, | ||
... | |||
) |
Tell client to update an existing number vector property.
n | pointer to the vector number property. |
msg | message in printf style to send to the client. May be NULL. |
void void void void IDSetNumberVA | ( | const INumberVectorProperty * | n, |
const char * | msg, | ||
va_list | arg | ||
) |
void void void void void IDSetSwitch | ( | const ISwitchVectorProperty * | s, |
const char * | msg, | ||
... | |||
) |
Tell client to update an existing switch vector property.
s | pointer to the vector switch property. |
msg | message in printf style to send to the client. May be NULL. |
void void void void void void IDSetSwitchVA | ( | const ISwitchVectorProperty * | s, |
const char * | msg, | ||
va_list | arg | ||
) |
void IDSetText | ( | const ITextVectorProperty * | t, |
const char * | msg, | ||
... | |||
) |
Tell client to update an existing text vector property.
t | pointer to the vector text property. |
msg | message in printf style to send to the client. May be NULL. |
void void IDSetTextVA | ( | const ITextVectorProperty * | t, |
const char * | msg, | ||
va_list | arg | ||
) |
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.
snooped_device | name of the device to snoop. |
snooped_property | name of property to snoop. If NULL, then all BLOBs from the given device are snooped. |
bh | How drivers handle BLOBs incoming from snooping drivers. |
Definition at line 161 of file indidriver.c.
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 ISSnoopDevice.
snooped_device | name of the device to snoop. |
snooped_property | name of the snooped property in the device. |
Definition at line 143 of file indidriver.c.
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.
readfiledes | file descriptor. |
fp | a pointer to the callback function. |
userpointer | a pointer to be passed to the callback function when called. |
Definition at line 572 of file eventloop.c.
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.
millisecs | timer period in milliseconds. |
fp | a pointer to the callback function. |
userpointer | a pointer to be passed to the callback function when called. |
Definition at line 587 of file eventloop.c.
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.
millisecs | timer period in milliseconds. |
fp | a pointer to the callback function. |
userpointer | a pointer to be passed to the callback function when called. |
Definition at line 582 of file eventloop.c.
int IEAddWorkProc | ( | IE_WPF * | fp, |
void * | userpointer | ||
) |
Add a new work procedure, fp, to be called with ud when nothing else to do.
fp | a pointer to the work procedure callback function. |
userpointer | a pointer to be passed to the callback function when called. |
Definition at line 607 of file eventloop.c.
int IEDeferLoop | ( | int | maxms, |
int * | flagp | ||
) |
wait in-line for a flag to set, presumably by another event function
Definition at line 617 of file eventloop.c.
int IEDeferLoop0 | ( | int | maxms, |
int * | flagp | ||
) |
Definition at line 622 of file eventloop.c.
int IENSecRemainingTimer | ( | int | tid | ) |
Returns the timer's remaining value in nanoseconds left until the timeout.
tid | the timer callback ID returned from addTimer() or addPeriodicTimer() |
int IERemainingTimer | ( | int | timerid | ) |
Returns the timer's remaining value in milliseconds left until the timeout.
timerid | the timer callback ID returned from IEAddTimer() or IEAddPeriodicTimer() |
Definition at line 592 of file eventloop.c.
void IERmCallback | ( | int | callbackid | ) |
Remove a callback function.
callbackid | the callback ID returned from IEAddCallback() |
Definition at line 577 of file eventloop.c.
void IERmTimer | ( | int | timerid | ) |
Remove the timer with the given timerid, as returned from IEAddTimer() or IEAddPeriodicTimer().
timerid | the timer callback ID returned from IEAddTimer() or IEAddPeriodicTimer(). |
Definition at line 602 of file eventloop.c.
void IERmWorkProc | ( | int | workprocid | ) |
Remove a work procedure.
workprocid | The unique ID for the work procedure to be removed. |
Definition at line 612 of file eventloop.c.
void ISGetProperties | ( | const char * | dev | ) |
Get Device Properties.
dev | the name of the device. |
This function is called by the framework whenever the driver has received a getProperties message from an INDI client. The argument
dev | is either a string containing the name of the device specified within the message, or NULL if no device was specified. If the driver does not recognize the device, it should ignore the message and do nothing. If dev matches the device the driver is implementing, or dev is NULL, the driver must respond by sending one defXXX message to describe each property defined by this device, including its current (or initial) value. The recommended way to send these messages is to call the appropriate IDDef functions. |
Definition at line 58 of file defaultdevice.cpp.
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.
dev | the name of the device. |
name | the name of the blob vector property to update. |
sizes | an array of base64 blob sizes in bytes before decoding. |
blobsizes | an array of the sizes of blobs after decoding from base64. |
blobs | an array of decoded data. Each blob size is found in blobsizes array. |
formats | Blob data format (e.g. fits.z). |
names | names of blob members to update. |
n | the number of blobs to update. |
Definition at line 89 of file defaultdevice.cpp.
void ISNewNumber | ( | const char * | dev, |
const char * | name, | ||
double * | values, | ||
char * | names[], | ||
int | n | ||
) |
Update the value of an existing number vector property.
dev | the name of the device. |
name | the name of the number vector property to update. |
values | an array of number values. |
names | parallel names to the array of number values. |
n | the dimension of doubles[]. |
void ISNewSwitch | ( | const char * | dev, |
const char * | name, | ||
ISState * | states, | ||
char * | names[], | ||
int | n | ||
) |
Update the value of an existing switch vector property.
dev | the name of the device. |
name | the name of the switch vector property to update. |
states | an array of switch states. |
names | parallel names to the array of switch states. |
n | the dimension of states[]. |
Definition at line 65 of file defaultdevice.cpp.
void ISNewText | ( | const char * | dev, |
const char * | name, | ||
char * | texts[], | ||
char * | names[], | ||
int | n | ||
) |
Update the value of an existing text vector property.
dev | the name of the device. |
name | the name of the text vector property to update. |
texts | an array of text values. |
names | parallel names to the array of text values. |
n | the dimension of texts[]. |
Definition at line 81 of file defaultdevice.cpp.
void ISSnoopDevice | ( | XMLEle * | root | ) |
Function defined by Drivers that is called when another Driver it is snooping (by having previously called IDSnoopDevice()) sent any INDI message.
root | The argument contains the full message exactly as it was sent by the driver. Hint: use the IUSnoopXXX utility functions to help crack the message if it was one of setXXX or defXXX. |
Definition at line 99 of file defaultdevice.cpp.
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.
bp | pointer a BLOB property to fill |
name | the BLOB name |
label | the BLOB label |
format | the BLOB format. |
Definition at line 216 of file indidevapi.c.
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.
bvp | pointer a BLOB vector property to fill |
bp | pointer to an array of BLOBs |
nbp | the dimension of bp |
dev | the device name this vector property belongs to |
name | the vector property name |
label | the vector property label |
group | the vector property group |
p | the vector property permission |
timeout | vector property timeout in seconds |
s | the vector property initial state. |
Definition at line 310 of file indidevapi.c.
Assign attributes for a light property. The light's auxiliary elements will be set to NULL.
lp | pointer a light property to fill |
name | the light name |
label | the light label |
s | the light state (IDLE, WARNING, OK, ALERT) |
Definition at line 169 of file indidevapi.c.
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.
lvp | pointer a light vector property to fill |
lp | pointer to an array of lights |
nlp | the dimension of lp |
dev | the device name this vector property belongs to |
name | the vector property name |
label | the vector property label |
group | the vector property group |
s | the vector property initial state. |
Definition at line 255 of file indidevapi.c.
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.
np | pointer a number property to fill |
name | the number name |
label | the number label |
format | the number format in printf style (e.g. "%02d") |
min | the minimum possible value |
max | the maximum possible value |
step | the step used to climb from minimum value to maximum value |
value | the number's current value |
Definition at line 180 of file indidevapi.c.
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.
nvp | pointer a number vector property to fill |
np | pointer to an array of numbers |
nnp | the dimension of np |
dev | the device name this vector property belongs to |
name | the vector property name |
label | the vector property label |
group | the vector property group |
p | the vector property permission |
timeout | vector property timeout in seconds |
s | the vector property initial state. |
Definition at line 272 of file indidevapi.c.
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
sp | pointer a switch property to fill |
name | the switch name |
label | the switch label |
s | the switch state (ISS_ON or ISS_OFF) |
Definition at line 158 of file indidevapi.c.
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.
svp | pointer a switch vector property to fill |
sp | pointer to an array of switches |
nsp | the dimension of sp |
dev | the device name this vector property belongs to |
name | the vector property name |
label | the vector property label |
group | the vector property group |
p | the vector property permission |
r | the switches behavior |
timeout | vector property timeout in seconds |
s | the vector property initial state. |
Definition at line 235 of file indidevapi.c.
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.
tp | pointer a text property to fill |
name | the text name |
label | the text label |
initialText | the initial text |
Definition at line 198 of file indidevapi.c.
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.
tvp | pointer a text vector property to fill |
tp | pointer to an array of texts |
ntp | the dimension of tp |
dev | the device name this vector property belongs to |
name | the vector property name |
label | the vector property label |
group | the vector property group |
p | the vector property permission |
timeout | vector property timeout in seconds |
s | the vector property initial state. |
Definition at line 291 of file indidevapi.c.
IBLOB* IUFindBLOB | ( | const IBLOBVectorProperty * | bvp, |
const char * | name | ||
) |
Find an IBLOB member in a vector BLOB property.
bvp | a pointer to a BLOB vector property. |
name | the name of the member to search for. |
Definition at line 96 of file indidevapi.c.
int IUFindIndex | ( | const char * | needle, |
char ** | hay, | ||
unsigned int | n | ||
) |
Returns the index of the string in a string array.
needle | the string to match against each element in the hay |
hay | a pointer to a string array to search in |
n | the size of hay |
Definition at line 117 of file indidevapi.c.
ILight* IUFindLight | ( | const ILightVectorProperty * | lvp, |
const char * | name | ||
) |
Find an ILight member in a vector Light property.
lvp | a pointer to a Light vector property. |
name | the name of the member to search for. |
Definition at line 86 of file indidevapi.c.
INumber* IUFindNumber | ( | const INumberVectorProperty * | nvp, |
const char * | name | ||
) |
Find an INumber member in a number text property.
nvp | a pointer to a number vector property. |
name | the name of the member to search for. |
Definition at line 66 of file indidevapi.c.
ISwitch* IUFindOnSwitch | ( | const ISwitchVectorProperty * | sp | ) |
Returns the first ON switch it finds in the vector switch property.
sp | a pointer to a switch vector property. |
Definition at line 108 of file indidevapi.c.
int IUFindOnSwitchIndex | ( | const ISwitchVectorProperty * | sp | ) |
Returns the index of first ON switch it finds in the vector switch property.
sp | a pointer to a switch vector property. |
Definition at line 128 of file indidevapi.c.
const char* IUFindOnSwitchName | ( | ISState * | states, |
char * | names[], | ||
int | n | ||
) |
Returns the name of the first ON switch it finds in the supplied arguments.
states | list of switch states passed by ISNewSwitch() |
names | list of switch names passed by ISNewSwitch() |
n | number of switches passed by ISNewSwitch() |
Definition at line 137 of file indidevapi.c.
ISwitch* IUFindSwitch | ( | const ISwitchVectorProperty * | svp, |
const char * | name | ||
) |
Find an ISwitch member in a vector switch property.
svp | a pointer to a switch vector property. |
name | the name of the member to search for. |
Definition at line 76 of file indidevapi.c.
IText* IUFindText | ( | const ITextVectorProperty * | tvp, |
const char * | name | ||
) |
Find an IText member in a vector text property.
tvp | a pointer to a text vector property. |
name | the name of the member to search for. |
Definition at line 56 of file indidevapi.c.
void IUResetSwitch | ( | ISwitchVectorProperty * | svp | ) |
Reset all switches in a switch vector property to OFF.
svp | a pointer to a switch vector property. |
Definition at line 148 of file indidevapi.c.
int IUSaveBLOB | ( | IBLOB * | bp, |
int | size, | ||
int | blobsize, | ||
char * | blob, | ||
char * | format | ||
) |
Function to save blob metadata in the corresponding blob.
bp | pointer to an IBLOB member. |
size | size of the blob buffer encoded in base64 |
blobsize | actual size of the buffer after base64 decoding. This is the actual byte count used in drivers. |
blob | pointer to the blob buffer |
format | format of the blob buffer |
Definition at line 44 of file indidevapi.c.
void IUSaveConfigBLOB | ( | FILE * | fp, |
const IBLOBVectorProperty * | bvp | ||
) |
Add a BLOB vector property value to the configuration file.
fp | file pointer to a configuration file. |
bvp | pointer to a BLOB vector property. |
Definition at line 30 of file indidevapi.c.
void IUSaveConfigNumber | ( | FILE * | fp, |
const INumberVectorProperty * | nvp | ||
) |
Add a number vector property value to the configuration file.
fp | file pointer to a configuration file. |
nvp | pointer to a number vector property. |
Definition at line 15 of file indidevapi.c.
void IUSaveConfigSwitch | ( | FILE * | fp, |
const ISwitchVectorProperty * | svp | ||
) |
Add a switch vector property value to the configuration file.
fp | file pointer to a configuration file. |
svp | pointer to a switch vector property. |
Definition at line 25 of file indidevapi.c.
void IUSaveConfigText | ( | FILE * | fp, |
const ITextVectorProperty * | tvp | ||
) |
Add a text vector property value to the configuration file.
fp | file pointer to a configuration file. |
tvp | pointer to a text vector property. |
Definition at line 20 of file indidevapi.c.
void IUSaveText | ( | IText * | tp, |
const char * | newtext | ||
) |
Function to reliably save new text in a IText.
tp | pointer to an IText member. |
newtext | the new text to be saved |
Definition at line 36 of file indidevapi.c.
int IUSnoopBLOB | ( | XMLEle * | root, |
IBLOBVectorProperty * | bvp | ||
) |
Update a snooped BLOB vector property from the given XML root element.
root | XML root elememnt containing the snopped property content |
bvp | a pointer to the BLOB vector property to be updated. |
Definition at line 502 of file indidevapi.c.
int IUSnoopLight | ( | XMLEle * | root, |
ILightVectorProperty * | lvp | ||
) |
Update a snooped light vector property from the given XML root element.
root | XML root elememnt containing the snopped property content |
lvp | a pointer to the light vector property to be updated. |
Definition at line 418 of file indidevapi.c.
int IUSnoopNumber | ( | XMLEle * | root, |
INumberVectorProperty * | nvp | ||
) |
Update a snooped number vector property from the given XML root element.
root | XML root elememnt containing the snopped property content |
nvp | a pointer to the number vector property to be updated. |
Definition at line 337 of file indidevapi.c.
int IUSnoopSwitch | ( | XMLEle * | root, |
ISwitchVectorProperty * | svp | ||
) |
Update a snooped switch vector property from the given XML root element.
root | XML root elememnt containing the snopped property content |
svp | a pointer to the switch vector property to be updated. |
Definition at line 460 of file indidevapi.c.
int IUSnoopText | ( | XMLEle * | root, |
ITextVectorProperty * | tvp | ||
) |
Update a snooped text vector property from the given XML root element.
root | XML root elememnt containing the snopped property content |
tvp | a pointer to the text vector property to be updated. |
Definition at line 382 of file indidevapi.c.
const char* permStr | ( | IPerm | p | ) |
Definition at line 676 of file indidevapi.c.
const char* pstateStr | ( | IPState | s | ) |
Definition at line 628 of file indidevapi.c.
const char* ruleStr | ( | ISRule | r | ) |
Definition at line 660 of file indidevapi.c.
const char* sstateStr | ( | ISState | s | ) |
Definition at line 646 of file indidevapi.c.
void xmlv1 | ( | ) |
print the boilerplate comment introducing xml
Definition at line 692 of file indidevapi.c.