author | zecke <zecke> | 2002-05-30 20:15:50 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-05-30 20:15:50 (UTC) |
commit | f4f00234985e5864229b3e95a3ac0d004c09b10d (patch) (unidiff) | |
tree | 4812f1858ac0ea575d50f5a65042af123e916ca2 | |
parent | 6a7ea9fd0496d48f05e78ad4afc527e01568eb92 (diff) | |
download | opie-f4f00234985e5864229b3e95a3ac0d004c09b10d.zip opie-f4f00234985e5864229b3e95a3ac0d004c09b10d.tar.gz opie-f4f00234985e5864229b3e95a3ac0d004c09b10d.tar.bz2 |
API+DOCS updates
-rw-r--r-- | noncore/net/opietooth/lib/manager.h | 76 |
1 files changed, 65 insertions, 11 deletions
diff --git a/noncore/net/opietooth/lib/manager.h b/noncore/net/opietooth/lib/manager.h index dcae02b..5586680 100644 --- a/noncore/net/opietooth/lib/manager.h +++ b/noncore/net/opietooth/lib/manager.h | |||
@@ -1,56 +1,110 @@ | |||
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 <qvaluelist.h> | 7 | #include <qvaluelist.h> |
8 | 8 | ||
9 | namespace OpieTooth { | 9 | namespace OpieTooth { |
10 | class Device; | 10 | class Device; |
11 | /** Manager manages a blueZ device (hci0 for example) | ||
12 | * with Manager you can control the things you | ||
13 | * could do from command line in a OO and asynchronus | ||
14 | * way. | ||
15 | */ | ||
11 | class Manager : public QObject { | 16 | class Manager : public QObject { |
12 | Q_OBJECT | 17 | Q_OBJECT |
13 | public: | 18 | public: |
14 | // Manage MAC device or by name (hci0) | 19 | /** c'tor whichs create a new Manager |
20 | * @param device is the device to use. Either a mac or blueZ device name | ||
21 | * | ||
22 | */ | ||
15 | Manager( const QString &device ); | 23 | Manager( const QString &device ); |
16 | // Manage a with Device attached device | 24 | /** c'tor |
25 | * @param dev The Device to be managed | ||
26 | * We don't care of Device so you need to delete it | ||
27 | */ | ||
17 | Manager( Device* dev ); | 28 | Manager( Device* dev ); |
18 | // manage nothing ;) | 29 | /** |
30 | * c'tor | ||
31 | */ | ||
19 | Manager(); | 32 | Manager(); |
20 | ~Manager(); | 33 | ~Manager(); |
21 | 34 | ||
22 | // setDevice either MAC or hci0 | 35 | /** Set the manager to control a new device |
23 | // ups it | 36 | * @param device the new device to control (hci0 ) |
37 | */ | ||
24 | void setDevice( const QString& device ); | 38 | void setDevice( const QString& device ); |
39 | /** | ||
40 | * Convience functions for setting a new device | ||
41 | */ | ||
25 | void setDevice( Device *dev ); | 42 | void setDevice( Device *dev ); |
26 | // asynchron connect to signal | 43 | /** |
27 | void isConnected(const QString& device ); | 44 | * Wether or not a device is connected. The function |
45 | * is asynchron | ||
46 | * If device is empty it will take the currently managed | ||
47 | * device and see if it's up | ||
48 | * for Remote devices it will ping and see | ||
49 | */ | ||
50 | void isConnected(const QString& device= QString::null ); | ||
51 | /** | ||
52 | * same as above | ||
53 | */ | ||
28 | void isConnected(Device *dev ); | 54 | void isConnected(Device *dev ); |
29 | 55 | ||
30 | // if c'tor with device or setDevice everythning is ok | 56 | /** this search for devices reachable from the |
31 | void searchDevices(); | 57 | * currently managed device |
32 | // use an alternate device | 58 | * or from device if @param device is not empty |
33 | void searchDevices(const QString& device); | 59 | */ |
60 | void searchDevices(const QString& device= QString::null ); | ||
61 | /** same as above | ||
62 | * | ||
63 | */ | ||
34 | void searchDevices(Device *d ); | 64 | void searchDevices(Device *d ); |
35 | 65 | ||
66 | /** | ||
67 | * This will add the service @param name | ||
68 | * to the sdpd daemon | ||
69 | * It will start the daemon if necessary | ||
70 | */ | ||
36 | void addService(const QString &name ); | 71 | void addService(const QString &name ); |
72 | /** | ||
73 | * This will add the services @param names | ||
74 | * to the sdpd daemon | ||
75 | * It will start the daemon if necessary | ||
76 | */ | ||
37 | void addServices( const QStringList& names ); | 77 | void addServices( const QStringList& names ); |
78 | /** | ||
79 | * This removes a service from the sdps | ||
80 | */ | ||
38 | void removeService(const QString &name ); | 81 | void removeService(const QString &name ); |
82 | /** | ||
83 | * Removes a list from the sdpd | ||
84 | */ | ||
39 | void removeServices(const QStringList& ); | 85 | void removeServices(const QStringList& ); |
40 | 86 | ||
87 | /** | ||
88 | * search for services on a remote device | ||
89 | * | ||
90 | */ | ||
41 | void searchServices( const QString& remDevice ); | 91 | void searchServices( const QString& remDevice ); |
92 | /** | ||
93 | * search for services on a remote device | ||
94 | */ | ||
95 | void searchServices( const RemoteDevices& ); | ||
42 | /*static*/ QString toDevice( const QString& mac ); | 96 | /*static*/ QString toDevice( const QString& mac ); |
43 | /*static*/ QString toMac( const QString &device ); | 97 | /*static*/ QString toMac( const QString &device ); |
44 | 98 | ||
45 | signals: | 99 | signals: |
46 | // device either mac or dev name | 100 | // device either mac or dev name |
47 | // the first device is the device which you access | 101 | // the first device is the device which you access |
48 | void connected( const QString& device, bool connected ); | 102 | void connected( const QString& device, bool connected ); |
49 | void addedService( const QString& device, const QString& service, bool added ); | 103 | void addedService( const QString& device, const QString& service, bool added ); |
50 | void removedService( const QString& device, const QString& service, bool removed ); | 104 | void removedService( const QString& device, const QString& service, bool removed ); |
51 | void foundServices( const QString& device, Services::ValueList ); | 105 | void foundServices( const QString& device, Services::ValueList ); |
52 | void foundDevices( const QString& device, RemoteDevices::ValueList ); | 106 | void foundDevices( const QString& device, RemoteDevices::ValueList ); |
53 | }; | 107 | }; |
54 | }; | 108 | }; |
55 | 109 | ||
56 | #endif | 110 | #endif |