[CMAKE]
[reactos.git] / drivers / bluetooth / fbtusb / include / fbtHciLocal.h
1 #ifndef _LOCAL_HCI_H_
2 #define _LOCAL_HCI_H_
3
4 #include "fbtHci.h"
5
6 #define MAX_QUEUED_COMMANDS 100
7
8 typedef struct _QueuedCommand
9 {
10 USHORT nCommand;
11 BYTE *pResultBuffer;
12 DWORD dwBufferSize;
13 HANDLE hEvent;
14
15 } QueuedCommand, *PQueuedCommand;
16
17 // Local HCI command abstraction
18 // 1. Send Command
19 // 2. Wait for Command status / Command complete
20 class CHciLocal : public CHci
21 {
22 public:
23 CHciLocal(void);
24 virtual ~CHciLocal(void);
25
26 virtual int QueueCommand(USHORT nCommand, BYTE *pResultBuffer=NULL, DWORD dwBufferSize=0);
27 virtual int QueueCommandStatus(USHORT nCommand);
28 virtual void DeQueueCommand(int nSlot);
29 virtual DWORD ClearQueue(void);
30 virtual PQueuedCommand GetQueuedCommand(int nSlot);
31
32 virtual DWORD WaitForCommandComplete(int nSlot);
33 virtual DWORD WaitForCommandStatus(int nSlot, BYTE &nStatus);
34
35 virtual DWORD SendReset(void);
36 virtual DWORD SendWriteClassOfDevice(BYTE ClassOfDevice[FBT_HCI_DEVICE_CLASS_SIZE]);
37 virtual DWORD SendSetEventFilter(
38 BYTE nFilterType,
39 BYTE nFilterConditionType,
40 BYTE nCondition[FBT_HCI_MAX_CONDITION_SIZE],
41 BYTE nConditionBytes);
42
43 virtual DWORD SendInquiry(ULONG nLAP, BYTE nInquiryLength, BYTE nNumResponses);
44 virtual DWORD SendInquiryCancel(void);
45 virtual DWORD SendCreateConnection(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE],
46 USHORT nPacketType,
47 BYTE nPageScanRepetitionMode,
48 BYTE nPageScanMode,
49 USHORT nClockOffset,
50 BYTE nAllowRoleSwitch);
51
52 virtual DWORD SendDisconnect(USHORT nConnectionHandle, BYTE nReason);
53 virtual DWORD SendSwitchRole(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE nRole);
54 virtual DWORD SendRemoteNameRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE nPageScanRepetitionMode, BYTE nPageScanMode, USHORT nClockOffset);
55 virtual DWORD SendReadLocalVersionInformation(FBT_HCI_READ_LOCAL_VERSION_INFORMATION_COMPLETE &CommandComplete);
56
57 virtual DWORD OnEvent(PFBT_HCI_EVENT_HEADER pEvent, DWORD dwLength);
58
59 virtual DWORD CommandCompleteHandler(USHORT nCommand, BYTE *pParameters, DWORD dwParameterLength);
60 virtual DWORD CommandStatusHandler(BYTE nStatus, USHORT nCommand);
61
62 protected:
63 virtual int FindCommandSlot(USHORT nCommand);
64
65 QueuedCommand m_QueuedCommands[MAX_QUEUED_COMMANDS];
66 CRITICAL_SECTION m_QueueCriticalSection;
67
68 };
69
70
71 #endif // _LOCAL_HCI_H_