Add prototypes to keep/use global Inquiry time

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29264 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes 2009-02-20 18:25:41 +00:00
parent b36b65f92c
commit fa262f2273
5 changed files with 26 additions and 11 deletions

View File

@ -7,6 +7,7 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/DiscoveryListener.h>
#include <bluetooth/RemoteDevice.h>
#define BT_CACHED 0x00
@ -17,13 +18,15 @@
#define BT_LIAC 0x9E8B00
#define BT_MAX_RESPONSES (32)
#define BT_BASE_INQUIRY_TIME (1.28)
#define BT_DEFAULT_INQUIRY_TIME (0x15*BT_BASE_INQUIRY_TIME) /* TODO: REVIEW SPECS! */
#define BT_DEFAULT_INQUIRY_TIME (0x0A)
#define BT_MIN_INQUIRY_TIME (0x01) // 1.18 secs
#define BT_MAX_INQUIRY_TIME (0x30) // 61.44 secs
namespace Bluetooth {
class DiscoveryListener;
class RemoteDevice;
class LocalDevice;
class DiscoveryAgent {

View File

@ -8,6 +8,7 @@
#include <Looper.h>
#include <ObjectList.h>
#include <bluetooth/DeviceClass.h>
#include <bluetooth/RemoteDevice.h>
@ -20,8 +21,6 @@ namespace Bluetooth {
typedef BObjectList<RemoteDevice> RemoteDevicesList;
class RemoteDevice;
class DeviceClass;
class LocalDevice;
class DiscoveryListener : public BLooper {

View File

@ -36,7 +36,7 @@ DiscoveryAgent::RetrieveDevices(int option)
status_t
DiscoveryAgent::StartInquiry(int accessCode, DiscoveryListener* listener)
{
return StartInquiry(accessCode, listener, BT_DEFAULT_INQUIRY_TIME);
return StartInquiry(accessCode, listener, GetInquiryTime());
}

View File

@ -4,16 +4,13 @@
* All rights reserved. Distributed under the terms of the MIT License.
*
*/
#include <bluetooth/bluetooth.h>
#include <bluetooth/DiscoveryAgent.h>
#include <bluetoothserver_p.h>
#include "KitSupport.h"
BMessenger* _RetrieveBluetoothMessenger(void)
{
// Fix/review: leaking memory here
@ -24,3 +21,16 @@ BMessenger* _RetrieveBluetoothMessenger(void)
else
return fMessenger;
}
uint8 GetInquiryTime()
{
return BT_DEFAULT_INQUIRY_TIME;
}
void SetInquiryTime(uint8 time)
{
((void)(time));
}

View File

@ -5,3 +5,6 @@
#include <Messenger.h>
BMessenger* _RetrieveBluetoothMessenger(void);
uint8 GetInquiryTime();
void SetInquiryTime(uint8 time);