HCI Commands (Windows Embedded CE 6.0)

1/6/2010

The HCI_INTERFACE structure declares an entry point for each HCI-level Bluetooth command as defined by the HCI Specification at this Official Bluetooth Wireless Info Web site.

Each function pointer that is declared in HCI_INTERFACE takes a void* cookie that uniquely identifies the call context of the layer that calls the command. The following code example shows the function pointer declaration of the HCI_CreateConnection command.

typedef int (*HCI_CreateConnection_In)
  (HANDLE hDeviceContext, 
   void *pCallContext, 
   BD_ADDR *pba, 
   unsigned short packet_type, 
   unsigned char page_scan_repetition_mode, 
   unsigned char page_scan_mode, 
   unsigned short clock_offset, 
   unsigned char allow_role_switch);
Ee495543.note(en-US,WinEmbedded.60).gifNote:
Function pointers for commands are named with an _In suffix.

Calls to HCI commands can be terminated by calling HCI_AbortCall. Calls can also be aborted by the underlying system for communication loss, timeout, card being popped out, or other reasons, in which case, the system calls HCI_AbortCall with this cookie.

Every _In command declared in HCI_INTERFACE has a corresponding _Out HCI Callback function. If the call to an HCI command is successfully completed, the HCI layer calls one of the callbacks provided by the upper layer. Some commands like HCI_CreateConnection raise events to inform the caller that the command execution is complete. For more information about HCI_EVENT_INDICATION, see HCI Events.

Ee495543.note(en-US,WinEmbedded.60).gifNote:
Not all HCI commands are implemented. These are declared with NULL pointers in HCI_INTERFACE.

Community Additions

ADD
Show: