Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

manager.h

Go to the documentation of this file.
00001 
00002 #ifndef OpieToothManager_H
00003 #define OpieToothManager_H
00004 
00005 #include <qobject.h>
00006 #include <qstring.h>
00007 #include <qmap.h>
00008 #include <qvaluelist.h>
00009 
00010 #include "connection.h"
00011 #include "remotedevice.h"
00012 #include "services.h"
00013 
00014 namespace Opie {namespace Core {class OProcess;}}
00015 namespace OpieTooth {
00016     class Device;
00022     class Manager : public QObject {
00023         Q_OBJECT
00024     public:
00029         Manager( const QString &device );
00030 
00035         Manager( Device* dev );
00036 
00040         Manager();
00041 
00042         ~Manager();
00043 
00047         void setDevice( const QString& device );
00048 
00052         void setDevice( Device *dev );
00053 
00062         void isAvailable(const QString& device= QString::null );
00063 
00067         void isAvailable(Device *dev );
00068 
00073         void searchDevices(const QString& device= QString::null );
00077         void searchDevices(Device *d );
00078 
00084         void addService(const QString &name );
00085 
00091         void addServices( const QStringList& names );
00092 
00096         void removeService(const QString &name );
00097 
00101         void removeServices(const QStringList& );
00102 
00107         void searchServices( const QString& remDevice );
00108 
00112         void searchServices( const RemoteDevice& );
00113 
00118         void connectTo(const QString& );
00119 
00125         void searchConnections();
00126 
00127         void signalStrength( const QString &mac );
00129         /*static*/ QString toDevice( const QString& mac );
00130         /*static*/ QString toMac( const QString &device );
00132 
00133     signals:
00134         // device either mac or dev name
00135         // the first device is the device which you access
00136         void available( const QString& device, bool connected );
00137         void addedService(  const QString& service, bool added );
00138         void removedService( const QString& service, bool removed );
00139         void foundServices( const QString& device, Services::ValueList );
00140         void foundDevices( const QString& device, RemoteDevice::ValueList );
00141         void connections( ConnectionState::ValueList );
00142         void signalStrength( const QString& mac, const QString& strengh );
00143 
00144 private slots:
00145         void slotProcessExited(Opie::Core::OProcess* );
00146 
00147         void slotSDPExited(Opie::Core::OProcess*);
00148         void slotSDPOut(Opie::Core::OProcess*, char*, int);
00149 
00150         void slotHCIExited(Opie::Core::OProcess* );
00151         void slotHCIOut(Opie::Core::OProcess*, char*, int );
00152 
00153         void slotConnectionExited(Opie::Core::OProcess* );
00154         void slotConnectionOutput(Opie::Core::OProcess*, char*, int );
00155 
00156         void slotSignalStrengthOutput( Opie::Core::OProcess*, char*, int );
00157         void slotSignalStrengthExited( Opie::Core::OProcess* );
00158     private:
00159         Services::ValueList parseSDPOutput( const QString& );
00160         RemoteDevice::ValueList parseHCIOutput( const QString& );
00161         ConnectionState::ValueList parseConnections( const QString& );
00162         Opie::Core::OProcess *m_hcitool;
00163         Opie::Core::OProcess *m_sdp; // not only one
00164         QString m_device;
00165         QMap<QString, int> m_signalStrength;
00166         QMap<QString, QString> m_out;
00167         QMap<QString, QString> m_devices;
00168         QMap<Opie::Core::OProcess*, QString> m_signalMac;
00169         QString m_hcitoolCon;
00170     };
00171 };
00172 
00173 #endif

Generated on Sat Nov 5 16:17:43 2005 for OPIE by  doxygen 1.4.2