xref: /haiku/src/servers/bluetooth/LocalDeviceImpl.h (revision 4b3b81da9e459443d75329cfd08bc9a57ad02653)
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 	void CommandStatus(struct hci_ev_cmd_status* event, BMessage* request);
42 
43 	// Inquiry
44 	void InquiryResult(struct inquiry_info* event, BMessage* request);
45 	void InquiryComplete(uint8* status, BMessage* request);
46 
47 };
48 
49 #endif
50