author | zecke <zecke> | 2002-06-15 20:06:04 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-15 20:06:04 (UTC) |
commit | b15f8a613d83a2f3957fef515e20981f636b908b (patch) (unidiff) | |
tree | 6d2e6743ceb4c3cb299944efc4b2925e5f40412d /noncore/net/opietooth/lib/manager.h | |
parent | ef75752efaef84e4b7350f9768f3cb3c4fd744af (diff) | |
download | opie-b15f8a613d83a2f3957fef515e20981f636b908b.zip opie-b15f8a613d83a2f3957fef515e20981f636b908b.tar.gz opie-b15f8a613d83a2f3957fef515e20981f636b908b.tar.bz2 |
isCOnnected, add and remove Service + first bits of service browsing done
Diffstat (limited to 'noncore/net/opietooth/lib/manager.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/lib/manager.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/noncore/net/opietooth/lib/manager.h b/noncore/net/opietooth/lib/manager.h index 6c5e27f..03375c5 100644 --- a/noncore/net/opietooth/lib/manager.h +++ b/noncore/net/opietooth/lib/manager.h | |||
@@ -1,36 +1,38 @@ | |||
1 | 1 | ||
2 | #ifndef OpieToothManager_H | 2 | #ifndef OpieToothManager_H |
3 | #define OpieToothManager_H | 3 | #define OpieToothManager_H |
4 | 4 | ||
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qmap.h> | ||
7 | #include <qvaluelist.h> | 8 | #include <qvaluelist.h> |
8 | 9 | ||
9 | #include "remotedevice.h" | 10 | #include "remotedevice.h" |
10 | #include "services.h" | 11 | #include "services.h" |
11 | 12 | ||
13 | class OProcess; | ||
12 | namespace OpieTooth { | 14 | namespace OpieTooth { |
13 | class Device; | 15 | class Device; |
14 | /** Manager manages a blueZ device (hci0 for example) | 16 | /** Manager manages a blueZ device (hci0 for example) |
15 | * with Manager you can control the things you | 17 | * with Manager you can control the things you |
16 | * could do from command line in a OO and asynchronus | 18 | * could do from command line in a OO and asynchronus |
17 | * way. | 19 | * way. |
18 | */ | 20 | */ |
19 | class Manager : public QObject { | 21 | class Manager : public QObject { |
20 | Q_OBJECT | 22 | Q_OBJECT |
21 | public: | 23 | public: |
22 | /** c'tor whichs create a new Manager | 24 | /** c'tor whichs create a new Manager |
23 | * @param device is the device to use. Either a mac or blueZ device name | 25 | * @param device is the device to use. Either a mac or blueZ device name |
24 | * | 26 | * |
25 | */ | 27 | */ |
26 | Manager( const QString &device ); | 28 | Manager( const QString &device ); |
27 | /** c'tor | 29 | /** c'tor |
28 | * @param dev The Device to be managed | 30 | * @param dev The Device to be managed |
29 | * We don't care of Device so you need to delete it | 31 | * We don't care of Device so you need to delete it |
30 | */ | 32 | */ |
31 | Manager( Device* dev ); | 33 | Manager( Device* dev ); |
32 | /** | 34 | /** |
33 | * c'tor | 35 | * c'tor |
34 | */ | 36 | */ |
35 | Manager(); | 37 | Manager(); |
36 | ~Manager(); | 38 | ~Manager(); |
@@ -45,22 +47,23 @@ Q_OBJECT | |||
45 | void setDevice( Device *dev ); | 47 | void setDevice( Device *dev ); |
46 | /** | 48 | /** |
47 | * Wether or not a device is connected. The function | 49 | * Wether or not a device is connected. The function |
48 | * is asynchron | 50 | * is asynchron |
49 | * If device is empty it will take the currently managed | 51 | * If device is empty it will take the currently managed |
50 | * device and see if it's up | 52 | * device and see if it's up |
51 | * for Remote devices it will ping and see | 53 | * for Remote devices it will ping and see. |
54 | * @param either mac or hciX | ||
52 | */ | 55 | */ |
53 | void isConnected(const QString& device= QString::null ); | 56 | void isConnected(const QString& device= QString::null ); |
54 | /** | 57 | /** |
55 | * same as above | 58 | * same as above |
56 | */ | 59 | */ |
57 | void isConnected(Device *dev ); | 60 | void isConnected(Device *dev ); |
58 | 61 | ||
59 | /** this search for devices reachable from the | 62 | /** this searchs for devices reachable from the |
60 | * currently managed device | 63 | * currently managed device |
61 | * or from device if @param device is not empty | 64 | * or from device if @param device is not empty |
62 | */ | 65 | */ |
63 | void searchDevices(const QString& device= QString::null ); | 66 | void searchDevices(const QString& device= QString::null ); |
64 | /** same as above | 67 | /** same as above |
65 | * | 68 | * |
66 | */ | 69 | */ |
@@ -86,13 +89,13 @@ Q_OBJECT | |||
86 | * Removes a list from the sdpd | 89 | * Removes a list from the sdpd |
87 | */ | 90 | */ |
88 | void removeServices(const QStringList& ); | 91 | void removeServices(const QStringList& ); |
89 | 92 | ||
90 | /** | 93 | /** |
91 | * search for services on a remote device | 94 | * search for services on a remote device |
92 | * | 95 | * |
93 | */ | 96 | */ |
94 | void searchServices( const QString& remDevice ); | 97 | void searchServices( const QString& remDevice ); |
95 | /** | 98 | /** |
96 | * search for services on a remote device | 99 | * search for services on a remote device |
97 | */ | 100 | */ |
98 | void searchServices( const RemoteDevices& ); | 101 | void searchServices( const RemoteDevices& ); |
@@ -100,14 +103,24 @@ Q_OBJECT | |||
100 | /*static*/ QString toMac( const QString &device ); | 103 | /*static*/ QString toMac( const QString &device ); |
101 | 104 | ||
102 | signals: | 105 | signals: |
103 | // device either mac or dev name | 106 | // device either mac or dev name |
104 | // the first device is the device which you access | 107 | // the first device is the device which you access |
105 | void connected( const QString& device, bool connected ); | 108 | void connected( const QString& device, bool connected ); |
106 | void addedService( const QString& device, const QString& service, bool added ); | 109 | void addedService( const QString& service, bool added ); |
107 | void removedService( const QString& device, const QString& service, bool removed ); | 110 | void removedService( const QString& service, bool removed ); |
108 | void foundServices( const QString& device, Services::ValueList ); | 111 | void foundServices( const QString& device, Services::ValueList ); |
109 | void foundDevices( const QString& device, RemoteDevices::ValueList ); | 112 | void foundDevices( const QString& device, RemoteDevices::ValueList ); |
113 | void foundNothing( const QString& device ); | ||
114 | private slots: | ||
115 | void slotProcessExited(OProcess* ); | ||
116 | void slotSDPExited(OProcess*); | ||
117 | void slotSDPOut(OProcess*, char*, int); | ||
118 | private: | ||
119 | OProcess *m_hcitool; | ||
120 | OProcess *m_sdp; // not only one | ||
121 | QString m_device; | ||
122 | QMap<QString, QString> m_out; | ||
110 | }; | 123 | }; |
111 | }; | 124 | }; |
112 | 125 | ||
113 | #endif | 126 | #endif |