19 #ifndef INDIBASECLIENT_H
20 #define INDIBASECLIENT_H
55 enum { INDI_DEVICE_NOT_FOUND=-1, INDI_PROPERTY_INVALID=-2, INDI_PROPERTY_DUPLICATED = -3, INDI_DISPATCH_ERROR=-4 };
65 void setServer(
const char * hostname,
unsigned int port);
74 void watchDevice(
const char * deviceName);
89 bool disconnectServer();
94 void connectDevice(
const char *deviceName);
99 void disconnectDevice(
const char *deviceName);
108 const vector<INDI::BaseDevice *> &
getDevices()
const {
return cDevices; }
127 void setBLOBMode(
BLOBHandling blobH,
const char *dev,
const char *prop = NULL);
130 static void * listenHelper(
void *context);
132 const char * getHost() {
return cServer.c_str();}
133 int getPort() {
return cPort; }
138 void sendNewText (
const char * deviceName,
const char * propertyName,
const char* elementName,
const char *text);
142 void sendNewNumber (
const char * deviceName,
const char *propertyName,
const char* elementName,
double value);
146 void sendNewSwitch (
const char * deviceName,
const char *propertyName,
const char *elementName);
149 void startBlob(
const char *devName,
const char *propName,
const char *
timestamp);
151 void sendOneBlob(
const char *blobName,
unsigned int blobSize,
const char *blobFormat,
void * blobBuffer);
158 int dispatchCommand(XMLEle *root,
char* errmsg);
161 int removeDevice(
const char * devName,
char * errmsg );
164 int delPropertyCmd (XMLEle *root,
char * errmsg);
174 int messageCmd (XMLEle *root,
char * errmsg);
184 void setDriverConnection(
bool status,
const char *deviceName);
190 pthread_t listen_thread;
192 vector<INDI::BaseDevice *> cDevices;
193 vector<string> cDeviceNames;
209 #endif // INDIBASECLIENT_H