|
Instrument Neutral Distributed Interface INDI 2.2.5
|
#include "defaultdevice.h"#include "defaultdevice_p.h"#include "indicom.h"#include "indiapi.h"#include "indistandardproperty.h"#include "connectionplugins/connectionserial.h"#include "indipropertyswitch.h"#include "indipropertytext.h"#include "indipropertynumber.h"#include "indipropertyblob.h"#include <algorithm>#include <assert.h>#include <cstdlib>#include <cstring>#include <pwd.h>Go to the source code of this file.
Namespaces | |
| namespace | INDI |
| Namespace to encapsulate INDI client, drivers, and mediator classes. | |
Macros | |
| #define | NICKNAME_FILE "/.indi/Nicknames.xml" |
| #define | NICK_TAG_ROOT "INDINicknames" |
| #define | NICK_TAG_DEVICE "device" |
| #define | NICK_ATTR_NAME "name" |
| #define | NICK_TAG_ENTRY "nickname" |
| #define | NICK_ATTR_ID "identifier" |
Functions | |
| void | ISGetProperties (const char *dev) |
| Get Device Properties. | |
| void | ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) |
| Update the value of an existing switch vector property. | |
| 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. | |
| 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 | 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. | |
| 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. | |
| const char * | MAIN_CONTROL_TAB = "Main Control" |
| MAIN_CONTROL_TAB Where all the primary controls for the device are located. | |
| const char * | CONNECTION_TAB = "Connection" |
| CONNECTION_TAB Where all device connection settings (serial, usb, ethernet) are defined and controlled. | |
| const char * | MOTION_TAB = "Motion Control" |
| MOTION_TAB Where all the motion control properties of the device are located. | |
| const char * | DATETIME_TAB = "Date/Time" |
| DATETIME_TAB Where all date and time setting properties are located. | |
| const char * | SITE_TAB = "Site Management" |
| SITE_TAB Where all site information setting are located. | |
| 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. | |
| const char * | FILTER_TAB = "Filter Wheel" |
| FILTER_TAB Where all the properties for filter wheels are located. | |
| const char * | FOCUS_TAB = "Focuser" |
| FOCUS_TAB Where all the properties for focuser are located. | |
| const char * | GUIDE_TAB = "Guide" |
| GUIDE_TAB Where all the properties for guiding are located. | |
| const char * | ALIGNMENT_TAB = "Alignment" |
| ALIGNMENT_TAB Where all the properties for guiding are located. | |
| const char * | SATELLITE_TAB = "Satellite" |
| SATELLITE_TAB. | |
| const char * | INFO_TAB = "General Info" |
| INFO_TAB Where all the properties for general information are located. | |
| void(* | WeakIDSetTextVA )(const ITextVectorProperty *, const char *, va_list) |
| void(* | WeakIDDefTextVA )(const ITextVectorProperty *, const char *, va_list) |
| void(* | WeakIDSetNumberVA )(const INumberVectorProperty *, const char *, va_list) |
| void(* | WeakIDDefNumberVA )(const INumberVectorProperty *, const char *, va_list) |
| void(* | WeakIDSetSwitchVA )(const ISwitchVectorProperty *, const char *, va_list) |
| void(* | WeakIDDefSwitchVA )(const ISwitchVectorProperty *, const char *, va_list) |
| void(* | WeakIDSetLightVA )(const ILightVectorProperty *, const char *, va_list) |
| void(* | WeakIDDefLightVA )(const ILightVectorProperty *, const char *, va_list) |
| void(* | WeakIDSetBLOBVA )(const IBLOBVectorProperty *, const char *, va_list) |
| void(* | WeakIDDefBLOBVA )(const IBLOBVectorProperty *, const char *, va_list) |
| int(* | WeakIUUpdateText )(ITextVectorProperty *, char *[], char *[], int) |
| int(* | WeakIUUpdateNumber )(INumberVectorProperty *, double[], char *[], int n) |
| int(* | WeakIUUpdateSwitch )(ISwitchVectorProperty *, ISState *, char *[], int n) |
| int(* | WeakIUUpdateBLOB )(IBLOBVectorProperty *, int[], int[], char *[], char *[], char *[], int n) |
| void(* | WeakIUUpdateMinMax )(const INumberVectorProperty *) |
| #define NICK_ATTR_ID "identifier" |
Definition at line 248 of file defaultdevice.cpp.
| #define NICK_ATTR_NAME "name" |
Definition at line 246 of file defaultdevice.cpp.
| #define NICK_TAG_DEVICE "device" |
Definition at line 245 of file defaultdevice.cpp.
| #define NICK_TAG_ENTRY "nickname" |
Definition at line 247 of file defaultdevice.cpp.
| #define NICK_TAG_ROOT "INDINicknames" |
Definition at line 244 of file defaultdevice.cpp.
| #define NICKNAME_FILE "/.indi/Nicknames.xml" |
Nicknames are stored in an xml-format NICKNAME_FILE in a format like the below. Nicknames are assoicated with a driver and stable device identifier.
The device identifier must be stable across boots and not dependent on which port the device is plugged into. Usually this will be some form of serial number of the device, but specifics are left up to each driver.
Since each identifier is per-driver, devices from different drivers can share the same nickname. The INDI framework must not try to interpret the identifier, only compare for equality.
Since the device-name can't be changed once the driver is running, changes to nicknames can only take effect at the next INDI startup.
The NicknameTP should be added with addNicknameControl().
<INDINicknames> <device name="AcmeFocuser"> <nickname identifier="SN123">MainScope</nickname> <nickname identifier="SN456">GuideScope</nickname> </device> <device name="AcmeDustCap"> <nickname identifier="CAP-1-2-3">MainScope</nickname> </device> </INDINicknames>
Definition at line 243 of file defaultdevice.cpp.
| 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 59 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 90 of file defaultdevice.cpp.
| void ISNewNumber | ( | const char * | dev, |
| const char * | name, | ||
| double | values[], | ||
| char * | names[], | ||
| int | n | ||
| ) |
Definition at line 74 of file defaultdevice.cpp.
| 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 66 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 82 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 100 of file defaultdevice.cpp.
| void timerfunc | ( | void * | t | ) |
Definition at line 149 of file defaultdevice.cpp.
| const char* ALIGNMENT_TAB = "Alignment" |
ALIGNMENT_TAB Where all the properties for guiding are located.
Definition at line 49 of file defaultdevice.cpp.
| 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 39 of file defaultdevice.cpp.
| const char* CONNECTION_TAB = "Connection" |
CONNECTION_TAB Where all device connection settings (serial, usb, ethernet) are defined and controlled.
Definition at line 41 of file defaultdevice.cpp.
| const char* DATETIME_TAB = "Date/Time" |
DATETIME_TAB Where all date and time setting properties are located.
Definition at line 43 of file defaultdevice.cpp.
| const char* FILTER_TAB = "Filter Wheel" |
FILTER_TAB Where all the properties for filter wheels are located.
Definition at line 46 of file defaultdevice.cpp.
| const char* FOCUS_TAB = "Focuser" |
FOCUS_TAB Where all the properties for focuser are located.
Definition at line 47 of file defaultdevice.cpp.
| const char* GUIDE_TAB = "Guide" |
GUIDE_TAB Where all the properties for guiding are located.
Definition at line 48 of file defaultdevice.cpp.
| const char* INFO_TAB = "General Info" |
INFO_TAB Where all the properties for general information are located.
Definition at line 51 of file defaultdevice.cpp.
| const char* MAIN_CONTROL_TAB = "Main Control" |
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
Definition at line 40 of file defaultdevice.cpp.
| const char* MOTION_TAB = "Motion Control" |
MOTION_TAB Where all the motion control properties of the device are located.
Definition at line 42 of file defaultdevice.cpp.
| 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 45 of file defaultdevice.cpp.
| const char* SATELLITE_TAB = "Satellite" |
SATELLITE_TAB.
Definition at line 50 of file defaultdevice.cpp.
| const char* SITE_TAB = "Site Management" |
SITE_TAB Where all site information setting are located.
Definition at line 44 of file defaultdevice.cpp.
|
extern |
Definition at line 30 of file indipropertyview.cpp.
|
extern |
Definition at line 28 of file indipropertyview.cpp.
|
extern |
Definition at line 24 of file indipropertyview.cpp.
|
extern |
Definition at line 26 of file indipropertyview.cpp.
|
extern |
Definition at line 22 of file indipropertyview.cpp.
|
extern |
Definition at line 29 of file indipropertyview.cpp.
|
extern |
Definition at line 27 of file indipropertyview.cpp.
|
extern |
Definition at line 23 of file indipropertyview.cpp.
|
extern |
Definition at line 25 of file indipropertyview.cpp.
|
extern |
Definition at line 21 of file indipropertyview.cpp.
|
extern |
Definition at line 34 of file indipropertyview.cpp.
|
extern |
Definition at line 35 of file indipropertyview.cpp.
|
extern |
Definition at line 32 of file indipropertyview.cpp.
|
extern |
Definition at line 33 of file indipropertyview.cpp.
|
extern |
Definition at line 31 of file indipropertyview.cpp.