source: BAORadio/libindi/libindi/libs/indibase/indibase.h @ 697

Last change on this file since 697 was 697, checked in by frichard, 12 years ago

-Passage de la version 0.9 à la version 0.9.5 de la biliothèque libindi
-correction d'un bug affectant la commande 'm'
-vérification des fuites de mémoire et débogage complet

File size: 4.4 KB
Line 
1#ifndef INDIBASE_H
2#define INDIBASE_H
3
4#include "indiapi.h"
5#include "indidevapi.h"
6
7#define MAXRBUF 2048
8
9/**
10 * \namespace INDI
11   \brief Namespace to encapsulate INDI client, drivers, and mediator classes.
12   Developers can subclass the base devices class to implement device specific functionality. This ensures interoperability and consistency among devices within the same family
13   and reduces code overhead.
14
15   <ul>
16   <li>BaseClient: Base class for INDI clients. By subclassing BaseClient, client can easily connect to INDI server
17   and handle device communication, command, and notifcation.</li>
18   <li>BaseMediator: Abstract class to provide interface for event notifications in INDI::BaseClient.</li>
19   <li>BaseDriver: Base class for all INDI virtual driver as handled and stored in INDI::BaseClient.</li>
20   <li>DefaultDriver: INDI::BaseDriver with extended functionality such as debug, simulation, and configuration support.
21       It is \e only used by drivers directly, it cannot be used by clients.</li>
22   <li>FilterInterface: Basic interface for filter wheels functions.</li>
23   <li>GuiderInterface: Basic interface for guider (ST4) port functions.</li>
24   <li>CCD: Base class for CCD drivers. Provides basic support for single chip CCD and CCDs with a guide head as well.</li>
25   <li>Telescope: Base class for telescope drivers.</li>
26   <li>FilterWheel: Base class for Filter Wheels. It implements the FilterInterface.</li>
27   <li>Focuser: Base class for focusers.</li>
28   <li>USBDevice: Base class for USB devices for direct read/write/control over USB.</li>
29   </ul>
30 */
31namespace INDI
32{
33    class BaseMediator;
34    class BaseClient;
35    class BaseDevice;
36    class DefaultDevice;
37    class FilterInterface;
38    class GuiderInterface;
39    class CCD;
40    class Telescope;
41    class FilterWheel;
42    class Focuser;
43    class USBDevice;
44    class Property;
45}
46
47/*! INDI property type */
48typedef enum
49{
50    INDI_NUMBER, /*!< INumberVectorProperty. */
51    INDI_SWITCH, /*!< ISwitchVectorProperty. */
52    INDI_TEXT,   /*!< ITextVectorProperty. */
53    INDI_LIGHT,  /*!< ILightVectorProperty. */
54    INDI_BLOB,    /*!< IBLOBVectorProperty. */
55    INDI_UNKNOWN
56} INDI_TYPE;
57
58
59/**
60 * \class INDI::BaseMediator
61   \brief Meditates event notification as generated by driver and passed to clients.
62*/
63class INDI::BaseMediator
64{
65public:
66
67    /** \brief Emmited when a new device is created from INDI server.
68        \param device_name Name of the new device
69    */
70    virtual void newDevice(INDI::BaseDevice *dp)  =0;
71
72    /** \brief Emmited when a new property is created for an INDI driver.
73        \param property Pointer to the Property Container
74
75    */
76    virtual void newProperty(INDI::Property *property)  =0;
77
78
79    /** \brief Emmited when a property is deleted for an INDI driver.
80        \param property Pointer to the Property Container to remove.
81
82    */
83    virtual void removeProperty(INDI::Property *property)  =0;
84
85
86    /** \brief Emmited when a new BLOB value arrives from INDI server.
87        \param bp Pointer to filled and process BLOB.
88    */
89    virtual void newBLOB(IBLOB *bp) =0;
90
91    /** \brief Emmited when a new switch value arrives from INDI server.
92        \param svp Pointer to a switch vector property.
93    */
94    virtual void newSwitch(ISwitchVectorProperty *svp) =0;
95
96    /** \brief Emmited when a new number value arrives from INDI server.
97        \param nvp Pointer to a number vector property.
98    */
99    virtual void newNumber(INumberVectorProperty *nvp) =0;
100
101    /** \brief Emmited when a new text value arrives from INDI server.
102        \param tvp Pointer to a text vector property.
103    */
104    virtual void newText(ITextVectorProperty *tvp) =0;
105
106    /** \brief Emmited when a new light value arrives from INDI server.
107        \param lvp Pointer to a light vector property.
108    */
109    virtual void newLight(ILightVectorProperty *lvp) =0;
110
111    /** \brief Emmited when a new message arrives from INDI server.
112        \param dp pointer to the INDI device the message is sent to.
113    */
114    virtual void newMessage(INDI::BaseDevice *dp) =0;
115
116    /** \brief Emmited when the server is connected.
117    */
118    virtual void serverConnected() =0;
119
120    /** \brief Emmited when the server gets disconnected.
121        \param exit_code 0 if client was requested to disconnect from server. -1 if connection to server is terminated due to remote server disconnection.
122    */
123    virtual void serverDisconnected(int exit_code) =0;
124};
125
126#endif // INDIBASE_H
Note: See TracBrowser for help on using the repository browser.