HCI Callbacks (Windows Embedded CE 6.0)
The HCI_CALLBACKS structure declared in bt_ddi.h declares an entry point for each HCI command defined by the Bluetooth Core Specification. For more information about HCI commands, see the Host Controller Interface Functional Specification at this Official Bluetooth Wireless Info Web site.
Every _In command declared in HCI_INTERFACE has a corresponding _Out command that is declared in HCI_CALLBACKS.
The following code example shows the function pointer declaration for the callback, HCI_CreateConnection_Out of the HCI_CreateConnection_In command described in HCI Commands.
typedef int (*HCI_CreateConnection_Out) (void *pCallContext, unsigned char status);
Callbacks can be divided into the following categories:
Callbacks that only return status information.
Callbacks that are associated with commands that have an immediate effect and terminate with HCI_CommandCompleteEvent such as HCI_Inquiry, fall into this category. The following code example shows the function pointer declaration for the HCI_Inquiry callback.
typedef int (*HCI_Inquiry_Out) ( void *pCallContext, unsigned char status );
Callbacks that return data in addition to status information.
The following code example shows a command that carries meaningful output values.
typedef int (*HCI_ReadPINType_Out)( void *pCallContext, unsigned char status, unsigned char PIN_type );