author | mickeyl <mickeyl> | 2005-05-03 14:06:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-05-03 14:06:40 (UTC) |
commit | a0da10e78110fe3b291f4d2d3956bf6003ca2d2a (patch) (side-by-side diff) | |
tree | 8b902cdc88d4c196971c7a925aa3e7dfc2215c54 | |
parent | 8dc5378786b26d847e4771129760ccb76f04c40f (diff) | |
download | opie-a0da10e78110fe3b291f4d2d3956bf6003ca2d2a.zip opie-a0da10e78110fe3b291f4d2d3956bf6003ca2d2a.tar.gz opie-a0da10e78110fe3b291f4d2d3956bf6003ca2d2a.tar.bz2 |
GET_LINK_QUALITY_RP_SIZE has been renamed to READ_LINK_QUALITY_RP_SIZE in newer versions of bluez
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTDriver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp index cfd0491..dbc9b97 100644 --- a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp @@ -1,208 +1,210 @@ /*************************************************************************** * Copyright (C) 2003 by Mattia Merzi * * ottobit@ferrara.linux.it * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include <opie2/odebug.h> #include <qtimer.h> #include <sys/poll.h> #include <bluezlib.h> - +#ifndef GET_LINK_QUALITY_RP_SIZE +#define GET_LINK_QUALITY_RP_SIZE READ_LINK_QUALITY_RP_SIZE +#endif #include <OTGateway.h> #include <OTDriver.h> #include <OTHCISocket.h> using namespace Opietooth2; static struct { const char *str; unsigned short rev; } csr_map[] = { { "HCI 11.2 (bc01b)", 114 }, { "HCI 11.3 (bc01b)", 115 }, { "HCI 12.1 (bc01b)", 119 }, { "HCI 12.3 (bc01b)", 134 }, { "HCI 12.7 (bc01b)", 188 }, { "HCI 12.8 (bc01b)", 218 }, { "HCI 12.9 (bc01b)", 283 }, { "HCI 13.10 (bc01b)", 309 }, { "HCI 13.11 (bc01b)", 351 }, { "HCI 16.4 (bc01b)", 523 }, { "HCI 14.3 (bc02x)", 272 }, { "HCI 14.6 (bc02x)", 336 }, { "HCI 14.7 (bc02x)", 373 }, { "HCI 14.8 (bc02x)", 487 }, { "HCI 15.3 (bc02x)", 443 }, { "HCI 16.4 (bc02x)", 525 }, { NULL, 0} }; static char *services[] = { "Positioning", "Networking", "Rendering", "Capturing", "Object Transfer", "Audio", "Telephony", "Information" }; static char *major_devices[] = { "Miscellaneous", "Computer", "Phone", "LAN Access", "Audio/Video", "Peripheral", "Imaging", "Uncategorized" }; typedef struct { short Minor; const char * Description; } ClassMap_t; static ClassMap_t MapMiscClass[] = { { -1, "" } }; static ClassMap_t MapUnclassifiedClass[] = { { -1, "" } }; static ClassMap_t MapComputerClass[] = { { 0, "Uncategorized" } , { 1, "Desktop workstation" } , { 2, "Server" } , { 3, "Laptop" } , { 4, "Handheld" } , { 5, "Palm" } , { 6, "Wearable" }, { -1, 0 } }; static ClassMap_t MapPhoneClass[] = { { 0, "Uncategorized" }, { 1, "Cellular" }, { 2, "Cordless" }, { 3, "Smart phone" }, { 4, "Wired modem or voice gateway" }, { 5, "Common ISDN Access" }, { 6, "Sim Card Reader" }, { -1, 0 } }; static ClassMap_t MapAVClass[] = { { 0, "Uncategorized" }, { 1, "Device conforms to the Headset profile" }, { 2, "Hands-free" }, { 3, 0 }, { 4, "Microphone" }, { 5, "Loudspeaker" }, { 6, "Headphones" }, { 7, "Portable Audio" }, { 8, "Car Audio" }, { 9, "Set-top box" }, { 10, "HiFi Audio Device" }, { 11, "VCR" }, { 12, "Video Camera" }, { 13, "Camcorder" }, { 14, "Video Monitor" }, { 15, "Video Display and Loudspeaker" }, { 16, "Video Conferencing" }, { 17, 0 }, { 18, "Gaming/Toy" }, { -1, 0 } }; static ClassMap_t MapPeripheralClass[] = { { 16, "Keyboard" }, { 32, "Pointing device" }, { 48, "Combo keyboard/pointing device" }, { -1, 0 } }; typedef struct { int Major; ClassMap_t * Map; } MainClassMap_t; static MainClassMap_t MainClasses[] = { { 0, MapMiscClass }, { 1, MapComputerClass }, { 2, MapPhoneClass }, { 3, 0 }, // special case { 4, MapAVClass }, { 5, MapPeripheralClass }, { 6, 0 }, // special case { 63, MapUnclassifiedClass }, { -1, 0 } }; OTDriver::OTDriver( OTGateway * _OT, struct hci_dev_info* di) : QObject( _OT ), Address() { OT = _OT; IsUp = 0; Socket = 0; init(di); odebug << "Driver " << devname() << oendl; AutoClose = new QTimer( this ); connect( AutoClose, SIGNAL( timeout() ), this, SLOT( SLOT_CloseFd() ) ); } OTDriver::~OTDriver() { closeSocket(); SLOT_CloseFd(); } void OTDriver::SLOT_CloseFd( void ){ if ( isOpen() ) { AutoClose->stop(); ::close( fd() ); setfd( -1 ); } } void OTDriver::init(struct hci_dev_info* di) { Dev = di->name; setDevId(di->dev_id); setType(di->type); setFlags(di->flags); Address.setBDAddr( di->bdaddr ); setFeatures(di->features); setfd( -1 ); // not open Manufacturer = ""; } // internal reinitialize void OTDriver::reinit() { bool Old; Old = IsUp; if( currentState() < 0 ) return; if( Old != IsUp ) { // state changes emit stateChange( this, IsUp ); } } // requested by application int OTDriver::currentState() { struct hci_dev_info di; // uint16_t tmp_dev_id = device_info.dev_id; |