SWRA769 august 2023 CC2564C
The example below demonstrates setting up the client to connect to a commercial headset.
OpenStack().Bluetooth Stack ID: 1WBS support enabled.Device Chipset: Unknown (greater 4.1)BTPS Version : 4.2.1.0Project Type : 6FW Version : 12.12App Name : HFPDemo_AGApp Version : 0.3LOCAL BD_ADDR: 0x88C255D1D645GAP_Set_Connectability_Mode(cmConnectable).GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).GAP_Set_Pairability_Mode(pmPairableMode).GAP_Register_Remote_Authentication() Success. Command Options: Inquiry, DisplayInquiryList, Pair, EndPairing, PINCodeResponse, PassKeyResponse, UserConfirmationResponse, SetDiscoverabilityMode, SetConnectabilityMode, SetPairabilityMode, ChangeSimplePairingParameters, GetLocalAddress, SetLocalName, GetLocalName, SetClassOfDevice, GetClassOfDevice, GetRemoteName, ManageAudio, OpenAudioGatewayClient, CloseAgClient, ServiceDiscovery, UpdateControlIndicators, CallWaiting, SendCallerIdNotification, SetRingIndication, RingIndication, SetVoiceRecognitionActivation, SetSpeakerGain, SetMicroPhoneGain, DisableRemoteSoundEnhancement, SendOperatorInfo, SendIncomingCallState, SendSubNumber, SendCallList, Help
HFP AG>InquiryReturn Value is 0 GAP_Perform_Inquiry() SUCCESS.HFP AG>GAP Inquiry Entry Result: 0x244B03F712D3.HFP AG>GAP Inquiry Entry Result: 0x3402862CCAE9.HFP AG>GAP Inquiry Entry Result: 0x340286605044.HFP AG>GAP Inquiry Entry Result: 0x484520902A4E.HFP AG>GAP Inquiry Entry Result: 0x08DF1F99F8D0.HFP AG>GAP Inquiry Entry Result: 0x002500F84FAB.HFP AG>GAP_Inquiry_Result: 6 Found.GAP Inquiry Result: 1, 0x244B03F712D3.GAP Inquiry Result: 2, 0x3402862CCAE9.GAP Inquiry Result: 3, 0x340286605044.GAP Inquiry Result: 4, 0x484520902A4E.GAP Inquiry Result: 5, 0x08DF1F99F8D0.GAP Inquiry Result: 6, 0x002500F84FAB.
HFP AG>ServiceDiscoveryUsage: SERVICEDISCOVERY [Inquiry Index] [Profile Index] [16/32 bit UUID (Manual only)]. Profile Index: 0) Manual (MUST specify 16/32 bit UUID) 1) L2CAP 2) Advanced Audio 3) A/V Remote Control 4) Basic Imaging 5) Basic Printing 6) Dial-up Networking 7) FAX 8) File Transfer 9) Hard Copy Cable Repl. 10) Health Device 11) Headset 12) Handsfree 13) HID 14) LAN Access
15) Message Access 16) Object Push 17) Personal Area Network 18) Phonebook Access 19) SIM Access 20) Serial Port 21) IrSYNCFunction Error.HFP AG>ServiceDiscovery 5 12SDP_Service_Search_Attribute_Request(Handsfree) Success.HFP AG>SDP Service Search Attribute Response Received (Size = 0x0010)Service Record: 1:Attribute ID 0x0000Type: Unsigned Int = 0x00010000Attribute ID 0x0001Type: Data Element SequenceType: UUID_16 = 0x111EType: UUID_16 = 0x1203Attribute ID 0x0004Type: Data Element SequenceType: Data Element SequenceType: UUID_16 = 0x0100Type: Data Element SequenceType: UUID_16 = 0x0003Type: Unsigned Int = 0x0AAttribute ID 0x0006Type: Data Element SequenceType: Unsigned Int = 0x656EType: Unsigned Int = 0x006AType: Unsigned Int = 0x0100Attribute ID 0x0009Type: Data Element SequenceType: Data Element SequenceType: UUID_16 = 0x111EType: Unsigned Int = 0x0106Attribute ID 0x0100Type: Text String = Hands-Free unitAttribute ID 0x0311Type: Unsigned Int = 0x003F
HFP AG>OpenAudioGatewayClientUsage: OPENAUDIOGATEWAYCLIENT [Inquiry Index] [Port Number].Function Error.HFP AG>OpenAudioGatewayClient 5 10Bluetooth Device Address: 0x08DF1F99F8D0Open Remote HandsFree Port = 000AHFRE_Open_Remote_HandsFree_Port: Function Successful ID = 0001.OpenRemoteHandsFreePort: HFRE_Update_Current_Control_Indicator_Status Function Status 0.
Observe the output below from the HFP server.
HFP AG>atLinkKeyRequest: 0x08DF1F99F8D0GAP_Authentication_Response() Success.HFP AG>atPINCodeRequest: 0x08DF1F99F8D0Respond with the command: PINCodeResponseHFP AG>PINCodeResponse 0000PINCodeResponse.GAP_Authentication_Response(), Pin Code Response Success.HFP AG>atLinkKeyCreation: 0x08DF1F99F8D0Link Key: 0x4AF49AD7072771919BAC62840F1F985DLink Key Stored locally.HFP AG>HFRE Open Port Confirmation, ID: 0x0001, Status: 0x0000.HFP AG>HFRE Available Codec List Indiocation, ID: 0x0001 NumCodecs: 2 [ 1 2 ]HFP AG>HFRE Open Service Level Connection Indication, ID: 0x0001 RemoteSupportedFeaturesValid: TRUE RemoteSupportedFeatures: 0x000000BF RemoteCallHoldMultipartySupport: 0x00000000HFRE_Enable Call Line IdentificationHFP AG>HFRE Disable Sound_Enhancement Indication, ID: 0x0001HFRE_Send_Terminating_Response (erOK) :: Res = 0HFP AG>HFRE Speaker Gain Indication, ID: 0x0001, Speaker Gain 0x000A.HFP AG>HFRE Call Line Identification Notification Activation Indication, ID: 0x0001, Enabled: TRUE.HFP AG>HFRE Call Waiting Notification Activation Indication, ID: 0x0001, Enabled: TRUE.HFP AG> HFRE Response Hold Status Indication, ID: 0x0001HFRE_Send_Incoming_Call_State (csNone) :: Res = 0HFP AG>HFRE_Current_Calls_List_IndicationHFRE_Send_Terminating_Response (erOK) :: Res = 0
HFP AG>ManageAudioUsage: Audio [Release = 0, set-up = 1].Function Error.HFP AG>ManageAudio 1HFRE_Send_Select_Codec:: Codec = 2, Res = 0
Observe the below output from the HFP server.
HFP AG>HFRE Codec Select Confirmation, ID: 0x0001 AcceptedCodec=2set-up WBS with Audio for ACL handle 0x0001HFRE_set-up_Audio_Connection: Function Successful.HFRE_set-up_Audio_Connection:: Res = 0HFP AG>HFRE Audio Connection Indication, ID: 0x0001, BDADDR=0x08DF1F99F8D0, Status: 0x0000.