2 * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #ifndef _LOCALDEVICE_IMPL_H_
6 #define _LOCALDEVICE_IMPL_H_
10 #include <bluetooth/bluetooth.h>
12 #include "LocalDeviceHandler.h"
14 #include "HCIDelegate.h"
15 #include "HCIControllerAccessor.h"
16 #include "HCITransportAccessor.h"
18 class LocalDeviceImpl
: public LocalDeviceHandler
{
21 LocalDeviceImpl(HCIDelegate
* hd
);
26 static LocalDeviceImpl
* CreateControllerAccessor(BPath
* path
);
27 static LocalDeviceImpl
* CreateTransportAccessor(BPath
* path
);
31 void HandleEvent(struct hci_event_header
* event
);
34 status_t
ProcessSimpleRequest(BMessage
* request
);
37 void HandleUnexpectedEvent(struct hci_event_header
* event
);
38 void HandleExpectedRequest(struct hci_event_header
* event
,
42 void CommandComplete(struct hci_ev_cmd_complete
* event
, BMessage
* request
,
44 void CommandStatus(struct hci_ev_cmd_status
* event
, BMessage
* request
,
47 void NumberOfCompletedPackets(struct hci_ev_num_comp_pkts
* event
);
50 void InquiryResult(uint8
* numberOfResponses
, BMessage
* request
);
51 void InquiryComplete(uint8
* status
, BMessage
* request
);
52 void RemoteNameRequestComplete(struct hci_ev_remote_name_request_complete_reply
*
53 remotename
, BMessage
* request
);
56 void ConnectionComplete(struct hci_ev_conn_complete
* event
, BMessage
* request
);
57 void ConnectionRequest(struct hci_ev_conn_request
* event
, BMessage
* request
);
58 void DisconnectionComplete(struct hci_ev_disconnection_complete_reply
* event
,
62 void PinCodeRequest(struct hci_ev_pin_code_req
* event
, BMessage
* request
);
63 void RoleChange(struct hci_ev_role_change
* event
, BMessage
* request
);
64 void LinkKeyNotify(struct hci_ev_link_key_notify
* event
, BMessage
* request
);
65 void ReturnLinkKeys(struct hci_ev_return_link_keys
* returnedKeys
);
67 void LinkKeyRequested(struct hci_ev_link_key_req
* keyReqyested
,
70 void PageScanRepetitionModeChange(struct hci_ev_page_scan_rep_mode_change
* event
,
72 void MaxSlotChange(struct hci_ev_max_slot_change
* event
, BMessage
* request
);
74 void HardwareError(struct hci_ev_hardware_error
* event
);