baseclient.h   baseclient.h 
skipping to change at line 57 skipping to change at line 57
\author Jasem Mutlaq \author Jasem Mutlaq
*/ */
class INDI::BaseClient : public INDI::BaseMediator class INDI::BaseClient : public INDI::BaseMediator
{ {
public: public:
enum { INDI_DEVICE_NOT_FOUND=-1, INDI_PROPERTY_INVALID=-2, INDI_PROPERT Y_DUPLICATED = -3, INDI_DISPATCH_ERROR=-4 }; enum { INDI_DEVICE_NOT_FOUND=-1, INDI_PROPERTY_INVALID=-2, INDI_PROPERT Y_DUPLICATED = -3, INDI_DISPATCH_ERROR=-4 };
//typedef boost::shared_ptr<INDI::BaseDevice> devicePtr; //typedef boost::shared_ptr<INDI::BaseDevice> devicePtr;
BaseClient(); BaseClient();
~BaseClient(); virtual ~BaseClient();
/** \brief Set the server host name and port /** \brief Set the server host name and port
\param hostname INDI server host name or IP address. \param hostname INDI server host name or IP address.
\param port INDI server port. \param port INDI server port.
*/ */
void setServer(const char * hostname, unsigned int port); void setServer(const char * hostname, unsigned int port);
/** \brief Add a device to the watch list. /** \brief Add a device to the watch list.
A client may select to receive notifications of only a specific dev ice or a set of devices. A client may select to receive notifications of only a specific dev ice or a set of devices.
skipping to change at line 109 skipping to change at line 109
\returns If \e deviceName exists, it returns an instance of the de vice. Otherwise, it returns NULL. \returns If \e deviceName exists, it returns an instance of the de vice. Otherwise, it returns NULL.
*/ */
INDI::BaseDevice * getDevice(const char * deviceName); INDI::BaseDevice * getDevice(const char * deviceName);
/** \returns Returns a vector of all devices created in the client. /** \returns Returns a vector of all devices created in the client.
*/ */
const vector<INDI::BaseDevice *> & getDevices() const { return cDevices ; } const vector<INDI::BaseDevice *> & getDevices() const { return cDevices ; }
/** \brief Set Binary Large Object policy mode /** \brief Set Binary Large Object policy mode
Set the BLOB handling mode for the client. The client may either reci eve: Set the BLOB handling mode for the client. The client may either rece ive:
<ul> <ul>
<li>Only BLOBS</li> <li>Only BLOBS</li>
<li>BLOBs mixed with normal messages</li> <li>BLOBs mixed with normal messages</li>
<li>Normal messages only, no BLOBs</li> <li>Normal messages only, no BLOBs</li>
</ul> </ul>
If \e dev and \e prop are supplied, then the BLOB handling policy is set for this particular device and property. If \e dev and \e prop are supplied, then the BLOB handling policy is set for this particular device and property.
if \e prop is NULL, then the BLOB policy applies to the whole device. if \e prop is NULL, then the BLOB policy applies to the whole device.
\param blobH BLOB handling policy \param blobH BLOB handling policy
skipping to change at line 199 skipping to change at line 199
string cServer; string cServer;
unsigned int cPort; unsigned int cPort;
bool sConnected; bool sConnected;
// Parse & FILE buffers for IO // Parse & FILE buffers for IO
int sockfd; int sockfd;
LilXML *lillp; /* XML parser context */ LilXML *lillp; /* XML parser context */
FILE *svrwfp; /* FILE * to talk to server */ FILE *svrwfp; /* FILE * to talk to server */
int m_receiveFd;
int m_sendFd;
}; };
#endif // INDIBASECLIENT_H #endif // INDIBASECLIENT_H
 End of changes. 3 change blocks. 
2 lines changed or deleted 5 lines changed or added


 basedevice.h   basedevice.h 
skipping to change at line 36 skipping to change at line 36
#include "indidevapi.h" #include "indidevapi.h"
#include "indibase.h" #include "indibase.h"
#include "indiproperty.h" #include "indiproperty.h"
#define MAXRBUF 2048 #define MAXRBUF 2048
/** /**
* \class INDI::BaseDevice * \class INDI::BaseDevice
\brief Class to provide basic INDI device functionality. \brief Class to provide basic INDI device functionality.
INDI::BaseClient contains a vector list of INDI::BaseDrivers. Upon conne INDI::BaseDevice is the base device for all INDI devices and contains a
ction with INDI server, the client create a INDI::BaseDevice list of all properties defined by the device either explicity or via a skel
\e instance for each driver owned by the INDI server. Properties of the eton file.
driver can be built either by loading an external You don't need to subclass INDI::BaseDevice class directly, it is inheri
skeleton file that contains a list of defXXX commands, or by dynamically tied by INDI::DefaultDevice which takes care of building a standard INDI de
building properties as they arrive from the server. vice. Moreover, INDI::BaseClient
maintains a list of INDI::BaseDevice objects as they get defined from th
e INDI server, and those objects may be accessed to retrieve information on
the object properties or message log.
\author Jasem Mutlaq \author Jasem Mutlaq
*/ */
class INDI::BaseDevice class INDI::BaseDevice
{ {
public: public:
BaseDevice(); BaseDevice();
~BaseDevice(); ~BaseDevice();
/*! INDI error codes. */ /*! INDI error codes. */
skipping to change at line 97 skipping to change at line 97
void * getRawProperty(const char *name, INDI_TYPE type = INDI_UNKNOWN); void * getRawProperty(const char *name, INDI_TYPE type = INDI_UNKNOWN);
/** \brief Return a property and its type given its name. /** \brief Return a property and its type given its name.
\param name of property to be found. \param name of property to be found.
\param type of property found. \param type of property found.
\return If property is found, it is returned. To be used you must u se static_cast with given the type of property \return If property is found, it is returned. To be used you must u se static_cast with given the type of property
returned. returned.
*/ */
INDI::Property * getProperty(const char *name, INDI_TYPE type = INDI_UN KNOWN); INDI::Property * getProperty(const char *name, INDI_TYPE type = INDI_UN KNOWN);
/** \brief Return a list of all properties in the device.
*/
std::vector<INDI::Property *> * getProperties() { return &pAll; }
/** \brief Build driver properties from a skeleton file. /** \brief Build driver properties from a skeleton file.
\param filename full path name of the file. \param filename full path name of the file.
A skeloton file defines the properties supported by this driver. It is a list of defXXX elements enclosed by @<INDIDriver>@ A skeloton file defines the properties supported by this driver. It is a list of defXXX elements enclosed by @<INDIDriver>@
and @</INDIDriver>@ opening and closing tags. After the properties are cre ated, they can be rerieved, manipulated, and defined and @</INDIDriver>@ opening and closing tags. After the properties are cre ated, they can be rerieved, manipulated, and defined
to other clients. to other clients.
\see An example skeleton file can be found under examples/tutorial_four_sk .xml \see An example skeleton file can be found under examples/tutorial_four_sk .xml
*/ */
skipping to change at line 140 skipping to change at line 144
/** \return Returns last message message. */ /** \return Returns last message message. */
const char * lastMessage(); const char * lastMessage();
/** \brief Set the driver's mediator to receive notification of news de vices and updated property values. */ /** \brief Set the driver's mediator to receive notification of news de vices and updated property values. */
void setMediator(INDI::BaseMediator *med) { mediator = med; } void setMediator(INDI::BaseMediator *med) { mediator = med; }
/** \returns Get the meditator assigned to this driver */ /** \returns Get the meditator assigned to this driver */
INDI::BaseMediator * getMediator() { return mediator; } INDI::BaseMediator * getMediator() { return mediator; }
/** \return driver name
* \note This can only be valid if DRIVER_INFO is defined by the drive
r.
**/
const char *getDriverName();
/** \return driver executable name
* \note This can only be valid if DRIVER_INFO is defined by the drive
r.
**/
const char *getDriverExec();
protected: protected:
/** \brief Build a property given the supplied XML element (defXXX) /** \brief Build a property given the supplied XML element (defXXX)
\param root XML element to parse and build. \param root XML element to parse and build.
\param errmsg buffer to store error message in parsing fails. \param errmsg buffer to store error message in parsing fails.
\return 0 if parsing is successful, -1 otherwise and errmsg is set */ \return 0 if parsing is successful, -1 otherwise and errmsg is set */
int buildProp(XMLEle *root, char *errmsg); int buildProp(XMLEle *root, char *errmsg);
/** \brief handle SetXXX commands from client */ /** \brief handle SetXXX commands from client */
int setValue (XMLEle *root, char * errmsg); int setValue (XMLEle *root, char * errmsg);
 End of changes. 3 change blocks. 
6 lines changed or deleted 25 lines changed or added


 defaultdevice.h   defaultdevice.h 
skipping to change at line 50 skipping to change at line 50
drivers directly as it is linked with main(). Virtual drivers cannot employ INDI::DefaultDevice. drivers directly as it is linked with main(). Virtual drivers cannot employ INDI::DefaultDevice.
INDI::DefaultDevice provides capability to add Debug, Simulation, and Co nfiguration controls. These controls (switches) are INDI::DefaultDevice provides capability to add Debug, Simulation, and Co nfiguration controls. These controls (switches) are
defined to the client. Configuration options permit saving and loading o f AS-IS property values. defined to the client. Configuration options permit saving and loading o f AS-IS property values.
\see <a href='tutorial__four_8h_source.html'>Tutorial Four</a> \see <a href='tutorial__four_8h_source.html'>Tutorial Four</a>
\author Jasem Mutlaq \author Jasem Mutlaq
*/ */
class INDI::DefaultDevice : public INDI::BaseDevice class INDI::DefaultDevice : public INDI::BaseDevice
{ {
public: public:
DefaultDevice(); DefaultDevice();
virtual ~DefaultDevice(); virtual ~DefaultDevice();
/** \brief Add Debug, Simulation, and Configuration options to the driv er */ /** \brief Add Debug, Simulation, and Configuration options to the driv er */
void addAuxControls(); void addAuxControls();
/** \brief Add Debug control to the driver */ /** \brief Add Debug control to the driver */
void addDebugControl(); void addDebugControl();
skipping to change at line 127 skipping to change at line 128
int SetTimer(int ms); int SetTimer(int ms);
/** \brief Remove timer added with SetTimer /** \brief Remove timer added with SetTimer
\param id ID of the timer as returned from SetTimer \param id ID of the timer as returned from SetTimer
*/ */
void RemoveTimer(int id); void RemoveTimer(int id);
/** \brief Callback function to be called once SetTimer duration elapse s. */ /** \brief Callback function to be called once SetTimer duration elapse s. */
virtual void TimerHit(); virtual void TimerHit();
protected: /** \return driver name (executable filename) */
virtual const char *getDriverName() { return me; }
/** \brief Set driver version information to be defined in DRIVER_INFO
property as vMajor.vMinor
* \param vMajor major revision number
* \param vMinor minor revision number
*/
void setVersion(unsigned int vMajor, unsigned int vMinor) { majorVersio
n = vMajor; minorVersion = vMinor;}
/** \return Major driver version number. */
unsigned int getMajorVersion() { return majorVersion;}
/** \return Minor driver version number. */
unsigned int getMinorVersion() { return minorVersion;}
/** \brief define the driver's properties to the client. /** \brief define the driver's properties to the client.
\param dev name of the device \param dev name of the device
\note This function is called by the INDI framework, do not call it d irectly. \note This function is called by the INDI framework, do not call it d irectly.
*/ */
virtual void ISGetProperties (const char *dev); virtual void ISGetProperties (const char *dev);
/** \brief Process the client newSwitch command /** \brief Process the client newSwitch command
\note This function is called by the INDI framework, do not call it d irectly. \note This function is called by the INDI framework, do not call it d irectly.
\returns True if any property was successfully processed, false other wise. \returns True if any property was successfully processed, false other wise.
skipping to change at line 165 skipping to change at line 179
\returns True if any property was successfully processed, false other wise. \returns True if any property was successfully processed, false other wise.
*/ */
virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) { r eturn false;} virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) { r eturn false;}
/** \brief Process a snoop event from INDI server. This function is cal led when a snooped property is updated in a snooped driver. /** \brief Process a snoop event from INDI server. This function is cal led when a snooped property is updated in a snooped driver.
\note This function is called by the INDI framework, do not call it d irectly. \note This function is called by the INDI framework, do not call it d irectly.
\returns True if any property was successfully processed, false other wise. \returns True if any property was successfully processed, false other wise.
*/ */
virtual bool ISSnoopDevice (XMLEle *root) { return false;} virtual bool ISSnoopDevice (XMLEle *root) { return false;}
protected:
// Configuration // Configuration
/** \brief Load the last saved configuration file /** \brief Load the last saved configuration file
\return True if successful, false otherwise. \return True if successful, false otherwise.
*/ */
virtual bool loadConfig(); virtual bool loadConfig();
/** \brief Save the current properties in a configuration file /** \brief Save the current properties in a configuration file
\return True if successful, false otherwise. \return True if successful, false otherwise.
*/ */
skipping to change at line 207 skipping to change at line 223
\param enable If true, the Simulation option is set to ON. \param enable If true, the Simulation option is set to ON.
*/ */
void setSimulation(bool enable); void setSimulation(bool enable);
/** \return True if Debug is on, False otherwise. */ /** \return True if Debug is on, False otherwise. */
bool isDebug(); bool isDebug();
/** \return True if Simulation is on, False otherwise. */ /** \return True if Simulation is on, False otherwise. */
bool isSimulation(); bool isSimulation();
// These are the properties we define, that are generic to pretty much
all devices
// They are public to make them available to all dervied classes and t
hier children
ISwitchVectorProperty *ConnectionSP;
ISwitch ConnectionS[2];
/** \brief Initilize properties initial state and value. The child clas s must implement this function. /** \brief Initilize properties initial state and value. The child clas s must implement this function.
\return True if initilization is successful, false otherwise. \return True if initilization is successful, false otherwise.
*/ */
virtual bool initProperties(); virtual bool initProperties();
/** \brief updateProperties is called whenever there is a change in the CONNECTION status of the driver. /** \brief updateProperties is called whenever there is a change in the CONNECTION status of the driver.
This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver
may only define a set of properties after a device is connected, bu t not before. may only define a set of properties after a device is connected, bu t not before.
\return True if update is successful, false otherwise. \return True if update is successful, false otherwise.
*/ */
skipping to change at line 241 skipping to change at line 252
routine in the function. routine in the function.
\return True if disconnection from a device is successful, false ot herwise. \return True if disconnection from a device is successful, false ot herwise.
*/ */
virtual bool Disconnect()=0; virtual bool Disconnect()=0;
/** \return Default name of the device. */ /** \return Default name of the device. */
virtual const char *getDefaultName()=0; virtual const char *getDefaultName()=0;
private: private:
bool isInit;
bool pDebug; bool pDebug;
bool pSimulation; bool pSimulation;
unsigned int majorVersion;
unsigned int minorVersion;
ISwitch DebugS[2]; ISwitch DebugS[2];
ISwitch SimulationS[2]; ISwitch SimulationS[2];
ISwitch ConfigProcessS[3]; ISwitch ConfigProcessS[3];
ISwitch ConnectionS[2];
ISwitchVectorProperty DebugSP;
ISwitchVectorProperty SimulationSP;
ISwitchVectorProperty ConfigProcessSP;
ISwitchVectorProperty ConnectionSP;
ISwitchVectorProperty *DebugSP; IText DriverInfoT[3];
ISwitchVectorProperty *SimulationSP; ITextVectorProperty DriverInfoTP;
ISwitchVectorProperty *ConfigProcessSP;
}; };
#endif // INDIDEFAULTDRIVER_H #endif // INDIDEFAULTDRIVER_H
 End of changes. 8 change blocks. 
11 lines changed or deleted 31 lines changed or added


 indiapi.h   indiapi.h 
skipping to change at line 25 skipping to change at line 25
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-13 01 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-13 01 USA
#endif #endif
#ifndef INDI_API_H #ifndef INDI_API_H
#define INDI_API_H #define INDI_API_H
/** \mainpage Instrument Neutral Distributed Interface INDI /** \mainpage Instrument Neutral Distributed Interface INDI
\section Introduction *
\section Introduction
INDI is a simple XML-like communications protocol described for interac tive and automated remote control of diverse instrumentation.\n INDI is a simple XML-like communications protocol described for interactiv e and automated remote control of diverse instrumentation.\n
INDI is small, easy to parse, and stateless. In the INDI paradigm each Dev ice poses all command and status functions in terms of settings and getting Properties. Each Property is a vector of one or more names members. Each p roperty has a current value vector; a target value vector; provides informa tion about how it should be sequenced with respect to other Properties to a ccomplish one coordinated unit of observation; and provides hints as to how it might be displayed for interactive manipulation in a GUI.\n INDI is small, easy to parse, and stateless. In the INDI paradigm each Dev ice poses all command and status functions in terms of settings and getting Properties. Each Property is a vector of one or more names members. Each p roperty has a current value vector; a target value vector; provides informa tion about how it should be sequenced with respect to other Properties to a ccomplish one coordinated unit of observation; and provides hints as to how it might be displayed for interactive manipulation in a GUI.\n
Clients learn the Properties of a particular Device at runtime using intro spection. This decouples Client and Device implementation histories. Device s have a complete authority over whether to accept commands from Clients. I NDI accommadates intermediate servers, broadcasting, and connection topolog ies ranging from one-to-one on a single system to many-to-many between syst ems of different genre.\n Clients learn the Properties of a particular Device at runtime using intro spection. This decouples Client and Device implementation histories. Device s have a complete authority over whether to accept commands from Clients. I NDI accommadates intermediate servers, broadcasting, and connection topolog ies ranging from one-to-one on a single system to many-to-many between syst ems of different genre.\n
The INDI protocol can be nested within other XML elements such as constrai nts for automatic scheduling and execution.\n The INDI protocol can be nested within other XML elements such as constrai nts for automatic scheduling and execution.\n
For a complete review on the INDI protocol, please refer to the INDI <a hr ef="http://www.clearskyinstitute.com/INDI/INDI.pdf">white paper</a>. For a complete review on the INDI protocol, please refer to the INDI <a hr ef="http://www.clearskyinstitute.com/INDI/INDI.pdf">white paper</a>.
\section Audience Intended Audience \section Audience Intended Audience
INDI is intended for developers who seek a scalable API for device control and automation. Hardware drivers written under INDI can be used under any I NDI-compatible client. INDI serves as a backend only, you need frontend cli ents to control devices. Current clients include <a href="http://edu.kde.or g/kstars">KStars</a>, <a href="http://www.clearyskyinstitute.com/xephem">Xe phem</a>, <a href="http://pygtkindiclient.sourceforge.net/">DCD</a>, and <a href="http://www.stargazing.net/astropc">Cartes du Ciel</a>. INDI is intended for developers who seek a scalable API for device control and automation. Hardware drivers written under INDI can be used under any I NDI-compatible client. INDI serves as a backend only, you need frontend cli ents to control devices. Current clients include <a href="http://edu.kde.or g/kstars">KStars</a>, <a href="http://www.clearyskyinstitute.com/xephem">Xe phem</a>, <a href="http://pygtkindiclient.sourceforge.net/">DCD</a>, and <a href="http://www.stargazing.net/astropc">Cartes du Ciel</a>.
\section Development Developing under INDI \section Development Developing under INDI
<p>Please refere to the <a href="http://indi.sourceforge.net/index.php/Manu al">INDI Developers Manual</a> for a complete guide on INDI's driver develo pemnt framework.</p> <p>Please refere to the <a href="http://www.indilib.org/develop/developer-m anual">INDI Developers Manual</a> for a complete guide on INDI's driver dev elopemnt framework.</p>
<p>The INDI Library API is divided into the following main sections:</p> <p>The INDI Library API is divided into the following main sections:</p>
<ul> <ul>
<li><a href="indidevapi_8h.html">INDI Device API</a></li> <li><a href="indidevapi_8h.html">INDI Device API</a></li>
<li><a href="classINDI_1_1BaseClient.html">INDI Client API</a></li> <li><a href="classINDI_1_1BaseClient.html">INDI Client API</a></li>
<li><a href="namespaceINDI.html">INDI Base Drivers</a></li> <li><a href="namespaceINDI.html">INDI Base Drivers</a></li>
<li><a href="indicom_8h.html">INDI Common Routine Library</a></li> <li><a href="indicom_8h.html">INDI Common Routine Library</a></li>
<li><a href="lilxml_8h.html">INDI LilXML Library</a></li> <li><a href="lilxml_8h.html">INDI LilXML Library</a></li>
<li><a href="group__configFunctions.html">Configuration</a></li> <li><a href="group__configFunctions.html">Configuration</a></li>
</ul> </ul>
\section Help \section Help
You can find information on INDI development in the <a href="http://indi.sf .net">INDI sourceforge</a> site. Furthermore, you can discuss INDI related issues on the <a href="http://sourceforge.net/mail/?group_id=90275">INDI de velopment mailing list</a>. You can find information on INDI development in the <a href="http://www.ind ilib.org">INDI Library</a> site. Furthermore, you can discuss INDI related issues on the <a href="http://sourceforge.net/mail/?group_id=90275">INDI de velopment mailing list</a>.
\author Elwood Downey \author Elwood Downey
\author Jasem Mutlaq \author Jasem Mutlaq
*/ */
/** \file indiapi.h /** \file indiapi.h
\brief Constants and Data structure definitions for the interface to th e reference INDI C API implementation. \brief Constants and Data structure definitions for the interface to th e reference INDI C API implementation.
\author Elwood C. Downey \author Elwood C. Downey
*/ */
 End of changes. 4 change blocks. 
4 lines changed or deleted 5 lines changed or added


 indibase.h   indibase.h 
skipping to change at line 30 skipping to change at line 30
<li>DefaultDriver: INDI::BaseDriver with extended functionality such as debug, simulation, and configuration support. <li>DefaultDriver: INDI::BaseDriver with extended functionality such as debug, simulation, and configuration support.
It is \e only used by drivers directly, it cannot be used by clients .</li> It is \e only used by drivers directly, it cannot be used by clients .</li>
<li>FilterInterface: Basic interface for filter wheels functions.</li> <li>FilterInterface: Basic interface for filter wheels functions.</li>
<li>GuiderInterface: Basic interface for guider (ST4) port functions.</l i> <li>GuiderInterface: Basic interface for guider (ST4) port functions.</l i>
<li>CCD: Base class for CCD drivers. Provides basic support for single c hip CCD and CCDs with a guide head as well.</li> <li>CCD: Base class for CCD drivers. Provides basic support for single c hip CCD and CCDs with a guide head as well.</li>
<li>Telescope: Base class for telescope drivers.</li> <li>Telescope: Base class for telescope drivers.</li>
<li>FilterWheel: Base class for Filter Wheels. It implements the FilterI nterface.</li> <li>FilterWheel: Base class for Filter Wheels. It implements the FilterI nterface.</li>
<li>Focuser: Base class for focusers.</li> <li>Focuser: Base class for focusers.</li>
<li>USBDevice: Base class for USB devices for direct read/write/control over USB.</li> <li>USBDevice: Base class for USB devices for direct read/write/control over USB.</li>
</ul> </ul>
\author Jasem Mutlaq
\author Gerry Rozema
*/ */
namespace INDI namespace INDI
{ {
class BaseMediator; class BaseMediator;
class BaseClient; class BaseClient;
class BaseDevice; class BaseDevice;
class DefaultDevice; class DefaultDevice;
class FilterInterface; class FilterInterface;
class GuiderInterface; class GuiderInterface;
class CCD; class CCD;
skipping to change at line 67 skipping to change at line 69
/** /**
* \class INDI::BaseMediator * \class INDI::BaseMediator
\brief Meditates event notification as generated by driver and passed to clients. \brief Meditates event notification as generated by driver and passed to clients.
*/ */
class INDI::BaseMediator class INDI::BaseMediator
{ {
public: public:
/** \brief Emmited when a new device is created from INDI server. /** \brief Emmited when a new device is created from INDI server.
\param device_name Name of the new device \param dp Pointer to the base device instance
*/ */
virtual void newDevice(INDI::BaseDevice *dp) =0; virtual void newDevice(INDI::BaseDevice *dp) =0;
/** \brief Emmited when a new property is created for an INDI driver. /** \brief Emmited when a new property is created for an INDI driver.
\param property Pointer to the Property Container \param property Pointer to the Property Container
*/ */
virtual void newProperty(INDI::Property *property) =0; virtual void newProperty(INDI::Property *property) =0;
/** \brief Emmited when a property is deleted for an INDI driver. /** \brief Emmited when a property is deleted for an INDI driver.
skipping to change at line 110 skipping to change at line 112
*/ */
virtual void newText(ITextVectorProperty *tvp) =0; virtual void newText(ITextVectorProperty *tvp) =0;
/** \brief Emmited when a new light value arrives from INDI server. /** \brief Emmited when a new light value arrives from INDI server.
\param lvp Pointer to a light vector property. \param lvp Pointer to a light vector property.
*/ */
virtual void newLight(ILightVectorProperty *lvp) =0; virtual void newLight(ILightVectorProperty *lvp) =0;
/** \brief Emmited when a new message arrives from INDI server. /** \brief Emmited when a new message arrives from INDI server.
\param dp pointer to the INDI device the message is sent to. \param dp pointer to the INDI device the message is sent to.
\param messageID ID of the message that can be used to retrieve the message from the device's messageQueue() function.
*/ */
virtual void newMessage(INDI::BaseDevice *dp) =0; virtual void newMessage(INDI::BaseDevice *dp, int messageID) =0;
/** \brief Emmited when the server is connected. /** \brief Emmited when the server is connected.
*/ */
virtual void serverConnected() =0; virtual void serverConnected() =0;
/** \brief Emmited when the server gets disconnected. /** \brief Emmited when the server gets disconnected.
\param exit_code 0 if client was requested to disconnect from serve r. -1 if connection to server is terminated due to remote server disconnect ion. \param exit_code 0 if client was requested to disconnect from serve r. -1 if connection to server is terminated due to remote server disconnect ion.
*/ */
virtual void serverDisconnected(int exit_code) =0; virtual void serverDisconnected(int exit_code) =0;
virtual ~BaseMediator() {}
}; };
#endif // INDIBASE_H #endif // INDIBASE_H
 End of changes. 5 change blocks. 
2 lines changed or deleted 8 lines changed or added


 indiccd.h   indiccd.h 
skipping to change at line 23 skipping to change at line 23
You should have received a copy of the GNU Library General Public License You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*************************************************************************** ****/ *************************************************************************** ****/
#ifndef INDI_CCD_H #ifndef INDI_CCD_H
#define INDI_CCD_H #define INDI_CCD_H
#include <fitsio.h> #include <fitsio.h>
#include <string.h>
#include "defaultdevice.h" #include "defaultdevice.h"
#include "indiguiderinterface.h" #include "indiguiderinterface.h"
extern const char *IMAGE_SETTINGS_TAB; extern const char *IMAGE_SETTINGS_TAB;
extern const char *IMAGE_INFO_TAB; extern const char *IMAGE_INFO_TAB;
extern const char *GUIDE_HEAD_TAB; extern const char *GUIDE_HEAD_TAB;
extern const char *GUIDE_CONTROL_TAB; extern const char *GUIDE_CONTROL_TAB;
class CCDChip class CCDChip
{ {
public: public:
CCDChip(); CCDChip();
~CCDChip(); ~CCDChip();
typedef enum { LIGHT_FRAME=0, BIAS_FRAME, DARK_FRAME, FLAT_FRAME } CCD_ FRAME; typedef enum { LIGHT_FRAME=0, BIAS_FRAME, DARK_FRAME, FLAT_FRAME } CCD_ FRAME;
typedef enum { FRAME_X, FRAME_Y, FRAME_W, FRAME_H} CCD_FRAME_INDEX;
int getXRes() { return XRes; } typedef enum { BIN_W, BIN_H} CCD_BIN_INDEX;
int getYRes() { return YRes; } typedef enum { CCD_MAX_X, CCD_MAX_Y, CCD_PIXEL_SIZE, CCD_PIXEL_SIZE_X,
int getSubX() { return SubX; } CCD_PIXEL_SIZE_Y, CCD_BITSPERPIXEL} CCD_INFO_INDEX;
int getSubY() { return SubY; }
int getSubW() { return SubW; } inline int getXRes() { return XRes; }
int getSubH() { return SubH; } inline int getYRes() { return YRes; }
int getBinX() { return BinX; } inline int getSubX() { return SubX; }
int getBinY() { return BinY; } inline int getSubY() { return SubY; }
int getPixelSizeX() { return PixelSizex; } inline int getSubW() { return SubW; }
int getPixelSizeY() { return PixelSizey; } inline int getSubH() { return SubH; }
int getBPP() { return BPP; } inline int getBinX() { return BinX; }
int getFrameBufferSize() { return RawFrameSize; } inline int getBinY() { return BinY; }
double getExposure() { return ImageExposureN[0].value; } inline float getPixelSizeX() { return PixelSizex; }
char *getFrameBuffer() { return RawFrame; } inline float getPixelSizeY() { return PixelSizey; }
bool isCompressed() { return SendCompressed; } inline int getBPP() { return BPP; }
bool isInterlaced() { return Interlaced; } inline int getFrameBufferSize() { return RawFrameSize; }
CCD_FRAME getFrameType() { return FrameType; } inline double getExposureLeft() { return ImageExposureN[0].value; }
inline double getExposureDuration() { return exposureDuration; }
inline char *getFrameBuffer() { return RawFrame; }
inline bool isCompressed() { return SendCompressed; }
inline bool isInterlaced() { return Interlaced; }
inline CCD_FRAME getFrameType() { return FrameType; }
const char *getExposureStartTime();
void setResolutoin(int x, int y); void setResolutoin(int x, int y);
void setFrame(int subx, int suby, int subw, int subh); void setFrame(int subx, int suby, int subw, int subh);
void setBin(int hor, int ver); void setBin(int hor, int ver);
void setPixelSize(int x, int y); void setPixelSize(float x, float y);
void setCompressed (bool cmp); void setCompressed (bool cmp);
void setInterlaced(bool intr); void setInterlaced(bool intr);
void setFrameBufferSize(int nbuf); void setFrameBufferSize(int nbuf);
void setBPP(int bpp); void setBPP(int bpp);
int setFrameType(CCD_FRAME); int setFrameType(CCD_FRAME);
void setExposure(double duration); void setExposureDuration(double duration);
void setExposureLeft(double duration);
void setExposureFailed(); void setExposureFailed();
private: private:
int XRes; // native resolution of the ccd int XRes; // native resolution of the ccd
int YRes; // ditto int YRes; // ditto
int SubX; // left side of the subframe we are requesting int SubX; // left side of the subframe we are requesting
int SubY; // top of the subframe requested int SubY; // top of the subframe requested
int SubW; // width of the subframe int SubW; // width of the subframe
int SubH; // height of the subframe int SubH; // height of the subframe
int BinX; // Binning requested in the x direction int BinX; // Binning requested in the x direction
int BinY; // Binning requested in the Y direction int BinY; // Binning requested in the Y direction
float PixelSizex; // pixel size in microns, x direction float PixelSizex; // pixel size in microns, x direction
float PixelSizey; // pixel size in microns, y direction float PixelSizey; // pixel size in microns, y direction
int BPP; // Bytes per Pixel int BPP; // Bytes per Pixel
bool Interlaced; bool Interlaced;
char *RawFrame; char *RawFrame;
int RawFrameSize; int RawFrameSize;
bool SendCompressed; bool SendCompressed;
CCD_FRAME FrameType; CCD_FRAME FrameType;
double exposureDuration;
timeval startExposureTime;
INumberVectorProperty *ImageExposureNP; INumberVectorProperty *ImageExposureNP;
INumber ImageExposureN[1]; INumber ImageExposureN[1];
ISwitchVectorProperty *AbortExposureSP;
ISwitch AbortExposureS[1];
INumberVectorProperty *ImageFrameNP; INumberVectorProperty *ImageFrameNP;
INumber ImageFrameN[4]; INumber ImageFrameN[4];
INumberVectorProperty *ImageBinNP; INumberVectorProperty *ImageBinNP;
INumber ImageBinN[2]; INumber ImageBinN[2];
INumberVectorProperty *ImagePixelSizeNP; INumberVectorProperty *ImagePixelSizeNP;
INumber ImagePixelSizeN[6]; INumber ImagePixelSizeN[6];
ISwitch FrameTypeS[4]; ISwitch FrameTypeS[4];
skipping to change at line 145 skipping to change at line 157
virtual bool ISSnoopDevice (XMLEle *root); virtual bool ISSnoopDevice (XMLEle *root);
protected: protected:
/** \brief Start exposing primary CCD chip /** \brief Start exposing primary CCD chip
\param duration Duration in seconds \param duration Duration in seconds
\return 0 if OK and exposure will take some time to complete, 1 if exposure is short and complete already (e.g. bias), -1 on error. \return 0 if OK and exposure will take some time to complete, 1 if exposure is short and complete already (e.g. bias), -1 on error.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
*/ */
virtual int StartExposure(float duration); virtual int StartExposure(float duration);
/** \brief Uploads primary CCD exposed buffer as FITS to the client . Dervied classes should class this function when an exposure is complete. /** \brief Uploads target Chip exposed buffer as FITS to the client . Dervied classes should class this function when an exposure is complete.
\note This function is not implemented in INDI::CCD, it must b e implemented in the child class \note This function is not implemented in INDI::CCD, it must b e implemented in the child class
*/ */
virtual bool ExposureComplete(); virtual bool ExposureComplete(CCDChip *targetChip);
/** \brief Abort ongoing exposure /** \brief Abort ongoing exposure
\return true is abort is successful, false otherwise. \return true is abort is successful, false otherwise.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
*/ */
virtual bool AbortExposure(); virtual bool AbortExposure();
/** \brief Start exposing guide CCD chip /** \brief Start exposing guide CCD chip
\param duration Duration in seconds \param duration Duration in seconds
\return 0 if OK and exposure will take some time to complete, 1 if exposure is short and complete already (e.g. bias), -1 on error. \return 0 if OK and exposure will take some time to complete, 1 if exposure is short and complete already (e.g. bias), -1 on error.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
*/ */
virtual int StartGuideExposure(float duration); virtual int StartGuideExposure(float duration);
/** \brief Abort ongoing exposure /** \brief Abort ongoing exposure
\return true is abort is successful, false otherwise. \return true is abort is successful, false otherwise.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
*/ */
virtual bool AbortGuideExposure(); virtual bool AbortGuideExposure();
/** \brief Uploads Guide head CCD exposed buffer as FITS to the cli
ent. Dervied classes should class this function when an exposure is complet
e.
\note This function is not implemented in INDI::CCD, it must be
implemented in the child class
*/
virtual bool GuideExposureComplete();
/** \brief INDI::CCD calls this function when CCD Frame dimension n eeds to be updated in the hardware. Derived classes should implement this f unction /** \brief INDI::CCD calls this function when CCD Frame dimension n eeds to be updated in the hardware. Derived classes should implement this f unction
\param x Subframe X coordinate in pixels. \param x Subframe X coordinate in pixels.
\param y Subframe Y coordinate in pixels. \param y Subframe Y coordinate in pixels.
\param w Subframe width in pixels. \param w Subframe width in pixels.
\param h Subframe height in pixels. \param h Subframe height in pixels.
\note (0,0) is defined as most left, top pixel in the subframe. \note (0,0) is defined as most left, top pixel in the subframe.
\return true is CCD chip update is successful, false otherwise. \return true is CCD chip update is successful, false otherwise.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
*/ */
virtual bool updateCCDFrame(int x, int y, int w, int h); virtual bool updateCCDFrame(int x, int y, int w, int h);
/** \brief INDI::CCD calls this function when CCD Binning needs to be updated in the hardware. Derived classes should implement this function /** \brief INDI::CCD calls this function when CCD Binning needs to be updated in the hardware. Derived classes should implement this function
\param hor Horizontal binning. \param hor Horizontal binning.
\param ver Vertical binning. \param ver Vertical binning.
\return true is CCD chip update is successful, false otherwise. \return true is CCD chip update is successful, false otherwise.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
*/ */
virtual bool updateCCDBin(int hor, int ver); virtual bool updateCCDBin(int hor, int ver);
/** \brief INDI::CCD calls this function when CCD frame type needs
to be updated in the hardware.
\param fType Frame type
\return true is CCD chip update is successful, false otherwise.
\note It is \e not mandotary to implement this function in the
child class. The CCD hardware layer may either set the frame type when this
function
is called, or (optionally) before an exposure is started.
*/
virtual bool updateCCDFrameType(CCDChip::CCD_FRAME fType);
/** \brief Setup CCD paramters for primary CCD. Child classes call this function to update CCD paramaters /** \brief Setup CCD paramters for primary CCD. Child classes call this function to update CCD paramaters
\param x Frame X coordinates in pixels. \param x Frame X coordinates in pixels.
\param y Frame Y coordinates in pixels. \param y Frame Y coordinates in pixels.
\param bpp Bits Per Pixels. \param bpp Bits Per Pixels.
\param xf X pixel size in microns. \param xf X pixel size in microns.
\param yf Y pixel size in microns. \param yf Y pixel size in microns.
*/ */
virtual void SetCCDParams(int x,int y,int bpp,float xf,float yf); virtual void SetCCDParams(int x,int y,int bpp,float xf,float yf);
/** \brief Setup CCD paramters for guide head CCD. Child classes ca ll this function to update CCD paramaters /** \brief Setup CCD paramters for guide head CCD. Child classes ca ll this function to update CCD paramaters
skipping to change at line 241 skipping to change at line 256
/** \brief Guide westward for ms milliseconds /** \brief Guide westward for ms milliseconds
\param ms Duration in milliseconds. \param ms Duration in milliseconds.
\note This function is not implemented in INDI::CCD, it must be implemented in the child class \note This function is not implemented in INDI::CCD, it must be implemented in the child class
\return 0 if successful, -1 otherwise. \return 0 if successful, -1 otherwise.
*/ */
virtual bool GuideWest(float ms); virtual bool GuideWest(float ms);
/** \brief Add FITS keywords to a fits file /** \brief Add FITS keywords to a fits file
\param fptr pointer to a valid FITS file. \param fptr pointer to a valid FITS file.
\note This function is not implemented in INDI::CCD, it must be \param targetChip The target chip to extract the keywords from.
implemented in the child class \note In additional to the standard FITS keywords, this functio
n write the following keywords the FITS file:
<ul>
<li>EXPTIME: Total Exposure Time (s)</li>
<li>DARKTIME (if applicable): Total Exposure Time (s)</li>
<li>PIXSIZE1: Pixel Size 1 (microns)</li>
<li>PIXSIZE2: Pixel Size 2 (microns)</li>
<li>BINNING: Binning HOR x VER</li>
<li>FRAME: Frame Type</li>
<li>DATAMIN: Minimum value</li>
<li>DATAMAX: Maximum value</li>
<li>INSTRUME: CCD Name</li>
<li>DATE-OBS: UTC start date of observation</li>
</ul>
To add additional information, override this function in the ch
ild class and ensure to call INDI::CCD::addFITSKeywords.
*/ */
virtual void addFITSKeywords(fitsfile *fptr); virtual void addFITSKeywords(fitsfile *fptr, CCDChip *targetChip);
/* A function to just remove GCC warnings about deprecated conversi
on */
void fits_update_key_s(fitsfile* fptr, int type, std::string name,
void* p, std::string explanation, int* status);
virtual bool saveConfigItems(FILE *fp);
float RA; float RA;
float Dec; float Dec;
bool HasGuideHead; bool HasGuideHead;
bool HasSt4Port; bool HasSt4Port;
bool InExposure; bool InExposure;
CCDChip PrimaryCCD; CCDChip PrimaryCCD;
CCDChip GuideCCD; CCDChip GuideCCD;
private: // We are going to snoop these from a telescope
// We are going to snoop these from a telescope INumberVectorProperty EqNP;
INumberVectorProperty EqNP; INumber EqN[2];
INumber EqN[2];
ITextVectorProperty *ActiveDeviceTP; ITextVectorProperty *ActiveDeviceTP;
IText ActiveDeviceT[2]; IText ActiveDeviceT[2];
int uploadfile(void *fitsdata,int total); private:
void getMinMax(double *min, double *max, CCDChip *targetChip);
}; };
#endif // INDI:CCD_H #endif // INDI:CCD_H
 End of changes. 15 change blocks. 
40 lines changed or deleted 79 lines changed or added


 indidevapi.h   indidevapi.h 
skipping to change at line 28 skipping to change at line 28
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-13 01 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-13 01 USA
#endif #endif
#ifndef INDI_DEVAPI_H #ifndef INDI_DEVAPI_H
#define INDI_DEVAPI_H #define INDI_DEVAPI_H
/** \file indidevapi.h /** \file indidevapi.h
\brief Interface to the reference INDI C API device implementation on t he Device Driver side. \brief Interface to the reference INDI C API device implementation on t he Device Driver side.
\author Elwood C. Downey *
\author Jasem Mutlaq \author Elwood C. Downey
\author Jasem Mutlaq
This file is divided into two main sections:\n This file is divided into two main sections:\n
<ol><li> Functions the INDI device driver framework defines which the <ol><li> Functions the INDI device driver framework defines which the Drive
Driver may r may
call:</li> call:</li>
<ul><li>IDxxx functions to send messages to an INDI client.</li> <ul><li>IDxxx functions to send messages to an INDI client.</li>
<li>IExxx functions to implement the event driven model.</li> <li>IExxx functions to implement the event driven model.</li>
<li>IUxxx functions to perform handy utility functions.</li></ul> <li>IUxxx functions to perform handy utility functions.</li></ul>
<li>Functions the INDI device driver framework calls which the Driver <li>Functions the INDI device driver framework calls which the Driver must
must define:</li>
define:</li>
<ul><li>ISxxx to respond to messages from a Client.</li></ul></ol> <ul><li>ISxxx to respond to messages from a Client.</li></ul></ol>
<p>These functions are the interface to the INDI C-language Device Driver <p>These functions are the interface to the INDI C-language Device Driver
reference implementation library. Any driver that uses this interface is reference implementation library. Any driver that uses this interface is
expected to #include "indidevapi.h" and to link with indidrivermain.o and expected to #include "indidevapi.h" and to link with indidrivermain.o and
eventloop.o. Indidevapi.h further includes indiapi.h. The former contains eventloop.o. Indidevapi.h further includes indiapi.h. The former contains
the prototypes for the functions documented here, although many functions the prototypes for the functions documented here, although many functions
take arguments defined in the latter.</p> take arguments defined in the latter.</p>
<p>These functions make it much easier to write a compliant INDI driver tha n <p>These functions make it much easier to write a compliant INDI driver tha n
starting from scratch, and also serve as a concrete starting from scratch, and also serve as a concrete
skipping to change at line 495 skipping to change at line 496
* \param texts a pointer to the text members * \param texts a pointer to the text members
* \param names the names of the IText members to update. * \param names the names of the IText members to update.
* \param n the number of IText members to update. * \param n the number of IText members to update.
* \return 0 if update successful, -1 otherwise. Update will fail in case of property name mismatch. * \return 0 if update successful, -1 otherwise. Update will fail in case of property name mismatch.
*/ */
extern int IUUpdateText(ITextVectorProperty *tvp, char * texts[], char *nam es[], int n); extern int IUUpdateText(ITextVectorProperty *tvp, char * texts[], char *nam es[], int n);
/** \brief Update all BLOB members in a BLOB vector property. /** \brief Update all BLOB members in a BLOB vector property.
* *
* \param bvp a pointer to a BLOB vector property. * \param bvp a pointer to a BLOB vector property.
* \param BLOBs a pointer to the BLOB members * \param sizes sizes of the blobs.
* \param blobsizes size of the blobs, raw without compression.
* \param blobs a pointer to the BLOB members
* \param names the names of the IBLOB members to update. * \param names the names of the IBLOB members to update.
* \param formats The blob format or extension.
* \param n the number of IBLOB members to update. * \param n the number of IBLOB members to update.
* \return 0 if update successful, -1 otherwise. Update will fail in case of property name mismatch. * \return 0 if update successful, -1 otherwise. Update will fail in case of property name mismatch.
*/ */
extern int IUUpdateBLOB(IBLOBVectorProperty *bvp, int sizes[], int blobsize s[], char *blobs[], char *formats[], char *names[], int n); extern int IUUpdateBLOB(IBLOBVectorProperty *bvp, int sizes[], int blobsize s[], char *blobs[], char *formats[], char *names[], int n);
/** \brief Function to save blob metadata in the corresponding blob. /** \brief Function to save blob metadata in the corresponding blob.
\param tb pointer to an IBLOB member. \param bp pointer to an IBLOB member.
\param size size of the blob buffer encoded in base64 \param size size of the blob buffer encoded in base64
\param blobsize actual size of the buffer after base64 decoding. This i s the actual byte count used in drivers. \param blobsize actual size of the buffer after base64 decoding. This i s the actual byte count used in drivers.
\param blob pointer to the blob buffer \param blob pointer to the blob buffer
\param format format of the blob buffer \param format format of the blob buffer
\note Do not call this function directly, it is called internally by IU UpdateBLOB. \note Do not call this function directly, it is called internally by IU UpdateBLOB.
*/ */
extern int IUSaveBLOB(IBLOB *bp, int size, int blobsize, char *blob, char * format); extern int IUSaveBLOB(IBLOB *bp, int size, int blobsize, char *blob, char * format);
/** \brief Function to update the min and max elements of a number in the c lient /** \brief Function to update the min and max elements of a number in the c lient
\param nvp pointer to an INumberVectorProperty. \param nvp pointer to an INumberVectorProperty.
 End of changes. 8 change blocks. 
15 lines changed or deleted 18 lines changed or added


 indidriver.h   indidriver.h 
skipping to change at line 49 skipping to change at line 49
extern int verbose; /* chatty */ extern int verbose; /* chatty */
extern char *me; /* a.out name */ extern char *me; /* a.out name */
extern LilXML *clixml; /* XML parser context */ extern LilXML *clixml; /* XML parser context */
extern int dispatch (XMLEle *root, char msg[]); extern int dispatch (XMLEle *root, char msg[]);
extern void clientMsgCB(int fd, void *arg); extern void clientMsgCB(int fd, void *arg);
/** /**
* \defgroup configFunctions Configuration Functions: Functions drivers cal l to save and load configuraion options. * \defgroup configFunctions Configuration Functions: Functions drivers cal l to save and load configuraion options.
<p>Drivers can save properties states and values in an XML configuration fi le. The following functions take an optinal filename <p>Drivers can save properties states and values in an XML configuration fi le. The following functions take an optional filename
parameter which specifies the full path of the configuration file. If the f ilename is set to NULL, the configuration file parameter which specifies the full path of the configuration file. If the f ilename is set to NULL, the configuration file
is locally stored in ~/.indi. By default, two configuration files may exist for each driver:</p> is locally stored in ~/.indi. By default, two configuration files may exist for each driver:</p>
<ul> <ul>
<li>Last Saved Configuration: ~/.indi/driver_name_config.xml</li> <li>Last Saved Configuration: ~/.indi/driver_name_config.xml</li>
<li>Default Configuration: ~/.indi/driver_name_config.xml.default</li> <li>Default Configuration: ~/.indi/driver_name_config.xml.default</li>
</ul> </ul>
<p>libindi stores the configuration parameters enclosed in newXXX commands. Therefore, if a configuration file is loaded, <p>libindi stores the configuration parameters enclosed in newXXX commands. Therefore, if a configuration file is loaded,
the driver property gets updated as if a client is setting these values. Th is is important to note since some configuration the driver property gets updated as if a client is setting these values. Th is is important to note since some configuration
options may only available when the device is powered up or is in a particu lar state.</p> options may only available when the device is powered up or is in a particu lar state.</p>
<p>If no filename is supplied, each function will try to create the configu ration files in the following order:</p> <p>If no filename is supplied, each function will try to create the configu ration files in the following order:</p>
<ol> <ol>
<li>INDICONFIG environment variable: The functions checks if the envrionmen t variable is defined, and if so, it shall <li>INDICONFIG environment variable: The functions checks if the envrionmen t variable is defined, and if so, it shall
be used as the configuration filename</li> be used as the configuration filename</li>
<li>Generate filename: If the <i>device_name</i> is supplied, the function will attempt to set the configuration filename to ~/.indi/device_name_confi g.xml</li> <li>Generate filename: If the <i>device_name</i> is supplied, the function will attempt to set the configuration filename to ~/.indi/device_name_confi g.xml</li>
</ol> </ol>
\author Jasem Mutlaq
\note Drivers subclassing INDI::DefaultDevice do not need to call the confi guration functions directly as it is handled internally by the class. \note Drivers subclassing INDI::DefaultDevice do not need to call the confi guration functions directly as it is handled internally by the class.
\version libindi 0.7+ \version libindi 0.7+
*/ */
/*@{*/ /*@{*/
/** \brief Open a configuration file for writing and return a configuration file FILE pointer. /** \brief Open a configuration file for writing and return a configuration file FILE pointer.
\param filename full path of the configuration file. If set, the functi on will attempt to open it for writing. \param filename full path of the configuration file. If set, the functi on will attempt to open it for writing.
If set to NULL, it will attempt to generate the filename as desc ribed in the <b>Detailed Description</b> introduction and then open it for writing. If set to NULL, it will attempt to generate the filename as desc ribed in the <b>Detailed Description</b> introduction and then open it for writing.
\param dev device name. This is used if the filename parameter is NULL, and INDICONFIG environment variable is not set as described in the <b>Deta iled Description</b> introduction. \param dev device name. This is used if the filename parameter is NULL, and INDICONFIG environment variable is not set as described in the <b>Deta iled Description</b> introduction.
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 indifilterinterface.h   indifilterinterface.h 
skipping to change at line 34 skipping to change at line 34
#include "indibase.h" #include "indibase.h"
/** /**
* \class INDI::FilterInterface * \class INDI::FilterInterface
\brief Provides interface to implement Filter Wheel functionality. \brief Provides interface to implement Filter Wheel functionality.
A filter wheel can be an independent device, or an embedded filter wheel within another device (e.g. CCD camera). Child class must implement all th e A filter wheel can be an independent device, or an embedded filter wheel within another device (e.g. CCD camera). Child class must implement all th e
pure virtual functions and call SelectFilterDone(int) when selection of a new filter position is complete in the hardware. pure virtual functions and call SelectFilterDone(int) when selection of a new filter position is complete in the hardware.
initFilterProperties() must be called before any other function to initi lize the filter properties. initFilterProperties() must be called before any other function to initi lize the filter properties.
\note Filter position starts from 1 and \e not 0
\author Gerry Rozema, Jasem Mutlaq \author Gerry Rozema, Jasem Mutlaq
*/ */
class INDI::FilterInterface class INDI::FilterInterface
{ {
public: public:
/** \brief Return current filter position */ /** \brief Return current filter position */
virtual int QueryFilter() = 0; virtual int QueryFilter() = 0;
skipping to change at line 77 skipping to change at line 79
FilterInterface(); FilterInterface();
~FilterInterface(); ~FilterInterface();
/** \brief Initilize filter wheel properties. It is recommended to call this function within initProperties() of your primary device /** \brief Initilize filter wheel properties. It is recommended to call this function within initProperties() of your primary device
\param deviceName Name of the primary device \param deviceName Name of the primary device
\param groupName Group or tab name to be used to define filter whee l properties. \param groupName Group or tab name to be used to define filter whee l properties.
*/ */
void initFilterProperties(const char *deviceName, const char* groupName ); void initFilterProperties(const char *deviceName, const char* groupName );
INumberVectorProperty *FilterSlotNP; // A number vector for filter s /** \brief Process client request to change filter position. Call this
lot function in the filter wheel
implementation class ISNewNumber function. This is a convenience f
unction only, you can process FilterSlotNP
in the child class.
\param name property name from ISNewNumber();
\param values values from ISNewNumber().
\param names names from ISNewNumber();
\param n n from ISNewNumber();
*/
void processFilterProperties(const char *name, double values[], char *n
ames[], int n);
INumberVectorProperty FilterSlotNP; // A number vector for filter sl
ot
INumber FilterSlotN[1]; INumber FilterSlotN[1];
ITextVectorProperty *FilterNameTP; // A text vector that stores out ph ysical port name ITextVectorProperty *FilterNameTP; // A text vector that stores out ph ysical port name
IText *FilterNameT; IText *FilterNameT;
int MinFilter; int MinFilter;
int MaxFilter; int MaxFilter;
int CurrentFilter; int CurrentFilter;
int TargetFilter; int TargetFilter;
}; };
 End of changes. 2 change blocks. 
2 lines changed or deleted 17 lines changed or added


 indifilterwheel.h   indifilterwheel.h 
skipping to change at line 46 skipping to change at line 46
protected: protected:
FilterWheel(); FilterWheel();
virtual ~FilterWheel(); virtual ~FilterWheel();
public: public:
virtual bool initProperties(); virtual bool initProperties();
virtual bool updateProperties(); virtual bool updateProperties();
virtual void ISGetProperties (const char *dev); virtual void ISGetProperties (const char *dev);
virtual bool ISSnoopDevice (XMLEle *root);
virtual bool ISNewSwitch (const char *dev, const char *name, ISStat e *states, char *names[], int n); virtual bool ISNewSwitch (const char *dev, const char *name, ISStat e *states, char *names[], int n);
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n); virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
virtual bool ISNewText (const char *dev, const char *name, char *te xts[], char *names[], int n); virtual bool ISNewText (const char *dev, const char *name, char *te xts[], char *names[], int n);
protected: protected:
virtual bool saveConfigItems(FILE *fp);
virtual int QueryFilter(); virtual int QueryFilter();
virtual bool SelectFilter(int); virtual bool SelectFilter(int);
virtual bool SetFilterNames(); virtual bool SetFilterNames();
virtual bool GetFilterNames(const char* groupName); virtual bool GetFilterNames(const char* groupName);
}; };
#endif // INDI::FilterWheel_H #endif // INDI::FilterWheel_H
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 indifocuser.h   indifocuser.h 
skipping to change at line 58 skipping to change at line 58
protected: protected:
/** \brief Move the focuser in a particular direction with a specif ic speed for a finite duration. /** \brief Move the focuser in a particular direction with a specif ic speed for a finite duration.
\param dir Direction of focuser, either FOCUS_INWARD or FOCUS_O UTWARD. \param dir Direction of focuser, either FOCUS_INWARD or FOCUS_O UTWARD.
\param speed Speed of focuser if supported by the focuser. \param speed Speed of focuser if supported by the focuser.
\param duration The timeout in milliseconds before the focus mo tion halts. \param duration The timeout in milliseconds before the focus mo tion halts.
\return True if succssfull, false otherwise. \return True if succssfull, false otherwise.
*/ */
virtual bool Move(FocusDirection dir, int speed, int duration); virtual bool Move(FocusDirection dir, int speed, int duration);
INumberVectorProperty *FocusSpeedNP; /** \brief Move the focuser to an absolute position.
\param ticks The new position of the focuser.
\return Return 0 if motion is completed and focuser reached req
uested position. Return 1 if focuser started motion to requested position a
nd is in progress.
Return -1 if there is an error.
*/
virtual int MoveAbs(int ticks);
/** \brief Move the focuser to an relative position.
\param dir Direction of focuser, either FOCUS_INWARD or FOCUS_O
UTWARD.
\param ticks The relative ticks to move.
\return Return 0 if motion is completed and focuser reached req
uested position. Return 1 if focuser started motion to requested position a
nd is in progress.
Return -1 if there is an error.
*/
virtual int MoveRel(FocusDirection dir, unsigned int ticks);
INumberVectorProperty FocusSpeedNP;
INumber FocusSpeedN[1]; INumber FocusSpeedN[1];
ISwitchVectorProperty *FocusMotionSP; // A Switch in the client in terface to park the scope ISwitchVectorProperty FocusMotionSP; // A Switch in the client int erface to park the scope
ISwitch FocusMotionS[2]; ISwitch FocusMotionS[2];
INumberVectorProperty *FocusTimerNP; INumberVectorProperty FocusTimerNP;
INumber FocusTimerN[1]; INumber FocusTimerN[1];
INumberVectorProperty FocusAbsPosNP;
INumber FocusAbsPosN[1];
INumberVectorProperty FocusRelPosNP;
INumber FocusRelPosN[1];
}; };
#endif // INDIFOCUSSER_H #endif // INDIFOCUSSER_H
 End of changes. 4 change blocks. 
3 lines changed or deleted 27 lines changed or added


 indiguiderinterface.h   indiguiderinterface.h 
skipping to change at line 30 skipping to change at line 30
#ifndef GUIDERINTERFACE_H #ifndef GUIDERINTERFACE_H
#define GUIDERINTERFACE_H #define GUIDERINTERFACE_H
#include "indibase.h" #include "indibase.h"
/** /**
* \class INDI::GuiderInterface * \class INDI::GuiderInterface
\brief Provides interface to implement guider (ST4) port functionality. \brief Provides interface to implement guider (ST4) port functionality.
initFilterProperties() must be called before any other function to initi initGuiderProperties() must be called before any other function to initi
lize the guider properties. lize the guider properties.
\author Jasem Mutlaq \author Jasem Mutlaq
*/ */
class INDI::GuiderInterface class INDI::GuiderInterface
{ {
public: public:
/** \brief Guide north for ms milliseconds /** \brief Guide north for ms milliseconds
\return True if OK, false otherwise \return True if OK, false otherwise
*/ */
skipping to change at line 69 skipping to change at line 70
GuiderInterface(); GuiderInterface();
~GuiderInterface(); ~GuiderInterface();
/** \brief Initilize guider properties. It is recommended to call this function within initProperties() of your primary device /** \brief Initilize guider properties. It is recommended to call this function within initProperties() of your primary device
\param deviceName Name of the primary device \param deviceName Name of the primary device
\param groupName Group or tab name to be used to define guider prop erties. \param groupName Group or tab name to be used to define guider prop erties.
*/ */
void initGuiderProperties(const char *deviceName, const char* groupName ); void initGuiderProperties(const char *deviceName, const char* groupName );
/** \brief Call this function whenever client updates GuideNSP or Guide
WSP properties in the primary device. This function then takes care of issu
ing the corresponding
* GuideXXXX function accordingly.
* \param name device name
* \param values value as passed by the client
* \param names names as passed by the client
* \param n number of values and names pair to process.
*/
void processGuiderProperties(const char *name, double values[], char *n
ames[], int n);
INumber GuideNS[2]; INumber GuideNS[2];
INumberVectorProperty *GuideNSP; INumberVectorProperty GuideNSP;
INumber GuideEW[2]; INumber GuideEW[2];
INumberVectorProperty *GuideEWP; INumberVectorProperty GuideEWP;
}; };
#endif // GUIDERINTERFACE_H #endif // GUIDERINTERFACE_H
 End of changes. 4 change blocks. 
4 lines changed or deleted 17 lines changed or added


 indiproperty.h   indiproperty.h 
#ifndef INDI_INDIPROPERTY_H #ifndef INDI_INDIPROPERTY_H
#define INDI_INDIPROPERTY_H #define INDI_INDIPROPERTY_H
#include "indibase.h" #include "indibase.h"
namespace INDI namespace INDI
{ {
class BaseDevice;
class Property class Property
{ {
public: public:
Property(); Property();
~Property(); ~Property();
void setProperty(void *); void setProperty(void *);
void setType(INDI_TYPE t); void setType(INDI_TYPE t);
void setRegistered(bool r); void setRegistered(bool r);
void setDynamic(bool d); void setDynamic(bool d);
void setBaseDevice(BaseDevice *idp);
void *getProperty() { return pPtr; } void *getProperty() { return pPtr; }
INDI_TYPE getType() { return pType; } INDI_TYPE getType() { return pType; }
bool getRegistered() { return pRegistered; } bool getRegistered() { return pRegistered; }
bool isDynamic() { return pDynamic; } bool isDynamic() { return pDynamic; }
BaseDevice *getBaseDevice() { return dp; }
// Convenience Functions // Convenience Functions
const char *getName(); const char *getName();
const char *getLabel(); const char *getLabel();
const char *getGroupName(); const char *getGroupName();
const char *getDeviceName(); const char *getDeviceName();
IPState getState(); IPState getState();
IPerm getPermission(); IPerm getPermission();
INumberVectorProperty *getNumber(); INumberVectorProperty *getNumber();
ITextVectorProperty *getText(); ITextVectorProperty *getText();
ISwitchVectorProperty *getSwitch(); ISwitchVectorProperty *getSwitch();
ILightVectorProperty *getLight(); ILightVectorProperty *getLight();
IBLOBVectorProperty *getBLOB(); IBLOBVectorProperty *getBLOB();
private: private:
void *pPtr; void *pPtr;
BaseDevice *dp;
INDI_TYPE pType; INDI_TYPE pType;
bool pRegistered; bool pRegistered;
bool pDynamic; bool pDynamic;
}; };
} // namespace INDI } // namespace INDI
#endif // INDI_INDIPROPERTY_H #endif // INDI_INDIPROPERTY_H
 End of changes. 4 change blocks. 
0 lines changed or deleted 5 lines changed or added


 inditelescope.h   inditelescope.h 
skipping to change at line 102 skipping to change at line 102
/** \brief Read telescope status. /** \brief Read telescope status.
This function checks the following: This function checks the following:
<ol> <ol>
<li>Check if the link to the telescope is alive.</li> <li>Check if the link to the telescope is alive.</li>
<li>Update telescope status: Idle, Slewing, Parking..etc.</li> <li>Update telescope status: Idle, Slewing, Parking..etc.</li>
<li>Read coordinates</li> <li>Read coordinates</li>
</ol> </ol>
\return True if reading scope status is OK, false if an error is encounterd. \return True if reading scope status is OK, false if an error is encounterd.
\note This function is not implemented in INDI::Telescope, it mus t be implemented in the child class */ \note This function is not implemented in INDI::Telescope, it mus t be implemented in the child class */
virtual bool ReadScopeStatus(); virtual bool ReadScopeStatus()=0;
/** \brief Move the scope to the supplied RA and DEC coordinates /** \brief Move the scope to the supplied RA and DEC coordinates
\return True if successful, false otherewise \return True if successful, false otherewise
\note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class \note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class
*/ */
virtual bool Goto(double ra,double dec); virtual bool Goto(double ra,double dec)=0;
/** \brief Does the mount support sync?
* \return True if sync is supported, false otherwise.
*\note This function is not implemented in INDI::Telescope, it mus
t be implemented in the child class
*/
virtual bool canSync();
/** \brief Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates /** \brief Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates
\return True if successful, false otherewise \return True if successful, false otherewise
\note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class *\note This function implemented INDI::Telescope always returns false. Override the function to return true.
*/ */
virtual bool Sync(double ra,double dec); virtual bool Sync(double ra,double dec);
/** \brief Move the telescope in the direction dir. /** \brief Move the telescope in the direction dir.
\return True if successful, false otherewise \return True if successful, false otherewise
\note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class \note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class
*/ */
virtual bool MoveNS(TelescopeMotionNS dir); virtual bool MoveNS(TelescopeMotionNS dir);
/** \brief Move the telescope in the direction dir. /** \brief Move the telescope in the direction dir.
\return True if successful, false otherewise \return True if successful, false otherewise
\note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class \note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class
*/ */
virtual bool MoveWE(TelescopeMotionWE dir); virtual bool MoveWE(TelescopeMotionWE dir);
/** \brief Part the telescope to its home position. /** \brief Does the mount support park?
* \return True if park is supported, false otherwise.
*\note This function defaults to return false unless subclassed by
the child class.
*/
virtual bool canPark();
/** \brief Park the telescope to its home position.
\return True if successful, false otherewise \return True if successful, false otherewise
\note This function is not implemented in INDI::Telescope, it m ust be implemented in the child class *\note This function defaults to return false unless subclassed by the child class.
*/ */
virtual bool Park(); virtual bool Park();
/** \brief Abort telescope motion
\return True if successful, false otherewise
\note This function is not implemented in INDI::Telescope, it m
ust be implemented in the child class
*/
virtual bool Abort()=0;
// Since every mount I know of actually uses a serial port for con trol // Since every mount I know of actually uses a serial port for con trol
// We put the serial helper into the base telescope class // We put the serial helper into the base telescope class
// One less piece to worry about in the hardware specific // One less piece to worry about in the hardware specific
// low level stuff // low level stuff
int PortFD; int PortFD;
// This is a variable filled in by the ReadStatus telescope // This is a variable filled in by the ReadStatus telescope
// low level code, used to report current state // low level code, used to report current state
// are we slewing, tracking, or parked. // are we slewing, tracking, or parked.
TelescopeStatus TrackState; TelescopeStatus TrackState;
// All telescopes should produce equatorial co-ordinates // All telescopes should produce equatorial co-ordinates
INumberVectorProperty *EqNV; INumberVectorProperty EqNV;
INumber EqN[2]; INumber EqN[2];
// And we need a vector to store requests, ie, where are we asked ISwitchVectorProperty AbortSV; // Abort motion
to go ISwitch AbortS[1];
INumberVectorProperty *EqReqNV;
INumber EqReqN[2];
ISwitchVectorProperty *CoordSV; // A switch vector that stores how we should readct ISwitchVectorProperty CoordSV; // A switch vector that stores how we should readct
ISwitch CoordS[3]; // On a coord_set message, sync, o r slew ISwitch CoordS[3]; // On a coord_set message, sync, o r slew
ISwitchVectorProperty *ConfigSV; // A switch vector that stores ho w we should readct ISwitchVectorProperty ConfigSV; // A switch vector that stores how we should readct
ISwitch ConfigS[3]; // On a coord_set message, sync, or slew ISwitch ConfigS[3]; // On a coord_set message, sync, or slew
INumberVectorProperty *LocationNV; // A number vector that store s lattitude and longitude INumberVectorProperty LocationNV; // A number vector that stores lattitude and longitude
INumber LocationN[2]; INumber LocationN[2];
ISwitchVectorProperty *ParkSV; // A Switch in the client interface to park the scope ISwitchVectorProperty ParkSV; // A Switch in the client interface to park the scope
ISwitch ParkS[1]; ISwitch ParkS[1];
ITextVectorProperty *PortTV; // A text vector that stores out phys ical port name ITextVectorProperty PortTP; // A text vector that stores out physi cal port name
IText PortT[1]; IText PortT[1];
ISwitch MovementNSS[2]; // A switch for North/South motion ISwitch MovementNSS[2]; // A switch for North/South motion
ISwitchVectorProperty *MovementNSSP; ISwitchVectorProperty MovementNSSP;
ISwitch MovementWES[2]; // A switch for West/East motion ISwitch MovementWES[2]; // A switch for West/East motion
ISwitchVectorProperty *MovementWESP; ISwitchVectorProperty MovementWESP;
INumber ScopeParametersN[2]; INumber ScopeParametersN[4];
INumberVectorProperty *ScopeParametersNP; INumberVectorProperty ScopeParametersNP;
}; };
#endif // INDI::Telescope_H #endif // INDI::Telescope_H
 End of changes. 16 change blocks. 
19 lines changed or deleted 38 lines changed or added


 indiusbdevice.h   indiusbdevice.h 
skipping to change at line 40 skipping to change at line 40
#include "indibase.h" #include "indibase.h"
/** /**
* \class INDI::USBDevice * \class INDI::USBDevice
\brief Class to provide general functionality of a generic USB device. \brief Class to provide general functionality of a generic USB device.
Developers need to subclass INDI::USBDevice to implement any driver with in INDI that requires direct read/write/control over USB. Developers need to subclass INDI::USBDevice to implement any driver with in INDI that requires direct read/write/control over USB.
\author Gerry Rozema \author Gerry Rozema
\see Starlight Xpress INDI CCD driver for an example implementation of INDI ::USBDevice \note This class implements legacy libusb API v0.1
*/ */
class INDI::USBDevice class INDI::USBDevice
{ {
protected: protected:
struct usb_device *dev; struct usb_device *dev;
struct usb_dev_handle *usb_handle; struct usb_dev_handle *usb_handle;
int ProductId; int ProductId;
int VendorId; int VendorId;
int OutputType; int OutputType;
int OutputEndpoint; int OutputEndpoint;
int InputType; int InputType;
int InputEndpoint; int InputEndpoint;
struct usb_device * FindDevice(int,int,int); struct usb_device * FindDevice(int,int,int);
public: public:
int WriteInterrupt(char *,int,int); int WriteInterrupt(char *,int,int);
int ReadInterrupt(char *,int,int); int ReadInterrupt(char *,int,int);
int ControlMessage(unsigned char request_type, unsigned char request, u nsigned int value, unsigned int index, char *data, unsigned char len);
int ControlMessage(); int WriteBulk(char *buf,int nbytes,int timeout);
int ReadBulk(char *buf,int nbytes,int timeout);
int WriteBulk(char *buf,int nbytes,int timeout);
int ReadBulk(char *buf,int nbytes,int timeout);
int FindEndpoints(); int FindEndpoints();
int Open(); int Open();
USBDevice(void); USBDevice(void);
USBDevice(struct usb_device *); USBDevice(struct usb_device *);
virtual ~USBDevice(void); virtual ~USBDevice(void);
}; };
#endif // USBDEVICE_H #endif // USBDEVICE_H
 End of changes. 4 change blocks. 
8 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/