ReactOS  0.4.15-dev-1397-g19779b3
fbthci.h
Go to the documentation of this file.
1 #ifndef _HCI_H_
2 #define _HCI_H_
3 
4 #include <windows.h>
5 
6 #include "fbthw.h"
7 #include "fbtHciDefs.h"
8 
9 // Number of overlapped requests to have pending in the driver
10 #define HCI_NUMBER_OF_OVERLAPPED_LISTENS MAXIMUM_WAIT_OBJECTS-1
11 
12 // HCI Abstraction layer
13 class CHci;
14 typedef struct
15 {
19 
21 
22 class CHci : public CBTHW
23 {
24 public:
25  CHci(void);
26  virtual ~CHci(void);
27 
28  virtual DWORD StartEventListener(void);
29  virtual DWORD StopEventListener(void);
31 
34  static LPCTSTR GetManufacturerName(USHORT Company);
35 
36  virtual DWORD OnCommandComplete(BYTE NumHCICommandPackets, USHORT CommandOpcode, BYTE *Parameters, DWORD ParameterLength);
37  virtual DWORD OnCommandStatus(BYTE Status, BYTE NumHCICommandPackets, USHORT CommandOpcode);
38 
39  virtual DWORD OnConnectionRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], ULONG ClassOfDevice[FBT_HCI_DEVICE_CLASS_SIZE], BYTE LinkType);
40  virtual DWORD OnConnectionComplete(BYTE Status, USHORT ConnectionHandle, BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE LinkType, BYTE EncryptionMode);
42 
43  virtual DWORD OnInquiryComplete(BYTE Status, BYTE NumResponses);
44  virtual DWORD OnInquiryResult(BYTE NumResponses, BYTE BD_ADDR[FBT_HCI_VARIABLE_SIZE][FBT_HCI_BDADDR_SIZE], BYTE PageScanRepetitionMode[FBT_HCI_VARIABLE_SIZE], BYTE PageScanPeriodMode[FBT_HCI_VARIABLE_SIZE], BYTE PageScanMode[FBT_HCI_VARIABLE_SIZE], BYTE ClassOfDevice[FBT_HCI_VARIABLE_SIZE][FBT_HCI_DEVICE_CLASS_SIZE], USHORT ClockOffset[FBT_HCI_VARIABLE_SIZE]);
45 
47 
48  virtual DWORD OnRoleChange(BYTE Status, BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE Role);
49 
51 
54 
56 
58 
60 
61  virtual DWORD SendReset(void);
62 
63  virtual DWORD SendInquiry(ULONG LAP, BYTE InquiryLength, BYTE NumResponses);
64  virtual DWORD SendInquiryCancel(void);
65 
66  virtual DWORD SendReadBDADDR(void);
67 
68  virtual DWORD SendWriteScanEnable(BYTE ScanEnable);
69 
70  virtual DWORD SendWriteAuthenticationEnable(BYTE ScanEnable);
71 
72  virtual DWORD SendSetEventFilter(BYTE FilterType,
73  BYTE FilterConditionType,
75  BYTE ConditionBytes);
76 
77  virtual DWORD SendReadClassOfDevice(void);
78 
80 
82  USHORT PacketType,
83  BYTE PageScanRepetitionMode,
84  BYTE PageScanMode,
85  USHORT ClockOffset,
86  BYTE AllowRoleSwitch);
87 
88  virtual DWORD SendAcceptConnectionRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE RoleSwitch);
89 
91 
92  virtual DWORD SendWriteLinkSupervisionTimeout(USHORT ConnectionHandle, USHORT LinkSupervisionTimeout);
93 
94  virtual DWORD SendWritePageTimeout(USHORT PageTimeout);
95 
96  virtual DWORD SendRemoteNameRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE PageScanRepetitionMode, BYTE PageScanMode, USHORT ClockOffset);
97 
98  virtual DWORD SendReadLocalName(void);
99 
101 
102  virtual DWORD SendSwitchRole(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE Role);
103 
104  virtual DWORD SendPINCodeRequestReply(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE PINCodeLength, BYTE PINCode[FBT_HCI_PIN_CODE_SIZE]);
106 
109 
111 
113 
114 protected:
115  friend static DWORD CALLBACK Listener(LPVOID pContext);
116  friend static DWORD EventHandler(PFBT_HCI_EVENT_HEADER pEvent, DWORD Length);
117 
118  virtual DWORD SendHciCommand(PFBT_HCI_CMD_HEADER lpCommand, DWORD dwBufferSize);
119 
120  DWORD SendListenForEvent(OVERLAPPED *pOverlapped, BYTE *pEventBuffer);
121 
125 
127 
130 
131 };
132 
133 
134 #endif // _HCI_H_
virtual DWORD SendReadLocalName(void)
virtual DWORD SendDisconnect(USHORT ConnectionHandle, BYTE Reason)
DWORD m_dwListenerThreadId
Definition: fbthci.h:126
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
virtual DWORD OnDisconnectionComplete(BYTE Status, USHORT ConnectionHandle, BYTE Reason)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
CHci(void)
virtual DWORD SendWritePageTimeout(USHORT PageTimeout)
virtual DWORD SendLinkKeyRequestNegativeReply(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE])
virtual DWORD SendChangeLocalName(BYTE Name[FBT_HCI_NAME_SIZE])
virtual DWORD OnInquiryResult(BYTE NumResponses, BYTE BD_ADDR[FBT_HCI_VARIABLE_SIZE][FBT_HCI_BDADDR_SIZE], BYTE PageScanRepetitionMode[FBT_HCI_VARIABLE_SIZE], BYTE PageScanPeriodMode[FBT_HCI_VARIABLE_SIZE], BYTE PageScanMode[FBT_HCI_VARIABLE_SIZE], BYTE ClassOfDevice[FBT_HCI_VARIABLE_SIZE][FBT_HCI_DEVICE_CLASS_SIZE], USHORT ClockOffset[FBT_HCI_VARIABLE_SIZE])
HANDLE m_hListenerReadyEvent
Definition: fbthci.h:123
#define FBT_HCI_PIN_CODE_SIZE
Definition: fbtHciSizes.h:22
virtual DWORD SendSwitchRole(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE Role)
virtual DWORD SendAcceptConnectionRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE RoleSwitch)
virtual DWORD SendSetEventFilter(BYTE FilterType, BYTE FilterConditionType, BYTE Condition[FBT_HCI_MAX_CONDITION_SIZE], BYTE ConditionBytes)
virtual DWORD SendInquiryCancel(void)
virtual DWORD SendWriteClassOfDevice(BYTE ClassOfDevice[FBT_HCI_DEVICE_CLASS_SIZE])
virtual DWORD SendWriteScanEnable(BYTE ScanEnable)
virtual DWORD SendPINCodeRequestNegativeReply(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE])
#define CALLBACK
Definition: compat.h:35
virtual DWORD OnRoleChange(BYTE Status, BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE Role)
virtual DWORD SendReadBDADDR(void)
#define FBT_HCI_NAME_SIZE
Definition: fbtHciSizes.h:14
static friend DWORD EventHandler(PFBT_HCI_EVENT_HEADER pEvent, DWORD Length)
static LPCTSTR GetManufacturerName(USHORT Company)
virtual DWORD SendPINCodeRequestReply(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE PINCodeLength, BYTE PINCode[FBT_HCI_PIN_CODE_SIZE])
Definition: fbthw.h:7
virtual DWORD OnCommandStatus(BYTE Status, BYTE NumHCICommandPackets, USHORT CommandOpcode)
virtual DWORD OnEvent(PFBT_HCI_EVENT_HEADER pEvent, DWORD Length)
virtual DWORD OnRemoteNameRequestComplete(BYTE Status, BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE RemoteName[FBT_HCI_NAME_SIZE])
#define FBT_HCI_VARIABLE_SIZE
Definition: fbtHciSizes.h:24
virtual DWORD OnReadLocalNameComplete(BYTE Status, BYTE Name[FBT_HCI_NAME_SIZE])
virtual DWORD StartEventListener(void)
Definition: fbthci.h:22
HANDLE m_hStopListeningEvent
Definition: fbthci.h:122
CHci * pThis
Definition: fbthci.h:18
virtual DWORD SendReset(void)
DWORD dwLength
Definition: fbthci.h:17
#define FBT_HCI_MAX_CONDITION_SIZE
Definition: fbtHciSizes.h:19
virtual DWORD OnLinkKeyRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE])
IN ULONG IN UCHAR Condition
static LPCTSTR GetEventText(BYTE Event)
#define FBT_HCI_LINK_KEY_SIZE
Definition: fbtHciSizes.h:21
virtual DWORD OnConnectionRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], ULONG ClassOfDevice[FBT_HCI_DEVICE_CLASS_SIZE], BYTE LinkType)
virtual DWORD OnConnectionComplete(BYTE Status, USHORT ConnectionHandle, BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE LinkType, BYTE EncryptionMode)
Status
Definition: gdiplustypes.h:24
#define LAP
Definition: dither_impl.h:15
#define FBT_HCI_BDADDR_SIZE
Definition: fbtHciSizes.h:13
BYTE m_pEventBuffers[HCI_NUMBER_OF_OVERLAPPED_LISTENS][FBT_HCI_EVENT_MAX_SIZE]
Definition: fbthci.h:129
virtual DWORD SendCreateConnection(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], USHORT PacketType, BYTE PageScanRepetitionMode, BYTE PageScanMode, USHORT ClockOffset, BYTE AllowRoleSwitch)
HANDLE m_hListenerThread
Definition: fbthci.h:124
unsigned long DWORD
Definition: ntddk_ex.h:95
static friend DWORD CALLBACK Listener(LPVOID pContext)
struct HCI_EVENT * PHCI_EVENT
virtual DWORD OnPINCodeRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE])
virtual DWORD SendLinkKeyRequestReply(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE LinkKey[FBT_HCI_LINK_KEY_SIZE])
virtual DWORD SendRemoteNameRequest(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE PageScanRepetitionMode, BYTE PageScanMode, USHORT ClockOffset)
virtual DWORD SendReadLocalVersionInformation(void)
_In_ ULONG ParameterLength
Definition: usbdlib.h:206
unsigned char BYTE
Definition: xxhash.c:193
virtual DWORD OnLinkKeyNotification(BYTE BD_ADDR[FBT_HCI_BDADDR_SIZE], BYTE LinkKey[FBT_HCI_LINK_KEY_SIZE])
PFBT_HCI_EVENT_HEADER pEvent
Definition: fbthci.h:16
virtual DWORD SendInquiry(ULONG LAP, BYTE InquiryLength, BYTE NumResponses)
virtual DWORD OnInquiryComplete(BYTE Status, BYTE NumResponses)
DWORD SendListenForEvent(OVERLAPPED *pOverlapped, BYTE *pEventBuffer)
unsigned short USHORT
Definition: pedump.c:61
virtual DWORD SendHciCommand(PFBT_HCI_CMD_HEADER lpCommand, DWORD dwBufferSize)
#define HCI_NUMBER_OF_OVERLAPPED_LISTENS
Definition: fbthci.h:10
virtual DWORD OnAuthenticationComplete(BYTE Status, USHORT ConnectionHandle)
#define FBT_HCI_DEVICE_CLASS_SIZE
Definition: fbtHciSizes.h:16
DWORD CompareBDADDRs(BYTE BD_ADDR1[FBT_HCI_BDADDR_SIZE], BYTE BD_ADDR2[FBT_HCI_BDADDR_SIZE])
#define FBT_HCI_EVENT_MAX_SIZE
Definition: fbtHciSizes.h:8
virtual ~CHci(void)
unsigned int ULONG
Definition: retypes.h:1
virtual DWORD OnUnknown(PFBT_HCI_EVENT_HEADER pEvent, DWORD Length)
OVERLAPPED m_Overlappeds[HCI_NUMBER_OF_OVERLAPPED_LISTENS]
Definition: fbthci.h:128
static LPCTSTR GetStatusText(BYTE Status)
virtual DWORD OnCommandComplete(BYTE NumHCICommandPackets, USHORT CommandOpcode, BYTE *Parameters, DWORD ParameterLength)
_In_ PKSPIN_CONNECT _In_ ACCESS_MASK _Out_ PHANDLE ConnectionHandle
Definition: ks.h:4536
virtual DWORD SendWriteLinkSupervisionTimeout(USHORT ConnectionHandle, USHORT LinkSupervisionTimeout)
virtual DWORD SendReadClassOfDevice(void)
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:45
virtual DWORD SendWriteAuthenticationEnable(BYTE ScanEnable)
virtual DWORD StopEventListener(void)