author | erik <erik> | 2007-04-20 21:27:48 (UTC) |
---|---|---|
committer | erik <erik> | 2007-04-20 21:27:48 (UTC) |
commit | 1edbb754d3c8cfccf1630e2ad1e531e907555cbd (patch) (unidiff) | |
tree | c8f3048a913d51534408f5ae75f6f8e7ff73d144 /libopie2 | |
parent | d07beba6b9351c6b575235522781e3ce8495e578 (diff) | |
download | opie-1edbb754d3c8cfccf1630e2ad1e531e907555cbd.zip opie-1edbb754d3c8cfccf1630e2ad1e531e907555cbd.tar.gz opie-1edbb754d3c8cfccf1630e2ad1e531e907555cbd.tar.bz2 |
removed unused member function
-rw-r--r-- | libopie2/opiebluez/obluetooth.cpp | 13 | ||||
-rw-r--r-- | libopie2/opiebluez/obluetooth.h | 4 |
2 files changed, 0 insertions, 17 deletions
diff --git a/libopie2/opiebluez/obluetooth.cpp b/libopie2/opiebluez/obluetooth.cpp index 80f4bfc..e8e6bb3 100644 --- a/libopie2/opiebluez/obluetooth.cpp +++ b/libopie2/opiebluez/obluetooth.cpp | |||
@@ -264,111 +264,98 @@ QString OBluetoothDevice::macAddress() const | |||
264 | d->inqinfo.bdaddr.b[3], | 264 | d->inqinfo.bdaddr.b[3], |
265 | d->inqinfo.bdaddr.b[2], | 265 | d->inqinfo.bdaddr.b[2], |
266 | d->inqinfo.bdaddr.b[1], | 266 | d->inqinfo.bdaddr.b[1], |
267 | d->inqinfo.bdaddr.b[0] ); | 267 | d->inqinfo.bdaddr.b[0] ); |
268 | } | 268 | } |
269 | 269 | ||
270 | QString OBluetoothDevice::deviceClass() const | 270 | QString OBluetoothDevice::deviceClass() const |
271 | { | 271 | { |
272 | int maj = d->inqinfo.dev_class[1] & 0x1f; | 272 | int maj = d->inqinfo.dev_class[1] & 0x1f; |
273 | int min = d->inqinfo.dev_class[0] >> 2; | 273 | int min = d->inqinfo.dev_class[0] >> 2; |
274 | 274 | ||
275 | QString major = QString( "Unknown(%1)" ).arg( maj ); | 275 | QString major = QString( "Unknown(%1)" ).arg( maj ); |
276 | QString minor = QString( "Unknown(%1)" ).arg( min ); | 276 | QString minor = QString( "Unknown(%1)" ).arg( min ); |
277 | 277 | ||
278 | switch ( maj ) | 278 | switch ( maj ) |
279 | { | 279 | { |
280 | case 0: major = "Miscellaneous"; | 280 | case 0: major = "Miscellaneous"; |
281 | break; | 281 | break; |
282 | 282 | ||
283 | case 1: major = "Computer"; | 283 | case 1: major = "Computer"; |
284 | switch ( min ) | 284 | switch ( min ) |
285 | { | 285 | { |
286 | case 0: minor = "Uncategorized"; | 286 | case 0: minor = "Uncategorized"; |
287 | case 1: minor = "Desktop workstation"; | 287 | case 1: minor = "Desktop workstation"; |
288 | case 2: minor = "Server"; | 288 | case 2: minor = "Server"; |
289 | case 3: minor = "Laptop"; | 289 | case 3: minor = "Laptop"; |
290 | case 4: minor = "Handheld"; | 290 | case 4: minor = "Handheld"; |
291 | case 5: minor = "Palm"; | 291 | case 5: minor = "Palm"; |
292 | case 6: minor = "Wearable"; | 292 | case 6: minor = "Wearable"; |
293 | } | 293 | } |
294 | break; | 294 | break; |
295 | 295 | ||
296 | case 2: major = "Phone"; | 296 | case 2: major = "Phone"; |
297 | switch ( min ) | 297 | switch ( min ) |
298 | { | 298 | { |
299 | case 0: minor = "Uncategorized"; break; | 299 | case 0: minor = "Uncategorized"; break; |
300 | case 1: minor = "Cellular"; break; | 300 | case 1: minor = "Cellular"; break; |
301 | case 2: minor = "Cordless"; break; | 301 | case 2: minor = "Cordless"; break; |
302 | case 3: minor = "Smart phone"; break; | 302 | case 3: minor = "Smart phone"; break; |
303 | case 4: minor = "Wired modem or voice gateway"; break; | 303 | case 4: minor = "Wired modem or voice gateway"; break; |
304 | case 5: minor = "Common ISDN Access"; break; | 304 | case 5: minor = "Common ISDN Access"; break; |
305 | case 6: minor = "Sim Card Reader"; break; | 305 | case 6: minor = "Sim Card Reader"; break; |
306 | } | 306 | } |
307 | break; | 307 | break; |
308 | 308 | ||
309 | case 3: major = "LAN Access"; | 309 | case 3: major = "LAN Access"; |
310 | break; | 310 | break; |
311 | 311 | ||
312 | case 4: major = "Audio/Video"; | 312 | case 4: major = "Audio/Video"; |
313 | switch ( min ) | 313 | switch ( min ) |
314 | { | 314 | { |
315 | case 0: minor = "Uncategorized"; break; | 315 | case 0: minor = "Uncategorized"; break; |
316 | case 1: minor = "Device conforms to the Headset profile"; break; | 316 | case 1: minor = "Device conforms to the Headset profile"; break; |
317 | case 2: minor = "Hands-free"; break; | 317 | case 2: minor = "Hands-free"; break; |
318 | case 3: minor = "Reserved(3)"; break; | 318 | case 3: minor = "Reserved(3)"; break; |
319 | case 4: minor = "Microphone"; break; | 319 | case 4: minor = "Microphone"; break; |
320 | case 5: minor = "Loudspeaker"; break; | 320 | case 5: minor = "Loudspeaker"; break; |
321 | case 6: minor = "Headphones"; break; | 321 | case 6: minor = "Headphones"; break; |
322 | case 7: minor = "Portable Audio"; break; | 322 | case 7: minor = "Portable Audio"; break; |
323 | case 8: minor = "Car Audio"; break; | 323 | case 8: minor = "Car Audio"; break; |
324 | case 9: minor = "Set-top box"; break; | 324 | case 9: minor = "Set-top box"; break; |
325 | case 10: minor = "HiFi Audio Device"; break; | 325 | case 10: minor = "HiFi Audio Device"; break; |
326 | case 11: minor = "VCR"; break; | 326 | case 11: minor = "VCR"; break; |
327 | case 12: minor = "Video Camera"; break; | 327 | case 12: minor = "Video Camera"; break; |
328 | case 13: minor = "Camcorder"; break; | 328 | case 13: minor = "Camcorder"; break; |
329 | case 14: minor = "Video Monitor"; break; | 329 | case 14: minor = "Video Monitor"; break; |
330 | case 15: minor = "Video Display and Loudspeaker"; break; | 330 | case 15: minor = "Video Display and Loudspeaker"; break; |
331 | case 16: minor = "Video Conferencing"; break; | 331 | case 16: minor = "Video Conferencing"; break; |
332 | case 17: minor = "Reserved(17)"; break; | 332 | case 17: minor = "Reserved(17)"; break; |
333 | case 18: minor = "Gaming/Toy"; break; | 333 | case 18: minor = "Gaming/Toy"; break; |
334 | } | 334 | } |
335 | break; | 335 | break; |
336 | 336 | ||
337 | case 5: major = "Peripheral"; | 337 | case 5: major = "Peripheral"; |
338 | switch ( min ) | 338 | switch ( min ) |
339 | { | 339 | { |
340 | case 16: minor = "Keyboard"; break; | 340 | case 16: minor = "Keyboard"; break; |
341 | case 32: minor = "Pointing Device"; break; | 341 | case 32: minor = "Pointing Device"; break; |
342 | case 48: minor = "Keyboard and Pointing Device"; break; | 342 | case 48: minor = "Keyboard and Pointing Device"; break; |
343 | } | 343 | } |
344 | break; | 344 | break; |
345 | 345 | ||
346 | case 6: major = "Imaging"; | 346 | case 6: major = "Imaging"; |
347 | if (min & 4) minor = "Display"; | 347 | if (min & 4) minor = "Display"; |
348 | else if (min & 8) minor = "Camera"; | 348 | else if (min & 8) minor = "Camera"; |
349 | else if (min & 16) minor = "Scanner"; | 349 | else if (min & 16) minor = "Scanner"; |
350 | else if (min & 32) minor = "Printer"; | 350 | else if (min & 32) minor = "Printer"; |
351 | break; | 351 | break; |
352 | 352 | ||
353 | case 63: major = "Uncategorized"; | 353 | case 63: major = "Uncategorized"; |
354 | break; | 354 | break; |
355 | } | 355 | } |
356 | 356 | ||
357 | return QString( "%1:%2" ).arg( major ).arg( minor ); | 357 | return QString( "%1:%2" ).arg( major ).arg( minor ); |
358 | } | 358 | } |
359 | 359 | ||
360 | QString OBluetoothDevice::getName() | ||
361 | { | ||
362 | /* FIXME: Uahhh, this gets ugly. | ||
363 | The BlueZ kernel interface seems to be very badly (if at all) documented. | ||
364 | All people are assuming that you use libbluetooth to talk to that stack. | ||
365 | However since libbluetooth is GPL, we can't do that :/ | ||
366 | Guess, we are stuck here until someone finds time and/or motivation to look | ||
367 | into that and create some easy-to-understand examples for how to talk | ||
368 | directly to the BlueZ kernel interface. | ||
369 | */ | ||
370 | }; | ||
371 | |||
372 | |||
373 | } | 360 | } |
374 | } | 361 | } |
diff --git a/libopie2/opiebluez/obluetooth.h b/libopie2/opiebluez/obluetooth.h index fa3d2c1..4bcd964 100644 --- a/libopie2/opiebluez/obluetooth.h +++ b/libopie2/opiebluez/obluetooth.h | |||
@@ -90,110 +90,106 @@ class OBluetooth : public QObject | |||
90 | protected: | 90 | protected: |
91 | OBluetooth(); | 91 | OBluetooth(); |
92 | 92 | ||
93 | private: | 93 | private: |
94 | static OBluetooth* _instance; | 94 | static OBluetooth* _instance; |
95 | InterfaceMap _interfaces; | 95 | InterfaceMap _interfaces; |
96 | class OBluetoothPrivate; | 96 | class OBluetoothPrivate; |
97 | OBluetoothPrivate *d; | 97 | OBluetoothPrivate *d; |
98 | int _fd; | 98 | int _fd; |
99 | }; | 99 | }; |
100 | 100 | ||
101 | /*====================================================================================== | 101 | /*====================================================================================== |
102 | * OBluetoothInterface | 102 | * OBluetoothInterface |
103 | *======================================================================================*/ | 103 | *======================================================================================*/ |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * @brief An bluetooth interface wrapper. | 106 | * @brief An bluetooth interface wrapper. |
107 | * | 107 | * |
108 | * This class provides a wrapper for a bluetooth HCI device. All the cumbersome details of | 108 | * This class provides a wrapper for a bluetooth HCI device. All the cumbersome details of |
109 | * Linux ioctls are hidden under a convenient high-level interface. | 109 | * Linux ioctls are hidden under a convenient high-level interface. |
110 | * @warning Most of the setting methods contained in this class require the appropriate | 110 | * @warning Most of the setting methods contained in this class require the appropriate |
111 | * process permissions to work. | 111 | * process permissions to work. |
112 | * | 112 | * |
113 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 113 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
114 | */ | 114 | */ |
115 | class OBluetoothInterface : public QObject | 115 | class OBluetoothInterface : public QObject |
116 | { | 116 | { |
117 | Q_OBJECT | 117 | Q_OBJECT |
118 | public: | 118 | public: |
119 | typedef QDict<OBluetoothDevice> DeviceMap; | 119 | typedef QDict<OBluetoothDevice> DeviceMap; |
120 | typedef QDictIterator<OBluetoothDevice> DeviceIterator; | 120 | typedef QDictIterator<OBluetoothDevice> DeviceIterator; |
121 | 121 | ||
122 | public: | 122 | public: |
123 | /** | 123 | /** |
124 | * Constructor. Normally you don't create @ref OBluetoothInterface objects yourself, | 124 | * Constructor. Normally you don't create @ref OBluetoothInterface objects yourself, |
125 | * but access them via @ref OBluetooth::interface(). | 125 | * but access them via @ref OBluetooth::interface(). |
126 | */ | 126 | */ |
127 | OBluetoothInterface( QObject* parent, const char* name, void* devinfo, int ctlfd ); | 127 | OBluetoothInterface( QObject* parent, const char* name, void* devinfo, int ctlfd ); |
128 | /** | 128 | /** |
129 | * Destructor. | 129 | * Destructor. |
130 | */ | 130 | */ |
131 | virtual ~OBluetoothInterface(); | 131 | virtual ~OBluetoothInterface(); |
132 | /** | 132 | /** |
133 | * @return the MAC address of the interface. | 133 | * @return the MAC address of the interface. |
134 | */ | 134 | */ |
135 | QString macAddress() const; | 135 | QString macAddress() const; |
136 | /** | 136 | /** |
137 | * Setting an interface to up enables it to receive packets. | 137 | * Setting an interface to up enables it to receive packets. |
138 | */ | 138 | */ |
139 | bool setUp( bool ); | 139 | bool setUp( bool ); |
140 | /** | 140 | /** |
141 | * @returns true if the interface is up. | 141 | * @returns true if the interface is up. |
142 | */ | 142 | */ |
143 | bool isUp() const; | 143 | bool isUp() const; |
144 | /** | 144 | /** |
145 | * @returns an iterator usable for iterating through the devices in range. | 145 | * @returns an iterator usable for iterating through the devices in range. |
146 | */ | 146 | */ |
147 | DeviceIterator neighbourhood(); | 147 | DeviceIterator neighbourhood(); |
148 | 148 | ||
149 | private: | 149 | private: |
150 | DeviceMap _devices; | 150 | DeviceMap _devices; |
151 | class Private; | 151 | class Private; |
152 | Private *d; | 152 | Private *d; |
153 | }; | 153 | }; |
154 | 154 | ||
155 | /*====================================================================================== | 155 | /*====================================================================================== |
156 | * OBluetoothDevice | 156 | * OBluetoothDevice |
157 | *======================================================================================*/ | 157 | *======================================================================================*/ |
158 | 158 | ||
159 | /** | 159 | /** |
160 | * @brief An bluetooth (remote) device abstraction. | 160 | * @brief An bluetooth (remote) device abstraction. |
161 | * | 161 | * |
162 | * This class resembles a (remote) bluetooth device. | 162 | * This class resembles a (remote) bluetooth device. |
163 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 163 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
164 | */ | 164 | */ |
165 | class OBluetoothDevice : public QObject | 165 | class OBluetoothDevice : public QObject |
166 | { | 166 | { |
167 | Q_OBJECT | 167 | Q_OBJECT |
168 | 168 | ||
169 | public: | 169 | public: |
170 | /** | 170 | /** |
171 | * Constructor. | 171 | * Constructor. |
172 | */ | 172 | */ |
173 | OBluetoothDevice( QObject* parent, const char* name, void* inqinfo ); | 173 | OBluetoothDevice( QObject* parent, const char* name, void* inqinfo ); |
174 | /** | 174 | /** |
175 | * Destructor. | 175 | * Destructor. |
176 | */ | 176 | */ |
177 | virtual ~OBluetoothDevice(); | 177 | virtual ~OBluetoothDevice(); |
178 | /** | 178 | /** |
179 | * @returns the MAC address of the device's interface. | 179 | * @returns the MAC address of the device's interface. |
180 | */ | 180 | */ |
181 | QString macAddress() const; | 181 | QString macAddress() const; |
182 | /** | 182 | /** |
183 | * @returns the class of device. | 183 | * @returns the class of device. |
184 | */ | 184 | */ |
185 | QString deviceClass() const; | 185 | QString deviceClass() const; |
186 | /** | ||
187 | * @returns the device name. | ||
188 | */ | ||
189 | QString getName(); | ||
190 | 186 | ||
191 | private: | 187 | private: |
192 | class Private; | 188 | class Private; |
193 | Private *d; | 189 | Private *d; |
194 | }; | 190 | }; |
195 | 191 | ||
196 | } | 192 | } |
197 | } | 193 | } |
198 | #endif | 194 | #endif |
199 | 195 | ||