2008-07-03 00:01:02 +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 _REMOTE_DEVICE_H
|
|
|
|
#define _REMOTE_DEVICE_H
|
|
|
|
|
|
|
|
#include <bluetooth/bluetooth.h>
|
|
|
|
#include <bluetooth/BluetoothDevice.h>
|
|
|
|
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
#define B_BT_WAIT 0x00
|
|
|
|
#define B_BT_SUCCEEDED 0x01
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bluetooth {
|
|
|
|
|
|
|
|
class Connection;
|
|
|
|
class LocalDevice;
|
|
|
|
|
|
|
|
class RemoteDevice : public BluetoothDevice {
|
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
public:
|
|
|
|
static const int WAIT = B_BT_WAIT;
|
|
|
|
static const int SUCCEEDED = B_BT_SUCCEEDED;
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
virtual ~RemoteDevice();
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
bool IsTrustedDevice();
|
|
|
|
BString GetFriendlyName(bool alwaysAsk); /* Throwing */
|
|
|
|
BString GetFriendlyName(void); /* Throwing */
|
|
|
|
bdaddr_t GetBluetoothAddress();
|
|
|
|
DeviceClass GetDeviceClass();
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
bool Equals(RemoteDevice* obj);
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
/*static RemoteDevice* GetRemoteDevice(Connection conn); Throwing */
|
|
|
|
bool Authenticate(); /* Throwing */
|
|
|
|
/* bool Authorize(Connection conn); Throwing */
|
|
|
|
/*bool Encrypt(Connection conn, bool on); Throwing */
|
|
|
|
bool IsAuthenticated(); /* Throwing */
|
|
|
|
/*bool IsAuthorized(Connection conn); Throwing */
|
|
|
|
bool IsEncrypted(); /* Throwing */
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
BString GetProperty(const char* property); /* Throwing */
|
2009-03-22 00:38:00 +03:00
|
|
|
status_t GetProperty(const char* property, uint32* value); /* Throwing */
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
LocalDevice* GetLocalDeviceOwner();
|
2008-07-25 00:54:32 +04:00
|
|
|
|
2008-08-04 21:58:09 +04:00
|
|
|
RemoteDevice(const BString& address);
|
2008-12-14 02:41:32 +03:00
|
|
|
RemoteDevice(const bdaddr_t address, uint8 record[3]);
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
protected:
|
|
|
|
/* called by Discovery[Listener|Agent] */
|
|
|
|
void SetLocalDeviceOwner(LocalDevice* ld);
|
|
|
|
friend class DiscoveryListener;
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
private:
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
LocalDevice* fDiscovererLocalDevice;
|
|
|
|
BMessenger* fMessenger;
|
2008-07-03 00:01:02 +04:00
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
uint8 fPageRepetitionMode;
|
|
|
|
uint8 fScanPeriodMode;
|
|
|
|
uint8 fScanMode;
|
|
|
|
uint16 fClockOffset;
|
2008-07-03 00:01:02 +04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef _BT_USE_EXPLICIT_NAMESPACE
|
|
|
|
using Bluetooth::RemoteDevice;
|
|
|
|
#endif
|
|
|
|
|
2008-08-03 01:15:02 +04:00
|
|
|
#endif // _REMOTE_DEVICE_H
|