SWRU580 April 2021 CC2564C , CC2564MODA , CC2564MODN
This section provides a description of how to use the demo application to connect two configured board and communicate over Bluetooth. The Bluetooth HFP is a simple Client-Server connection process with one side operating in the Audio-Gateway role and the other operating in the Hands-free role. We will setup one of the boards as a Audio-Gateway client (HFPAG Demo acts as Audio gateway) and use an another board as Hands-free server (using HFP Demo). we Will see how to initiate connection and send indications between the two devices over Bluetooth.
Now use the second board and follow the steps as per either HFP Demo when using Tiva or MSP430 as the server or HFPDemo_HF for MSP432 or STM32F4 as the server. Perform the steps prior to running the Audio-Gateway Bluetooth code on the first board. The second device that is connected to the computer will be the Hands-free Server.
Server setup using HFP demo applicationYou will see the output below from the HFP server.
You will see the below output from the HFP server.
You will see the below output from the HFP server.
This demonstrates setting up the client to connect to a commercial headset.
OpenStack().
Bluetooth Stack ID: 1
WBS support enabled.
Device Chipset: Unknown (greater 4.1)
BTPS Version : 4.2.1.0
Project Type : 6
FW Version : 12.12
App Name : HFPDemo_AG
App Version : 0.3
LOCAL BD_ADDR: 0x88C255D1D645
GAP_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 *
******************************************************************
Issue the Inquiry command for the HFP server.
HFP AG>Inquiry
Return 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>ServiceDiscovery
Usage: SERVICEDISCOVERY [Inquiry Index] [Profile Index] [16/32 bit UUID (Manual only)].
Profile Index:
Function Error.
HFP AG>ServiceDiscovery 5 12
SDP_Service_Search_Attribute_Request(Handsfree) Success.
HFP AG>
SDP Service Search Attribute Response Received (Size = 0x0010)
Service Record: 1:
Attribute ID 0x0000
Type: Unsigned Int = 0x00010000
Attribute ID 0x0001
Type: Data Element Sequence
Type: UUID_16 = 0x111E
Type: UUID_16 = 0x1203
Attribute ID 0x0004
Type: Data Element Sequence
Type: Data Element Sequence
Type: UUID_16 = 0x0100
Type: Data Element Sequence
Type: UUID_16 = 0x0003
Type: Unsigned Int = 0x0A
Attribute ID 0x0006
Type: Data Element Sequence
Type: Unsigned Int = 0x656E
Type: Unsigned Int = 0x006A
Type: Unsigned Int = 0x0100
Attribute ID 0x0009
Type: Data Element Sequence
Type: Data Element Sequence
Type: UUID_16 = 0x111E
Type: Unsigned Int = 0x0106
Attribute ID 0x0100
Type: Text String = Hands-Free unit
Attribute ID 0x0311
Type: Unsigned Int = 0x003F
Initiate connection to the remote HFP server by isssuing the OpenAudioGatewayClient 5 10 command.
HFP AG>OpenAudioGatewayClient
Usage: OPENAUDIOGATEWAYCLIENT [Inquiry Index] [Port Number].
Function Error.
HFP AG>OpenAudioGatewayClient 5 10
Bluetooth Device Address: 0x08DF1F99F8D0
Open Remote HandsFree Port = 000A
HFRE_Open_Remote_HandsFree_Port: Function Successful ID = 0001.
OpenRemoteHandsFreePort: HFRE_Update_Current_Control_Indicator_Status Function Status 0.
You will see the output below from the HFP server
HFP AG>
atLinkKeyRequest: 0x08DF1F99F8D0
GAP_Authentication_Response() Success.
HFP AG>
atPINCodeRequest: 0x08DF1F99F8D0
Respond with the command: PINCodeResponse
HFP AG>PINCodeResponse 0000
PINCodeResponse.
GAP_Authentication_Response(), Pin Code Response Success.
HFP AG>
atLinkKeyCreation: 0x08DF1F99F8D0
Link Key: 0x4AF49AD7072771919BAC62840F1F985D
Link 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: 0x00000000
HFRE_Enable Call Line Identification
HFP AG>
HFRE Disable Sound_Enhancement Indication, ID: 0x0001
HFRE_Send_Terminating_Response (erOK) :: Res = 0
HFP 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: 0x0001
HFRE_Send_Incoming_Call_State (csNone) :: Res = 0
HFP AG>
HFRE_Current_Calls_List_Indication
HFRE_Send_Terminating_Response (erOK) :: Res = 0
HFP AG>ManageAudio
Usage: Audio [Release = 0, Setup = 1].
Function Error.
HFP AG>ManageAudio 1
HFRE_Send_Select_Codec:: Codec = 2, Res = 0
You will see the below output from the HFP server
HFP AG>
HFRE Codec Select Confirmation, ID: 0x0001 AcceptedCodec=2
Setup WBS with Audio for ACL handle 0x0001
HFRE_Setup_Audio_Connection: Function Successful.
HFRE_Setup_Audio_Connection:: Res = 0
HFP AG>
HFRE Audio Connection Indication, ID: 0x0001, BDADDR=0x08DF1F99F8D0, Status: 0x0000.