Ignore:
Timestamp:
Jun 28, 2011, 12:31:47 PM (13 years ago)
Author:
frichard
Message:

-Version 0.8 de libini
-Formule de Marc
-Nouvelles fonctionnalités (goto nom-de l'objet etc...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/libindi/libindi/libs/indibase/baseclient.h

    r502 r504  
    44#include <vector>
    55#include <map>
     6#include <boost/shared_ptr.hpp>
    67#include <string>
    78
     
    3233public:
    3334    enum { INDI_DEVICE_NOT_FOUND=-1, INDI_PROPERTY_INVALID=-2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR=-4 };
     35    typedef boost::shared_ptr<INDI::BaseDriver> devicePtr;
    3436
    3537    BaseClient();
    36     virtual ~BaseClient();
     38    ~BaseClient();
    3739
    3840    /** \brief Set the server host name and port
     
    5759        \note This function blocks until connection is either successull or unsuccessful.
    5860    */
    59     bool connect();
     61    bool connectServer();
    6062
    6163    /** \brief Disconnect from INDI server.
    6264
    6365        Disconnects from INDI servers. Any devices previously created will be deleted and memory cleared.
     66        \return True if disconnection is successful, false otherwise.
    6467    */
    65     void disconnect();
     68    bool disconnectServer();
    6669
     70    /** \brief Connect/Disconnect to INDI driver
     71        \param status If true, the client will attempt to turn on CONNECTION property within the driver (i.e. turn on the device).
     72         Otherwise, CONNECTION will be turned off.
     73        \param deviceName Name of the device to connect to.
     74    */
     75    void setDriverConnection(bool status, const char *deviceName);
    6776
    6877    /** \param deviceName Name of device to search for in the list of devices owned by INDI server,
    6978         \returns If \e deviceName exists, it returns an instance of the device. Otherwise, it returns NULL.
    7079    */
    71     INDI::BaseDriver * getDevice(const char * deviceName);
     80    INDI::BaseDriver * getDriver(const char * deviceName);
    7281
    7382    /** \returns Returns a vector of all devices created in the client.
    7483    */
    75     const vector<INDI::BaseDriver *> & getDevices() const { return cDevices; }
     84    const vector<devicePtr> & getDrivers() const { return cDevices; }
    7685
    7786    /** \brief Set Binary Large Object policy mode
     
    8695      If \e dev and \e prop are supplied, then the BLOB handling policy is set for this particular device and property.
    8796      if \e prop is NULL, then the BLOB policy applies to the whole device.
    88       if \e dev is NULL, then the BLOB policy applies to all devices owned by INDI server.
     97
    8998
    9099      \param blobH BLOB handling policy
    91       \param dev name of device
    92       \param prop name of property
     100      \param dev name of device, required.
     101      \param prop name of property, optional.
    93102    */
    94     void setBLOBMode(BLOBHandling blobH, const char *dev = NULL, const char *prop = NULL);
     103    void setBLOBMode(BLOBHandling blobH, const char *dev, const char *prop = NULL);
    95104
    96105    // Update
     
    143152    pthread_t listen_thread;
    144153
    145     vector<INDI::BaseDriver *> cDevices;
     154    vector<devicePtr> cDevices;
    146155    vector<string> cDeviceNames;
    147156
    148157    string cServer;
    149158    unsigned int cPort;
     159    bool sConnected;
    150160
    151161    // Parse & FILE buffers for IO
     
    153163    LilXML *lillp;                      /* XML parser context */
    154164    FILE *svrwfp;                       /* FILE * to talk to server */
    155     FILE *svrrfp;                       /* FILE * to read from server */
    156165
    157166};
Note: See TracChangeset for help on using the changeset viewer.