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:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <bluetooth/bluetooth.h>
|
#include <bluetooth/bluetooth.h>
|
||||||
#include <bluetooth/DiscoveryListener.h>
|
#include <bluetooth/DiscoveryListener.h>
|
||||||
|
#include <bluetooth/RemoteDevice.h>
|
||||||
|
|
||||||
|
|
||||||
#define BT_CACHED 0x00
|
#define BT_CACHED 0x00
|
||||||
@@ -17,13 +18,15 @@
|
|||||||
#define BT_LIAC 0x9E8B00
|
#define BT_LIAC 0x9E8B00
|
||||||
|
|
||||||
#define BT_MAX_RESPONSES (32)
|
#define BT_MAX_RESPONSES (32)
|
||||||
|
|
||||||
#define BT_BASE_INQUIRY_TIME (1.28)
|
#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 {
|
namespace Bluetooth {
|
||||||
|
|
||||||
class DiscoveryListener;
|
class LocalDevice;
|
||||||
class RemoteDevice;
|
|
||||||
|
|
||||||
class DiscoveryAgent {
|
class DiscoveryAgent {
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <Looper.h>
|
#include <Looper.h>
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
|
|
||||||
|
#include <bluetooth/DeviceClass.h>
|
||||||
#include <bluetooth/RemoteDevice.h>
|
#include <bluetooth/RemoteDevice.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -20,8 +21,6 @@ namespace Bluetooth {
|
|||||||
|
|
||||||
typedef BObjectList<RemoteDevice> RemoteDevicesList;
|
typedef BObjectList<RemoteDevice> RemoteDevicesList;
|
||||||
|
|
||||||
class RemoteDevice;
|
|
||||||
class DeviceClass;
|
|
||||||
class LocalDevice;
|
class LocalDevice;
|
||||||
|
|
||||||
class DiscoveryListener : public BLooper {
|
class DiscoveryListener : public BLooper {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ DiscoveryAgent::RetrieveDevices(int option)
|
|||||||
status_t
|
status_t
|
||||||
DiscoveryAgent::StartInquiry(int accessCode, DiscoveryListener* listener)
|
DiscoveryAgent::StartInquiry(int accessCode, DiscoveryListener* listener)
|
||||||
{
|
{
|
||||||
return StartInquiry(accessCode, listener, BT_DEFAULT_INQUIRY_TIME);
|
return StartInquiry(accessCode, listener, GetInquiryTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,13 @@
|
|||||||
* All rights reserved. Distributed under the terms of the MIT License.
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <bluetooth/bluetooth.h>
|
#include <bluetooth/bluetooth.h>
|
||||||
|
#include <bluetooth/DiscoveryAgent.h>
|
||||||
|
|
||||||
#include <bluetoothserver_p.h>
|
#include <bluetoothserver_p.h>
|
||||||
|
|
||||||
#include "KitSupport.h"
|
#include "KitSupport.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BMessenger* _RetrieveBluetoothMessenger(void)
|
BMessenger* _RetrieveBluetoothMessenger(void)
|
||||||
{
|
{
|
||||||
// Fix/review: leaking memory here
|
// Fix/review: leaking memory here
|
||||||
@@ -24,3 +21,16 @@ BMessenger* _RetrieveBluetoothMessenger(void)
|
|||||||
else
|
else
|
||||||
return fMessenger;
|
return fMessenger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8 GetInquiryTime()
|
||||||
|
{
|
||||||
|
return BT_DEFAULT_INQUIRY_TIME;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetInquiryTime(uint8 time)
|
||||||
|
{
|
||||||
|
((void)(time));
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,3 +5,6 @@
|
|||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
|
|
||||||
BMessenger* _RetrieveBluetoothMessenger(void);
|
BMessenger* _RetrieveBluetoothMessenger(void);
|
||||||
|
|
||||||
|
uint8 GetInquiryTime();
|
||||||
|
void SetInquiryTime(uint8 time);
|
||||||
|
|||||||
Reference in New Issue
Block a user