xref: /haiku/headers/os/bluetooth/RemoteDevice.h (revision b30304acc8c37e678a1bf66976d15bdab103f931)
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 #include <bluetooth/BluetoothDevice.h>
13 
14 #include <String.h>
15 
16 #define B_BT_WAIT 0x00
17 #define B_BT_SUCCEEDED 0x01
18 
19 
20 namespace Bluetooth {
21 
22 class Connection;
23 class LocalDevice;
24 
25 class RemoteDevice : public BluetoothDevice {
26 
27     public:
28 
29         static const int WAIT = B_BT_WAIT;
30         static const int SUCCEEDED = B_BT_SUCCEEDED;
31 
32         bool IsTrustedDevice();
33         BString GetFriendlyName(bool alwaysAsk); /* Throwing */
34         BString GetFriendlyName(void); /* Throwing */
35         bdaddr_t GetBluetoothAddress();
36         DeviceClass GetDeviceClass();
37 
38         bool Equals(RemoteDevice* obj);
39 
40         /*static RemoteDevice* GetRemoteDevice(Connection conn);   Throwing */
41         bool Authenticate(); /* Throwing */
42         /* bool Authorize(Connection conn);  Throwing */
43         /*bool Encrypt(Connection conn, bool on);  Throwing */
44         bool IsAuthenticated(); /* Throwing */
45         /*bool IsAuthorized(Connection conn);  Throwing */
46         bool IsEncrypted(); /* Throwing */
47 
48         BString GetProperty(const char* property); /* Throwing */
49         void GetProperty(const char* property, uint32* value); /* Throwing */
50 
51 
52     protected:
53         RemoteDevice(BString address);
54         RemoteDevice(bdaddr_t address);
55 
56     /* Instances of this class only will be done by Discovery[Listener|Agent] TODO */
57     friend class DiscoveryListener;
58 
59     private:
60 		void         SetLocalDeviceOwner(LocalDevice* ld);
61 
62 
63     	LocalDevice* fDiscovererLocalDevice;
64 
65     	uint8		 fPageRepetitionMode;
66     	uint8		 fScanPeriodMode;
67     	uint8		 fScanMode;
68  		uint16       fClockOffset;
69 
70 };
71 
72 }
73 
74 #ifndef _BT_USE_EXPLICIT_NAMESPACE
75 using Bluetooth::RemoteDevice;
76 #endif
77 
78 #endif
79