Instrument Neutral Distributed Interface INDI  1.9.2
Namespaces | Functions | Variables
defaultdevice.cpp File Reference
#include "defaultdevice.h"
#include "defaultdevice_p.h"
#include "indicom.h"
#include "indiapi.h"
#include "indistandardproperty.h"
#include "connectionplugins/connectionserial.h"
#include <cstdlib>
#include <cstring>
#include <assert.h>
#include <algorithm>

Go to the source code of this file.

Namespaces

 INDI
 Namespace to encapsulate INDI client, drivers, and mediator classes.
 

Functions

void ISGetProperties (const char *dev)
 Get Device Properties. 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 ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 
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 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...
 
void timerfunc (void *t)
 

Variables

const char * COMMUNICATION_TAB = "Communication"
 COMMUNICATION_TAB Where all the properties required to connect/disconnect from a device are located. Usually such properties may include port number, IP address, or any property necessarily to establish a connection to the device. More...
 
const char * MAIN_CONTROL_TAB = "Main Control"
 MAIN_CONTROL_TAB Where all the primary controls for the device are located. More...
 
const char * CONNECTION_TAB = "Connection"
 CONNECTION_TAB Where all device connection settings (serial, usb, ethernet) are defined and controlled. More...
 
const char * MOTION_TAB = "Motion Control"
 MOTION_TAB Where all the motion control properties of the device are located. More...
 
const char * DATETIME_TAB = "Date/Time"
 DATETIME_TAB Where all date and time setting properties are located. More...
 
const char * SITE_TAB = "Site Management"
 SITE_TAB Where all site information setting are located. More...
 
const char * OPTIONS_TAB = "Options"
 OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls, driver metadata, version information..etc. More...
 
const char * FILTER_TAB = "Filter Wheel"
 FILTER_TAB Where all the properties for filter wheels are located. More...
 
const char * FOCUS_TAB = "Focuser"
 FOCUS_TAB Where all the properties for focuser are located. More...
 
const char * GUIDE_TAB = "Guide"
 GUIDE_TAB Where all the properties for guiding are located. More...
 
const char * ALIGNMENT_TAB = "Alignment"
 ALIGNMENT_TAB Where all the properties for guiding are located. More...
 
const char * SATELLITE_TAB = "Satellite"
 SATELLITE_TAB. More...
 
const char * INFO_TAB = "General Info"
 INFO_TAB Where all the properties for general information are located. More...
 

Function Documentation

◆ ISGetProperties()

void ISGetProperties ( const char *  dev)

Get Device Properties.

Parameters
devthe 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

Parameters
devis 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 53 of file defaultdevice.cpp.

◆ ISNewBLOB()

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.

Parameters
devthe name of the device.
namethe name of the blob vector property to update.
sizesan array of base64 blob sizes in bytes before decoding.
blobsizesan array of the sizes of blobs after decoding from base64.
blobsan array of decoded data. Each blob size is found in blobsizes array.
formatsBlob data format (e.g. fits.z).
namesnames of blob members to update.
nthe number of blobs to update.
Note
You do not need to call this function, it is called by INDI when new blob values arrive from the client. e.g. BLOB element with name names[0] has data located in blobs[0] with size sizes[0] and format formats[0].

Definition at line 84 of file defaultdevice.cpp.

◆ ISNewNumber()

void ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)

Definition at line 68 of file defaultdevice.cpp.

◆ ISNewSwitch()

void ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)

Update the value of an existing switch vector property.

Parameters
devthe name of the device.
namethe name of the switch vector property to update.
statesan array of switch states.
namesparallel names to the array of switch states.
nthe dimension of states[].
Note
You do not need to call this function, it is called by INDI when new switch values arrive from the client.

Definition at line 60 of file defaultdevice.cpp.

◆ ISNewText()

void ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)

Update the value of an existing text vector property.

Parameters
devthe name of the device.
namethe name of the text vector property to update.
textsan array of text values.
namesparallel names to the array of text values.
nthe dimension of texts[].
Note
You do not need to call this function, it is called by INDI when new text values arrive from the client.

Definition at line 76 of file defaultdevice.cpp.

◆ ISSnoopDevice()

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.

Parameters
rootThe 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 94 of file defaultdevice.cpp.

◆ timerfunc()

void timerfunc ( void *  t)

Definition at line 103 of file defaultdevice.cpp.

Variable Documentation

◆ ALIGNMENT_TAB

const char* ALIGNMENT_TAB = "Alignment"

ALIGNMENT_TAB Where all the properties for guiding are located.

Definition at line 43 of file defaultdevice.cpp.

◆ COMMUNICATION_TAB

const char* COMMUNICATION_TAB = "Communication"

COMMUNICATION_TAB Where all the properties required to connect/disconnect from a device are located. Usually such properties may include port number, IP address, or any property necessarily to establish a connection to the device.

Definition at line 33 of file defaultdevice.cpp.

◆ CONNECTION_TAB

const char* CONNECTION_TAB = "Connection"

CONNECTION_TAB Where all device connection settings (serial, usb, ethernet) are defined and controlled.

Definition at line 35 of file defaultdevice.cpp.

◆ DATETIME_TAB

const char* DATETIME_TAB = "Date/Time"

DATETIME_TAB Where all date and time setting properties are located.

Definition at line 37 of file defaultdevice.cpp.

◆ FILTER_TAB

const char* FILTER_TAB = "Filter Wheel"

FILTER_TAB Where all the properties for filter wheels are located.

Definition at line 40 of file defaultdevice.cpp.

◆ FOCUS_TAB

const char* FOCUS_TAB = "Focuser"

FOCUS_TAB Where all the properties for focuser are located.

Definition at line 41 of file defaultdevice.cpp.

◆ GUIDE_TAB

const char* GUIDE_TAB = "Guide"

GUIDE_TAB Where all the properties for guiding are located.

Definition at line 42 of file defaultdevice.cpp.

◆ INFO_TAB

const char* INFO_TAB = "General Info"

INFO_TAB Where all the properties for general information are located.

Definition at line 45 of file defaultdevice.cpp.

◆ MAIN_CONTROL_TAB

const char* MAIN_CONTROL_TAB = "Main Control"

MAIN_CONTROL_TAB Where all the primary controls for the device are located.

Examples
dome.cpp.

Definition at line 34 of file defaultdevice.cpp.

◆ MOTION_TAB

const char* MOTION_TAB = "Motion Control"

MOTION_TAB Where all the motion control properties of the device are located.

Definition at line 36 of file defaultdevice.cpp.

◆ OPTIONS_TAB

const char* OPTIONS_TAB = "Options"

OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls, driver metadata, version information..etc.

Definition at line 39 of file defaultdevice.cpp.

◆ SATELLITE_TAB

const char* SATELLITE_TAB = "Satellite"

SATELLITE_TAB.

Definition at line 44 of file defaultdevice.cpp.

◆ SITE_TAB

const char* SITE_TAB = "Site Management"

SITE_TAB Where all site information setting are located.

Definition at line 38 of file defaultdevice.cpp.