Changeset 504 for BAORadio/libindi/libindi/libs/indibase/baseclient.h
- Timestamp:
- Jun 28, 2011, 12:31:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/libs/indibase/baseclient.h
r502 r504 4 4 #include <vector> 5 5 #include <map> 6 #include <boost/shared_ptr.hpp> 6 7 #include <string> 7 8 … … 32 33 public: 33 34 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; 34 36 35 37 BaseClient(); 36 virtual~BaseClient();38 ~BaseClient(); 37 39 38 40 /** \brief Set the server host name and port … … 57 59 \note This function blocks until connection is either successull or unsuccessful. 58 60 */ 59 bool connect ();61 bool connectServer(); 60 62 61 63 /** \brief Disconnect from INDI server. 62 64 63 65 Disconnects from INDI servers. Any devices previously created will be deleted and memory cleared. 66 \return True if disconnection is successful, false otherwise. 64 67 */ 65 void disconnect();68 bool disconnectServer(); 66 69 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); 67 76 68 77 /** \param deviceName Name of device to search for in the list of devices owned by INDI server, 69 78 \returns If \e deviceName exists, it returns an instance of the device. Otherwise, it returns NULL. 70 79 */ 71 INDI::BaseDriver * getD evice(const char * deviceName);80 INDI::BaseDriver * getDriver(const char * deviceName); 72 81 73 82 /** \returns Returns a vector of all devices created in the client. 74 83 */ 75 const vector< INDI::BaseDriver *> & getDevices() const { return cDevices; }84 const vector<devicePtr> & getDrivers() const { return cDevices; } 76 85 77 86 /** \brief Set Binary Large Object policy mode … … 86 95 If \e dev and \e prop are supplied, then the BLOB handling policy is set for this particular device and property. 87 96 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 89 98 90 99 \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. 93 102 */ 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); 95 104 96 105 // Update … … 143 152 pthread_t listen_thread; 144 153 145 vector< INDI::BaseDriver *> cDevices;154 vector<devicePtr> cDevices; 146 155 vector<string> cDeviceNames; 147 156 148 157 string cServer; 149 158 unsigned int cPort; 159 bool sConnected; 150 160 151 161 // Parse & FILE buffers for IO … … 153 163 LilXML *lillp; /* XML parser context */ 154 164 FILE *svrwfp; /* FILE * to talk to server */ 155 FILE *svrrfp; /* FILE * to read from server */156 165 157 166 };
Note: See TracChangeset
for help on using the changeset viewer.