| 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, device, and mediator classes | 
|---|
| 12 |  | 
|---|
| 13 | <ul> | 
|---|
| 14 | <li>BaseClient: Base class for INDI clients. By subclassing BaseClient, client can easily connect to INDI server | 
|---|
| 15 | and handle device communication, command, and notifcation.</li> | 
|---|
| 16 | <li>BaseMediator: Abstract class to provide interface for event notifications in INDI::BaseClient.</li> | 
|---|
| 17 | <li>BaseDriver: Base class for all INDI virtual driver as handled and stored in INDI::BaseClient.</li> | 
|---|
| 18 | <li>DefaultDriver: INDI::BaseDriver with extended functionality such as debug, simulation, and configuration support. | 
|---|
| 19 | It is \e only used by drivers directly, it cannot be used by clients.</li> | 
|---|
| 20 | </ul> | 
|---|
| 21 | */ | 
|---|
| 22 | namespace INDI | 
|---|
| 23 | { | 
|---|
| 24 | class BaseMediator; | 
|---|
| 25 | class BaseClient; | 
|---|
| 26 | class BaseDriver; | 
|---|
| 27 | class DefaultDriver; | 
|---|
| 28 | } | 
|---|
| 29 |  | 
|---|
| 30 |  | 
|---|
| 31 | /** | 
|---|
| 32 | * \class INDI::BaseMediator | 
|---|
| 33 | \brief Meditates event notification as generated by devices and passed to clients. | 
|---|
| 34 | */ | 
|---|
| 35 | class INDI::BaseMediator | 
|---|
| 36 | { | 
|---|
| 37 | public: | 
|---|
| 38 |  | 
|---|
| 39 | /** \brief Emmited when a new device is created from INDI server. | 
|---|
| 40 | */ | 
|---|
| 41 | virtual void newDevice()  =0; | 
|---|
| 42 |  | 
|---|
| 43 | /** \brief Emmited when a new BLOB value arrives from INDI server. | 
|---|
| 44 | \param bp Pointer to filled and process BLOB. | 
|---|
| 45 | */ | 
|---|
| 46 | virtual void newBLOB(IBLOB *bp) =0; | 
|---|
| 47 |  | 
|---|
| 48 | /** \brief Emmited when a new switch value arrives from INDI server. | 
|---|
| 49 | \param svp Pointer to a switch vector property. | 
|---|
| 50 | */ | 
|---|
| 51 | virtual void newSwitch(ISwitchVectorProperty *svp) =0; | 
|---|
| 52 |  | 
|---|
| 53 | /** \brief Emmited when a new number value arrives from INDI server. | 
|---|
| 54 | \param nvp Pointer to a number vector property. | 
|---|
| 55 | */ | 
|---|
| 56 | virtual void newNumber(INumberVectorProperty *nvp) =0; | 
|---|
| 57 |  | 
|---|
| 58 | /** \brief Emmited when a new text value arrives from INDI server. | 
|---|
| 59 | \param tvp Pointer to a text vector property. | 
|---|
| 60 | */ | 
|---|
| 61 | virtual void newText(ITextVectorProperty *tvp) =0; | 
|---|
| 62 |  | 
|---|
| 63 | /** \brief Emmited when a new light value arrives from INDI server. | 
|---|
| 64 | \param lvp Pointer to a light vector property. | 
|---|
| 65 | */ | 
|---|
| 66 | virtual void newLight(ILightVectorProperty *lvp) =0; | 
|---|
| 67 |  | 
|---|
| 68 | /** \brief Emmited when the server gets disconnected. | 
|---|
| 69 | */ | 
|---|
| 70 | virtual void serverDisconnected() =0; | 
|---|
| 71 | }; | 
|---|
| 72 |  | 
|---|
| 73 | #endif // INDIBASE_H | 
|---|