xref: /haiku/src/servers/bluetooth/LocalDeviceImpl.h (revision 8195a5a835117ab2da405e0d477153570b75d921)
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 _LOCALDEVICE_IMPL_H_
9 #define _LOCALDEVICE_IMPL_H_
10 
11 #include <String.h>
12 
13 #include <bluetooth/bluetooth.h>
14 
15 #include "LocalDeviceHandler.h"
16 
17 #include "HCIDelegate.h"
18 #include "HCIControllerAccessor.h"
19 #include "HCITransportAccessor.h"
20 
21 class LocalDeviceImpl : public LocalDeviceHandler {
22 
23 private:
24 	LocalDeviceImpl(HCIDelegate* hd);
25 
26 public:
27 
28     // Factory methods
29     static LocalDeviceImpl* CreateControllerAccessor(BPath* path);
30     static LocalDeviceImpl* CreateTransportAccessor(BPath* path);
31 
32 	void HandleEvent(struct hci_event_header* event);
33 
34     /* Request handling */
35 	status_t GetAddress(bdaddr_t* bdaddr, BMessage* request);
36 	status_t GetFriendlyName(BString str, BMessage* request);
37 	status_t ProcessSimpleRequest(BMessage* request);
38 
39     /* Events handling */
40     void CommandComplete(struct hci_ev_cmd_complete* event, BMessage* request);
41 
42 };
43 
44 #endif
45