summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiebluez/obluetooth.cpp13
-rw-r--r--libopie2/opiebluez/obluetooth.h4
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
@@ -296,79 +296,66 @@ QString OBluetoothDevice::deviceClass() const
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
360QString 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
@@ -122,78 +122,74 @@ class OBluetoothInterface : public QObject
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 */
165class OBluetoothDevice : public QObject 165class 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