1 /* 2 * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3 * 4 * All rights reserved. Distributed under the terms of the MIT License. 5 * 6 */ 7 8 #ifndef _REMOTE_DEVICE_H 9 #define _REMOTE_DEVICE_H 10 11 #include <bluetooth/bluetooth.h> 12 13 #include <String.h> 14 15 #define B_BT_WAIT 0x00 16 #define B_BT_SUCCEEDED 0x01 17 18 19 namespace Bluetooth { 20 21 class Connection; 22 class LocalDevice; 23 24 class RemoteDevice { 25 26 public: 27 28 static const int WAIT = B_BT_WAIT; 29 static const int SUCCEEDED = B_BT_SUCCEEDED; 30 31 bool IsTrustedDevice(); 32 BString GetFriendlyName(bool alwaysAsk); /* Throwing */ 33 BString GetBluetoothAddress(); 34 bool Equals(RemoteDevice* obj); 35 36 /*static RemoteDevice* GetRemoteDevice(Connection conn); Throwing */ 37 bool Authenticate(); /* Throwing */ 38 /* bool Authorize(Connection conn); Throwing */ 39 /*bool Encrypt(Connection conn, bool on); Throwing */ 40 bool IsAuthenticated(); /* Throwing */ 41 /*bool IsAuthorized(Connection conn); Throwing */ 42 bool IsEncrypted(); /* Throwing */ 43 44 protected: 45 RemoteDevice(BString address); 46 RemoteDevice(bdaddr_t address); 47 48 /* Instances of this class only will be done by Discovery[Listener|Agent] TODO */ 49 friend class DiscoveryListener; 50 51 private: 52 void SetLocalDeviceOwner(LocalDevice* ld); 53 54 bdaddr_t fBdaddr; 55 LocalDevice* fDiscovererLocalDevice; 56 57 }; 58 59 } 60 61 #endif 62