b426fc0487
- Polish a bit the classes composing the Discovery process git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24697 a95241bf-73f2-0310-859d-f6bbb57e9c96
69 lines
1.9 KiB
C++
69 lines
1.9 KiB
C++
/*
|
|
* Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
|
*
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
|
*
|
|
*/
|
|
|
|
#ifndef _DISCOVERY_AGENT_H
|
|
#define _DISCOVERY_AGENT_H
|
|
|
|
#include <bluetooth/bluetooth.h>
|
|
#include <bluetooth/DiscoveryListener.h>
|
|
|
|
|
|
#define BT_CACHED 0x00
|
|
#define BT_PREKNOWN 0x01
|
|
#define BT_NOT_DISCOVERABLE 0x01
|
|
|
|
#define BT_GIAC 0x9E8B33
|
|
#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! */
|
|
|
|
namespace Bluetooth {
|
|
|
|
class DiscoveryListener;
|
|
class RemoteDevice;
|
|
|
|
class DiscoveryAgent {
|
|
|
|
public:
|
|
|
|
static const int GIAC = BT_GIAC;
|
|
static const int LIAC = BT_LIAC;
|
|
|
|
static const int PREKNOWN = BT_PREKNOWN;
|
|
static const int CACHED = BT_CACHED;
|
|
static const int NOT_DISCOVERABLE = BT_NOT_DISCOVERABLE;
|
|
|
|
RemoteDevicesList RetrieveDevices(int option); /* TODO */
|
|
status_t StartInquiry(int accessCode, DiscoveryListener* listener); /* Throwing */
|
|
status_t StartInquiry(uint32 accessCode, DiscoveryListener* listener, bigtime_t secs);
|
|
status_t CancelInquiry(DiscoveryListener* listener);
|
|
|
|
/*
|
|
int searchServices(int[] attrSet,
|
|
UUID[] uuidSet,
|
|
RemoteDevice btDev,
|
|
DiscoveryListener discListener);
|
|
|
|
bool cancelServiceSearch(int transID);
|
|
BString selectService(UUID uuid, int security, boolean master);
|
|
*/
|
|
|
|
private:
|
|
DiscoveryAgent();
|
|
void SetLocalDeviceOwner(LocalDevice* ld);
|
|
|
|
DiscoveryListener* fLastUsedListener;
|
|
LocalDevice* fLocalDevice;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|