2007-10-21 21:56:01 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
|
|
|
*
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LOCAL_DEVICE_H
|
|
|
|
#define _LOCAL_DEVICE_H
|
|
|
|
|
|
|
|
#include <bluetooth/bluetooth.h>
|
|
|
|
#include <bluetooth/DeviceClass.h>
|
|
|
|
|
2008-02-02 00:17:02 +03:00
|
|
|
#include <bluetooth/HCI/btHCI.h>
|
|
|
|
|
|
|
|
#include <Messenger.h>
|
|
|
|
#include <Message.h>
|
|
|
|
|
2007-10-21 21:56:01 +04:00
|
|
|
#include <String.h>
|
|
|
|
|
2008-02-02 00:17:02 +03:00
|
|
|
|
2007-10-21 21:56:01 +04:00
|
|
|
namespace Bluetooth {
|
|
|
|
|
2007-10-22 21:51:59 +04:00
|
|
|
class DiscoveryAgent;
|
2007-10-21 21:56:01 +04:00
|
|
|
|
2007-10-22 21:51:59 +04:00
|
|
|
class LocalDevice {
|
|
|
|
|
|
|
|
public:
|
|
|
|
/* Possible throwing */
|
|
|
|
static LocalDevice* GetLocalDevice();
|
2008-02-02 00:17:02 +03:00
|
|
|
static uint32 GetLocalDeviceCount();
|
|
|
|
|
|
|
|
static LocalDevice* GetLocalDevice(hci_id hid);
|
2007-10-22 21:51:59 +04:00
|
|
|
static LocalDevice* GetLocalDevice(bdaddr_t bdaddr);
|
|
|
|
|
|
|
|
DiscoveryAgent* GetDiscoveryAgent();
|
|
|
|
BString GetFriendlyName();
|
|
|
|
DeviceClass GetDeviceClass();
|
|
|
|
/* Possible throwing */
|
2008-03-06 02:29:04 +03:00
|
|
|
status_t SetDiscoverable(int mode);
|
2007-10-22 21:51:59 +04:00
|
|
|
|
|
|
|
BString GetProperty(const char* property);
|
|
|
|
void GetProperty(const char* property, uint32* value);
|
|
|
|
|
|
|
|
int GetDiscoverable();
|
2008-02-02 00:17:02 +03:00
|
|
|
bdaddr_t GetBluetoothAddress();
|
|
|
|
/*
|
2007-10-22 21:51:59 +04:00
|
|
|
ServiceRecord getRecord(Connection notifier);
|
|
|
|
void updateRecord(ServiceRecord srvRecord);
|
2008-02-02 00:17:02 +03:00
|
|
|
*/
|
2007-10-22 21:51:59 +04:00
|
|
|
private:
|
2008-03-31 01:42:22 +04:00
|
|
|
LocalDevice(hci_id hid);
|
2008-02-02 00:17:02 +03:00
|
|
|
|
|
|
|
static LocalDevice* RequestLocalDeviceID(BMessage* request);
|
|
|
|
|
|
|
|
static BMessenger* sfMessenger;
|
|
|
|
BMessenger* fMessenger;
|
|
|
|
|
|
|
|
hci_id hid;
|
2008-03-31 01:42:22 +04:00
|
|
|
hci_id GetID(void) {return hid;}
|
|
|
|
|
|
|
|
friend class DiscoveryAgent;
|
2007-10-22 21:51:59 +04:00
|
|
|
};
|
2007-10-21 21:56:01 +04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-02-22 01:17:54 +03:00
|
|
|
#ifndef _BT_USE_EXPLICIT_NAMESPACE
|
|
|
|
using Bluetooth::LocalDevice;
|
|
|
|
#endif
|
|
|
|
|
2007-10-21 21:56:01 +04:00
|
|
|
#endif
|