• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kstars

indidevapi.h File Reference


Detailed Description

Interface to the reference INDI C API device implementation on the Device Driver side.

Author:
Elwood C. Downey

Jasem Mutlaq

This file is divided into two main sections:
  1. Functions the INDI device driver framework defines which the Driver may call:

    • IDxxx functions to send messages to an INDI client.
    • IExxx functions to implement the event driven model.
    • IUxxx functions to perform handy utility functions.

  2. Functions the INDI device driver framework calls which the Driver must define:

    • ISxxx to respond to messages from a Client.

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.

#include "indiapi.h"
#include "lilxml.h"

Include dependency graph for indidevapi.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Defines

#define INDI_UNUSED(x)   (void) x

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 }

Functions

void IDDefText (const ITextVectorProperty *t, const char *msg,...)
void IDDefNumber (const INumberVectorProperty *n, const char *msg,...)
void IDDefSwitch (const ISwitchVectorProperty *s, const char *msg,...)
void IDDefLight (const ILightVectorProperty *l, const char *msg,...)
void IDDefBLOB (const IBLOBVectorProperty *b, const char *msg,...)
void IDSetText (const ITextVectorProperty *t, const char *msg,...)
void IDSetNumber (const INumberVectorProperty *n, const char *msg,...)
void IDSetSwitch (const ISwitchVectorProperty *s, const char *msg,...)
void IDSetLight (const ILightVectorProperty *l, const char *msg,...)
void IDSetBLOB (const IBLOBVectorProperty *b, const char *msg,...)
void IDMessage (const char *dev, const char *msg,...)
void IDDelete (const char *dev, const char *name, const char *msg,...)
void IDLog (const char *msg,...)
void IDSnoopDevice (const char *snooped_device, char *snooped_property)
void IDSnoopBLOBs (const char *snooped_device, BLOBHandling bh)
int IEAddCallback (int readfiledes, IE_CBF *fp, void *userpointer)
void IERmCallback (int callbackid)
int IEAddTimer (int millisecs, IE_TCF *fp, void *userpointer)
void IERmTimer (int timerid)
int IEAddWorkProc (IE_WPF *fp, void *userpointer)
void IERmWorkProc (int workprocid)
int IEDeferLoop (int maxms, int *flagp)
int IEDeferLoop0 (int maxms, int *flagp)
IText * IUFindText (const ITextVectorProperty *tp, const char *name)
INumber * IUFindNumber (const INumberVectorProperty *tp, const char *name)
ISwitch * IUFindSwitch (const ISwitchVectorProperty *tp, const char *name)
ISwitch * IUFindOnSwitch (const ISwitchVectorProperty *tp)
void IUResetSwitch (ISwitchVectorProperty *svp)
int IUUpdateSwitch (ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
int IUUpdateNumber (INumberVectorProperty *nvp, double values[], char *names[], int n)
int IUUpdateText (ITextVectorProperty *tvp, char *texts[], char *names[], int n)
void IUUpdateMinMax (const INumberVectorProperty *nvp)
void IUSaveText (IText *tp, const char *newtext)
void IUFillSwitch (ISwitch *sp, const char *name, const char *label, ISState s)
void IUFillLight (ILight *lp, const char *name, const char *label, IPState s)
void IUFillNumber (INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
void IUFillText (IText *tp, const char *name, const char *label, const char *initialText)
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)
void IUFillLightVector (ILightVectorProperty *lvp, ILight *lp, int nlp, const char *dev, const char *name, const char *label, const char *group, IPState s)
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)
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)
int IUSnoopNumber (XMLEle *root, INumberVectorProperty *nvp)
int IUSnoopText (XMLEle *root, ITextVectorProperty *tvp)
int IUSnoopLight (XMLEle *root, ILightVectorProperty *lvp)
int IUSnoopSwitch (XMLEle *root, ISwitchVectorProperty *svp)
int IUSnoopBLOB (XMLEle *root, IBLOBVectorProperty *bvp)
void ISGetProperties (const char *dev)
void ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
void ISNewNumber (const char *dev, const char *name, double *doubles, char *names[], int n)
void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
void ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
void ISSnoopDevice (XMLEle *root)

Define Documentation

#define INDI_UNUSED ( x   )     (void) x

Definition at line 706 of file indidevapi.h.

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal