/* * Copyright 2000 - 2014 Stonestreet One. * All Rights Reserved. * Author: Damon Lange *** MODIFICATION HISTORY **************************************************** * * mm/dd/yy F. Lastname Description of Modification * -------- ----------- ------------------------------------------------ * 09/11/00 D. Lange Initial creation. * 12/07/07 D. Mason Changes for BT 2.1 * 05/20/11 T. Cook Changes for BT 4.0 * 01/02/14 T. Cook Changes for BT 4.1 **************************************************************************** */ /** * @file HCIAPI.h * * @brief Stonestreet One Bluetooth Stack HCI API Type Definitions, * Constants, and Prototypes. * To use any of the following API's, * include the following declaration in your application. * * @code * #include "SS1BTPS.h" * @endcode * ============================================================================ */ #ifndef __HCIAPIH__ #define __HCIAPIH__ #include "BTPSKRNL.h" /*! BTPS Kernel Prototypes/Constants. */ #include "BTAPITyp.h" /*! Bluetooth API Type Definitions. */ #include "HCITypes.h" /*! Bluetooth HCI Type Definitions/Constants. */ #include "BTPSCFG.h" /*! BTPS Configuration Constants. */ /*! The following enumerated type is used with the * HCI_Version_Supported() function. These values represent the * HCI Layer Specification that the HCI API Layer supports. Notice * that the Version definition for later versions of the Bluetooth * HCI Specification are defined as values having a larger * numerical value. This allows simple comparison logic * (greater than/less than/equal to/etc. logic to be performed). * \note If a Bluetooth HCI Specification value is NOT listed in * this list then it is NOT supported by the HCI API * present in this file. */ typedef enum { hvSpecification_1_0B, /*! HCI Specification 1.0B. */ hvSpecification_1_1, /*! HCI Specification 1.1. */ hvSpecification_1_2, /*! HCI Specification 1.2. */ hvSpecification_2_0, /*! HCI Specification 2.0. */ hvSpecification_2_1, /*! HCI Specification 2.1 + EDR. */ hvSpecification_3_0, /*! HCI Specification 3.0 + HS. */ hvSpecification_4_0, /*! HCI Specification 4.0. */ hvSpecification_4_1, /*! HCI Specification 4.1. */ hvSpecification_4_2 /*! HCI Specification 4.2. */ } HCI_Version_t; /*! The following structure is used with the * HCI_Write_Stored_Link_Key() function, and represents a single * BD_ADDR/Link Key Pair that is required by this function. */ typedef struct _tagHCI_Stored_Link_Key_Info_t { BD_ADDR_t BD_ADDR; Link_Key_t Link_Key; } HCI_Stored_Link_Key_Info_t; #define HCI_STORED_LINK_KEY_INFO_SIZE (sizeof(HCI_Stored_Link_Key_Info_t)) /*! The following structure is used with the * HCI_Host_Number_Of_Completed_Packets() function, and represents * a single Connection Handle/Host Number of Completed Packets Pair * that is required by this function. */ typedef struct _tagHCI_Host_Completed_Packets_Info_t { Word_t Connection_Handle; Word_t Host_Num_Of_Completed_Packets; } HCI_Host_Completed_Packets_Info_t; #define HCI_HOST_COMPLETED_PACKETS_INFO_SIZE (sizeof(HCI_Host_Completed_Packets_Info_t)) /*! The following structure is used with * HCI_Read_Local_Supported_Codecs() function and respresents a * single Vendor Specific Codec pair that is returned from this * function. */ typedef struct _tagHCI_Vendor_Specific_Codec_Info_t { Word_t CompanyID; Word_t VendorCodecID; } HCI_Vendor_Specific_Codec_Info_t; #define HCI_VENDOR_SPECIFIC_CODEC_INFO_SIZE (sizeof(HCI_Vendor_Specific_Codec_Info_t)) /*! The following structure is used with * HCI_Read_Local_Supported_Codecs() function and respresents the * Local Supported Codec information (Bluetooth and Vendor Specific) * that is returned from this function. */ typedef struct _tagHCI_Local_Supported_Codec_Info_t { Byte_t NumberOfSupportedCodecs; Byte_t *SupportedCodecs; Byte_t NumberOfVendorSpecificCodecs; HCI_Vendor_Specific_Codec_Info_t *VendorSpecificCodecs; } HCI_Local_Supported_Codec_Info_t; #define HCI_LOCAL_SUPPORTED_CODEC_INFO_SIZE (sizeof(HCI_Local_Supported_Codec_Info_t)) /*! The following structure is used with the the * HCI_Enhanced_Setup_Synchronous_Connection()/ * HCI_Enhanced_Accept_Synchronous_Connection_Request() commands for * the HCI SCO Coding Format. * \note The VendorCodecInfo member is ignored unless the * CodingFormat member is set to * HCI_ENHANCED_SYNCHRONOUS_CODING_FORMAT_VENDOR_SPECIFIC. */ typedef struct _tagHCI_Coding_Format_Info_t { Byte_t CodingFormat; HCI_Vendor_Specific_Codec_Info_t VendorCodecInfo; } HCI_Coding_Format_Info_t; #define HCI_CODING_FORMAT_INFO_SIZE (sizeof(HCI_Coding_Format_Info_t)) /*! The following structure contains the informat that is passed into * the HCI_Enhanced_Setup_Synchronous_Connection()/ * HCI_Enhanced_Accept_Synchronous_Connection_Request() commands for * the Synchronous Connection Information. */ typedef struct _tagHCI_Enhanced_Synchronous_Connection_Info_t { DWord_t TransmitBandwidth; DWord_t ReceiveBandwidth; HCI_Coding_Format_Info_t TransmitCodingFormat; HCI_Coding_Format_Info_t ReceiveCodingFormat; Word_t TransmitCodecFrameSize; Word_t ReceiveCodecFrameSize; DWord_t InputBandwidth; DWord_t OutputBandwidth; HCI_Coding_Format_Info_t InputCodingFormat; HCI_Coding_Format_Info_t OutputCodingFormat; Word_t InputCodedDataSize; Word_t OutputCodedDataSize; Byte_t InputPCMDataFormat; Byte_t OutputPCMDataFormat; Byte_t InputPCMSamplePayloadMSBPosition; Byte_t OutputPCMSamplePayloadMSBPosition; Byte_t InputDataPath; Byte_t OutputDataPath; Byte_t InputTransportUnitSize; Byte_t OutputTransportUnitSize; Word_t MaxLatency; Word_t PacketType; Byte_t RetransmissionEffort; } HCI_Enhanced_Synchronous_Connection_Info_t; #define HCI_ENHANCED_SYNCHRONOUS_CONNECTION_INFO_SIZE (sizeof(HCI_Enhanced_Synchronous_Connection_Info_t)) /*! The following structure is used to holder information on a * specified MWS Transport. * \note The To_MWS_Baud_Rate and From_MWS_Baud_Rate members are * arrays of NumberOfBaudRates entries. */ typedef struct _tagHCI_MWS_Transport_Info_t { Byte_t TransportLayer; Byte_t NumberOfBaudRates; DWord_t *To_MWS_Baud_Rate; DWord_t *From_MWS_Baud_Rate; } HCI_MWS_Transport_Info_t; #define HCI_MWS_TRANSPORT_INFO_SIZE (sizeof(HCI_MWS_Transport_Info_t)) /*! The following structure is used with the the * HCI_Get_MWS_Transport_Layer_Configuration command for the HCI * return result. * \note The TransportLayerInfo parameter is an array of * NumberOfTransports entries. */ typedef struct _tagHCI_MWS_Transport_Layer_Configuration_Info_t { Byte_t NumberOfTransports; HCI_MWS_Transport_Info_t *TransportLayerInfo; } HCI_MWS_Transport_Layer_Configuration_Info_t; #define HCI_MWS_TRANSPORT_LAYER_CONFIGURATION_INFO_SIZE (sizeof(HCI_MWS_Transport_Layer_Configuration_Info_t)) /*! The following structure is used with the HCI_Set_MWS_Signaling() * command for the command parameters. */ typedef struct _tagHCI_Set_MWS_Signaling_Parameters_t { Word_t MWS_RX_Assert_Offset; Word_t MWS_RX_Assert_Jitter; Word_t MWS_RX_Deassert_Offset; Word_t MWS_RX_Deassert_Jitter; Word_t MWS_TX_Assert_Offset; Word_t MWS_TX_Assert_Jitter; Word_t MWS_TX_Deassert_Offset; Word_t MWS_TX_Deassert_Jitter; Word_t MWS_Pattern_Assert_Offset; Word_t MWS_Pattern_Assert_Jitter; Word_t MWS_Inactivity_Duration_Assert_Offset; Word_t MWS_Inactivity_Duration_Assert_Jitter; Word_t MWS_Scan_Frequency_Assert_Offset; Word_t MWS_Scan_Frequency_Assert_Jitter; Word_t MWS_Priority_Assert_Offset_Request; } HCI_Set_MWS_Signaling_Parameters_t; #define HCI_SET_MWS_SIGNALING_PARAMETERS_SIZE (sizeof(HCI_Set_MWS_Signaling_Parameters_t)) /*! The following structure is used with the HCI_Set_MWS_Signaling() * command for the command Result. */ typedef struct _tagHCI_Set_MWS_Signaling_Result_t { Word_t Bluetooth_RX_Priority_Assert_Offset; Word_t Bluetooth_RX_Priority_Assert_Jitter; Word_t Bluetooth_RX_Priority_Deassert_Offset; Word_t Bluetooth_RX_Priority_Deassert_Jitter; Word_t _802_RX_Priority_Assert_Offset; Word_t _802_RX_Priority_Assert_Jitter; Word_t _802_RX_Priority_Deassert_Offset; Word_t _802_RX_Priority_Deassert_Jitter; Word_t Bluetooth_TX_On_Assert_Offset; Word_t Bluetooth_TX_On_Assert_Jitter; Word_t Bluetooth_TX_On_Deassert_Offset; Word_t Bluetooth_TX_On_Deassert_Jitter; Word_t _802_TX_On_Assert_Offset; Word_t _802_TX_On_Assert_Jitter; Word_t _802_TX_On_Deassert_Offset; Word_t _802_TX_On_Deassert_Jitter; } HCI_Set_MWS_Signaling_Result_t; #define HCI_SET_MWS_SIGNALING_RESULT_SIZE (sizeof(HCI_Set_MWS_Signaling_Result_t)) /* HCI Event API Types. */ typedef enum { etInquiry_Complete_Event, /*!< Indicates that the Inquiry is finished. */ etInquiry_Result_Event, /*!< Indicates that one or more Bluetooth devices have responded so far during the current Inquiry process. */ etConnection_Complete_Event, /*!< Indicates to both of the Hosts forming the connection that a new connection has been established.*/ etConnection_Request_Event, /*!< Indicates that a new incoming connection is trying to be established. */ etDisconnection_Complete_Event, /*!< Indicates that a connection has been terminated. */ etAuthentication_Complete_Event, /*!< Indicates that the authentication has been completed for the specified connection. */ etRemote_Name_Request_Complete_Event, /*!< Indicates that a remote name request has been completed. */ etEncryption_Change_Event, /*!< Indicates that the change in the encryption has been completed for a connection. */ etChange_Connection_Link_Key_Complete_Event, /*!< Indicates that the change in the Link Key for the connection has been completed. */ etMaster_Link_Key_Complete_Event, /*!< Indicates that the change in the temporary Link Key or in the semi-permanent link keys on the Bluetooth master side has been completed. */ etRead_Remote_Supported_Features_Complete_Event, /*!