📄 bt_ddi.h
字号:
typedef int (*HCI_WriteEncryptionMode_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char encryption_mode);
typedef int (*HCI_WriteEncryptionMode_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadClassOfDevice_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadClassOfDevice_Out) (void *pCallContext, unsigned char status, unsigned int class_of_device);
typedef int (*HCI_WriteClassOfDevice_In) (HANDLE hDeviceContext, void *pCallContext, unsigned int class_of_device);
typedef int (*HCI_WriteClassOfDevice_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadVoiceSetting_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadVoiceSetting_Out) (void *pCallContext, unsigned char status, unsigned short voice_channel_setting);
typedef int (*HCI_WriteVoiceSetting_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short voice_channel_setting);
typedef int (*HCI_WriteVoiceSetting_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadAutomaticFlushTimeout_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle);
typedef int (*HCI_ReadAutomaticFlushTimeout_Out) (void *pCallContext, unsigned char status, unsigned short connectin_handle, unsigned short flush_timeout);
typedef int (*HCI_WriteAutomaticFlushTimeout_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle, unsigned short flush_timeout);
typedef int (*HCI_WriteAutomaticFlushTimeout_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle);
typedef int (*HCI_ReadNumBroadcastRetransmissions_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadNumBroadcastRetransmissions_Out) (void *pCallContext, unsigned char status, unsigned char num_broadcast_retran);
typedef int (*HCI_WriteNumBroadcastRetransmissions_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char num_broadcast_retran);
typedef int (*HCI_WriteNumBroadcastRetransmissions_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadHoldModeActivity_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadHoldModeActivity_Out) (void *pCallContext, unsigned char status, unsigned char hold_mode_activity);
typedef int (*HCI_WriteHoldModeActivity_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char hold_mode_activity);
typedef int (*HCI_WriteHoldModeActivity_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadTransmitPowerLevel_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle, unsigned char type);
typedef int (*HCI_ReadTransmitPowerLevel_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle, char power_level);
typedef int (*HCI_ReadSCOFlowControlEnable_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadSCOFlowControlEnable_Out) (void *pCallContext, unsigned char status, unsigned char SCO_flow_control_enable);
typedef int (*HCI_WriteSCOFlowControlEnable_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char SCO_flow_control_enable);
typedef int (*HCI_WriteSCOFlowControlEnable_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_SetHostControllerToHostFlowControl_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char flow_control_enable);
typedef int (*HCI_SetHostControllerToHostFlowControl_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_HostBufferSize_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short host_acl_data_packet_length, unsigned char host_sco_data_packet_length, unsigned short host_total_num_acl_data_packets, unsigned short host_total_num_sco_data_packets);
typedef int (*HCI_HostBufferSize_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_HostNumberOfCompletedPackets) (HANDLE hDeviceContext, void *pCallContext, unsigned char number_of_handles, unsigned short *pconnection_handle_list, unsigned short *phost_num_of_completed_packets);
typedef int (*HCI_ReadLinkSupervisionTimeout_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle);
typedef int (*HCI_ReadLinkSupervisionTimeout_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle, unsigned short link_supervision_timeout);
typedef int (*HCI_WriteLinkSupervisionTimeout_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle, unsigned short link_supervision_timeout);
typedef int (*HCI_WriteLinkSupervisionTimeout_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle);
typedef int (*HCI_ReadNumberOfSupportedIAC_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadNumberOfSupportedIAC_Out) (void *pCallContext, unsigned char status, unsigned char num_support_iac);
typedef int (*HCI_ReadCurrentIACLAP_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadCurrentIACLAP_Out) (void *pCallContext, unsigned char status, unsigned char num_current_iac, unsigned char *piac_lap_list);
typedef int (*HCI_WriteCurrentIACLAP_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char num_current_iac, unsigned char *piac_lap_list);
typedef int (*HCI_WriteCurrentIACLAP_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadPageScanPeriodMode_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadPageScanPeriodMode_Out) (void *pCallContext, unsigned char status, unsigned char page_scan_period_mode);
typedef int (*HCI_WritePageScanPeriodMode_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char page_scan_period_mode);
typedef int (*HCI_WritePageScanPeriodMode_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadPageScanMode_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadPageScanMode_Out) (void *pCallContext, unsigned char status, unsigned char page_scan_mode);
typedef int (*HCI_WritePageScanMode_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char page_scan_mode);
typedef int (*HCI_WritePageScanMode_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_ReadLocalVersionInformation_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadLocalVersionInformation_Out) (void *pCallContext, unsigned char status, unsigned char hci_version, unsigned short hci_revision, unsigned char lmp_version, unsigned short manufacturer_name, unsigned short lmp_subversion);
typedef int (*HCI_ReadLocalSupportedFeatures_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadLocalSupportedFeatures_Out) (void *pCallContext, unsigned char status, unsigned char features_mask[8]);
typedef int (*HCI_ReadBufferSize_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadBufferSize_Out) (void *pCallContext, unsigned char status, unsigned short hci_acl_data_packet_length, unsigned char hci_sco_data_packet_length, unsigned short hci_total_num_acl_data_packet, unsigned short hci_total_num_sco_data_packets);
typedef int (*HCI_ReadCountryCode_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadCountryCode_Out) (void *pCallContext, unsigned char status, unsigned char country_code);
typedef int (*HCI_ReadBDADDR_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadBDADDR_Out) (void *pCallContext, unsigned char status, BD_ADDR *pba);
typedef int (*HCI_ReadFailedContactCounter_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle);
typedef int (*HCI_ReadFailedContactCounter_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle, unsigned short failed_contact_counter);
typedef int (*HCI_ResetFailedContactCounter_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle);
typedef int (*HCI_ResetFailedContactCounter_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle);
typedef int (*HCI_GetLinkQuality_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle);
typedef int (*HCI_GetLinkQuality_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle, unsigned char link_quality);
typedef int (*HCI_ReadRSSI_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle);
typedef int (*HCI_ReadRSSI_Out) (void *pCallContext, unsigned char status, unsigned short connection_handle, char RSSI);
typedef int (*HCI_ReadLoopbackMode_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_ReadLoopbackMode_Out) (void *pCallContext, unsigned char status, unsigned char loopback_mode);
typedef int (*HCI_WriteLoopbackMode_In) (HANDLE hDeviceContext, void *pCallContext, unsigned char loopback_mode);
typedef int (*HCI_WriteLoopbackMode_Out) (void *pCallContext, unsigned char status);
typedef int (*HCI_EnableDeviceUnderTestMode_In) (HANDLE hDeviceContext, void *pCallContext);
typedef int (*HCI_EnableDeviceUnderTestMode_Out) (void *pCallContext, unsigned char status);
#define BTH_MARKER_NONE 0
#define BTH_MARKER_CONNECTION 1
#define BTH_MARKER_ADDRESS 2
typedef struct _packet_marker {
unsigned int fMarker;
union {
BD_ADDR ba;
unsigned short connection_handle;
};
} PacketMarker;
//
// HCI_NO_EVENT is only legal if command does not have associated event, not if the layer is simply not interested in processing it.
// If misused, serious mismatch in command/event flow will result. As of this writing, the only HCI command that does not have associated
// event is HCI_Host_Number_Of_Completed_Packets
//
#define HCI_NO_EVENT 0xff
typedef int (*HCI_CustomCode_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short usOpCode, unsigned short cPacketSize, unsigned char *pPacket, PacketMarker *pMarker, unsigned char cEvent);
typedef int (*HCI_DataPacketUp) (void *pUserContext, unsigned short connection_handle, BD_BUFFER *pBuffer);
typedef int (*HCI_DataPacketUpAclUnbuffered) (void *pUserContext, unsigned short connection_handle, unsigned char boundary, unsigned char broadcast, BD_BUFFER *pBuffer);
typedef int (*HCI_DataPacketDown_In) (HANDLE hDeviceContext, void *pCallContext, unsigned short connection_handle, BD_BUFFER *pBuffer);
typedef int (*HCI_DataPacketDown_Out) (void *pCallContext, int iError);
struct _HCI_EVENT_INDICATION {
HCI_InquiryCompleteEvent hci_InquiryCompleteEvent;
HCI_InquiryResultEvent hci_InquiryResultEvent;
HCI_ConnectionCompleteEvent hci_ConnectionCompleteEvent;
HCI_ConnectionRequestEvent hci_ConnectionRequestEvent;
HCI_DisconnectionCompleteEvent hci_DisconnectionCompleteEvent;
HCI_AuthenticationCompleteEvent hci_AuthenticationCompleteEvent;
HCI_RemoteNameRequestCompleteEvent hci_RemoteNameRequestCompleteEvent;
HCI_EncryptionChangeEvent hci_EncryptionChangeEvent;
HCI_ChangeConnectionLinkKeyCompleteEvent hci_ChangeConnectionLinkKeyCompleteEvent;
HCI_MasterLinkKeyCompleteEvent hci_MasterLinkKeyCompleteEvent;
HCI_ReadRemoteSupportedFeaturesCompleteEvent hci_ReadRemoteSupportedFeaturesCompleteEvent;
HCI_ReadRemoteVersionInformationCompleteEvent hci_ReadRemoteVersionInformationCompleteEvent;
HCI_QoSSetupCompleteEvent hci_QoSSetupCompleteEvent;
HCI_CommandCompleteEvent hci_CommandCompleteEvent; // Must be NULL; never called
HCI_CommandStatusEvent hci_CommandStatusEvent; // Must be NULL; never called
HCI_HardwareErrorEvent hci_HardwareErrorEvent; // Propagated up all the stacks
HCI_FlushOccuredEvent hci_FlushOccuredEvent;
HCI_RoleChangeEvent hci_RoleChangeEvent; // Propagated up all the stacks
HCI_NumberOfCompletedPacketsEvent hci_NumberOfCompletedPacketsEvent;
HCI_ModeChangeEvent hci_ModeChangeEvent;
HCI_ReturnLinkKeysEvent hci_ReturnLinkKeysEvent;
HCI_PINCodeRequestEvent hci_PINCodeRequestEvent;
HCI_LinkKeyRequestEvent hci_LinkKeyRequestEvent;
HCI_LinkKeyNotificationEvent hci_LinkKeyNotificationEvent;
HCI_LoopbackCommandEvent hci_LoopbackCommandEvent;
HCI_DataBufferOverflowEvent hci_DataBufferOverflowEvent;
HCI_MaxSlotsChangeEvent hci_MaxSlotsChangeEvent;
HCI_ReadClockOffsetCompleteEvent hci_ReadClockOffsetCompleteEvent;
HCI_ConnectionPacketTypeChangedEvent hci_ConnectionPacketTypeChangedEvent;
HCI_QoSViolationEvent hci_QoSViolationEvent;
HCI_PageScanModeChangeEvent hci_PageScanModeChangeEvent;
HCI_PageScanRepetitionModeChangeEvent hci_PageScanRepetitionModeChangeEvent;
HCI_DataPacketUp hci_DataPacketUp;
HCI_DataPacketUpAclUnbuffered hci_DataPacketUpAclUnbuffered;
HCI_CustomCodeEvent hci_CustomCodeEvent;
BT_LAYER_STACK_EVENT_IND hci_StackEvent;
};
struct _HCI_CALLBACKS {
HCI_Inquiry_Out hci_Inquiry_Out;
HCI_InquiryCancel_Out hci_InquiryCancel_Out;
HCI_PeriodicInquiryMode_Out hci_PeriodicInquiryMode_Out;
HCI_ExitPeriodicInquiryMode_Out hci_ExitPeriodicInquiryMode_Out;
HCI_CreateConnection_Out hci_CreateConnection_Out;
HCI_Disconnect_Out hci_Disconnect_Out;
HCI_AddSCOConnection_Out hci_AddSCOConnection_Out;
HCI_AcceptConnectionRequest_Out hci_AcceptConnectionRequest_Out;
HCI_RejectConnectionRequest_Out hci_RejectConnectionRequest_Out;
HCI_LinkKeyRequestReply_Out hci_LinkKeyRequestReply_Out;
HCI_LinkKeyRequestNegativeReply_Out hci_LinkKeyRequestNegativeReply_Out;
HCI_PINCodeRequestReply_Out hci_PINCodeRequestReply_Out;
HCI_PINCodeRequestNegativeReply_Out hci_PINCodeRequestNegativeReply_Out;
HCI_ChangeConnectionPacketType_Out hci_ChangeConnectionPacketType_Out;
HCI_AuthenticationRequested_Out hci_AuthenticationRequested_Out;
HCI_SetConnectionEncryption_Out hci_SetConnectionEncryption_Out;
HCI_ChangeConnectionLinkKey_Out hci_ChangeConnectionLinkKey_Out;
HCI_MasterLinkKey_Out hci_MasterLinkKey_Out;
HCI_RemoteNameRequest_Out hci_RemoteNameRequest_Out;
HCI_ReadRemoteSupportedFeatures_Out hci_ReadRemoteSupportedFeatures_Out;
HCI_ReadRemoteVersionInformation_Out hci_ReadRemoteVersionInformation_Out;
HCI_ReadClockOffset_Out hci_ReadClockOffset_Out;
HCI_HoldMode_Out hci_HoldMode_Out;
HCI_SniffMode_Out hci_SniffMode_Out;
HCI_ExitSniffMode_Out hci_ExitSniffMode_Out;
HCI_ParkMode_Out hci_ParkMode_Out;
HCI_ExitParkMode_Out hci_ExitParkMode_Out;
HCI_QoSSetup_Out hci_QoSSetup_Out;
HCI_RoleDiscovery_Out hci_RoleDiscovery_Out;
HCI_SwitchRole_Out hci_SwitchRole_Out;
HCI_ReadLinkPolicySettings_Out hci_ReadLinkPolicySettings_Out;
HCI_WriteLinkPolicySettings_Out hci_WriteLinkPolicySettings_Out;
HCI_SetEventMask_Out hci_SetEventMask_Out;
HCI_Reset_Out hci_Reset_Out;
HCI_SetEventFilter_Out hci_SetEventFilter_Out;
HCI_Flush_Out hci_Flush_Out;
HCI_ReadPINType_Out hci_ReadPINType_Out;
HCI_WritePINType_Out hci_WritePINType_Out;
HCI_CreateNewUnitKey_Out hci_CreateNewUnitKey_Out;
HCI_ReadStoredLinkKey_Out hci_ReadStoredLinkKey_Out;
HCI_WriteStoredLinkKey_Out hci_WriteStoredLinkKey_Out;
HCI_DeleteStoredLinkKey_Out hci_DeleteStoredLinkKey_Out;
HCI_ChangeLocalName_Out hci_ChangeLocalName_Out;
HCI_ReadLocalName_Out hci_ReadLocalName_Out;
HCI_ReadConnectionAcceptTimeout_Out hci_ReadConnectionAcceptTimeout_Out;
HCI_WriteConnectionAcceptTimeout_Out hci_WriteConnectionAcceptTimeout_Out;
HCI_ReadPageTimeout_Out hci_ReadPageTimeout_Out;
HCI_WritePageTimeout_Out hci_WritePageTimeout_Out;
HCI_ReadScanEnable_Out hci_ReadScanEnable_Out;
HCI_WriteScanEnable_Out hci_WriteScanEnable_Out;
HCI_ReadPageScanActivity_Out hci_ReadPageScanActivity_Out;
HCI_WritePageScanActivity_Out hci_WritePageScanActivity_Out;
HCI_ReadInquiryScanActivity_Out hci_ReadInquiryScanActivity_Out;
HCI_WriteInquiryScanActivity_Out hci
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -