2 Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 This application is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
14 #ifndef DEVICEMANAGER_H
15 #define DEVICEMANAGER_H
17 #include "indielement.h"
23 class QSocketNotifier
;
25 // INDI device manager
26 class DeviceManager
: public QObject
30 DeviceManager(INDIMenu
*INDIparent
, int inID
);
35 QPtrList
<INDI_D
> indi_dev
;
41 QSocketNotifier
*sNotifier
;
45 int dispatchCommand (XMLEle
*root
, char errmsg
[]);
47 INDI_D
* addDevice (XMLEle
*dep
, char errmsg
[]);
48 INDI_D
* findDev (XMLEle
*root
, int create
, char errmsg
[]);
50 /*****************************************************************
52 ******************************************************************/
53 void sendNewText (INDI_P
*pp
);
54 void sendNewNumber (INDI_P
*pp
);
55 void sendNewSwitch (INDI_P
*pp
, int index
);
56 void startBlob (QString devName
, QString propName
, QString timestamp
);
57 void sendOneBlob(QString blobName
, unsigned int blobSize
, QString blobFormat
, unsigned char * blobBuffer
);
60 /*****************************************************************
62 ******************************************************************/
63 int delPropertyCmd (XMLEle
*root
, char errmsg
[]);
64 int removeDevice (QString devName
, char errmsg
[]);
65 INDI_D
* findDev (QString devName
, char errmsg
[]);
67 int messageCmd (XMLEle
*root
, char errmsg
[]);
68 void checkMsg (XMLEle
*root
, INDI_D
*dp
);
69 void doMsg (XMLEle
*msg
, INDI_D
*dp
);
71 bool indiConnect (QString inHost
, QString inPort
);