SWRA769 august   2023 CC2564C

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Demo Application
  5. 2Running the Bluetooth Code
  6. 3Server Set-Up Using HFP Demo Application
  7. 4Client Set-Up on the Demo Application
  8. 5Example: Audio Gateway with a Commercial Headset
  9. 6Application Commands
    1. 6.1  Generic Access Profile Commands
    2. 6.2  Help (DisplayHelp)
    3. 6.3  Inquiry
    4. 6.4  Pair
    5. 6.5  End Pairing
    6. 6.6  PIN Code Response
    7. 6.7  Pass Key Response
    8. 6.8  User Confirmation Response
    9. 6.9  Set Discoverability Mode
    10. 6.10 Set Connectability Mode
    11. 6.11 Set Pairability Mode
    12. 6.12 Change Simple Pairing Parameters
    13. 6.13 Get Local Address
    14. 6.14 Set Local Name
    15. 6.15 Get Local Name
    16. 6.16 Set Class of Device
    17. 6.17 Get Class of Device
    18. 6.18 Get Remote Name
  10. 7Hands-Free Profile Commands
    1. 7.1  Service Discovery
    2. 7.2  Open Audio Gateway Client
    3. 7.3  Manage Audio
    4. 7.4  Update Control Indicators
    5. 7.5  Call Waiting
    6. 7.6  Set Voice Recognition Activation
    7. 7.7  Set Speaker Gain
    8. 7.8  Set Microphone Gain
    9. 7.9  Disable Remote Sound Enhancement
    10. 7.10 Send Caller ID Notification
    11. 7.11 Set Ring Indication
    12. 7.12 Ring Indication
    13. 7.13 Send Incoming Call State
    14. 7.14 Close AG Client
    15. 7.15 Send Operator Info
    16. 7.16 Send Sub Number
    17. 7.17 Send Call List
  11. 8References
  12. 9Revision History

Open Audio Gateway Client

Description

The following function is responsible for opening an Audio Gateway client port. This function returns zero on successful execution and a negative value on all errors.

Parameters

The command requires two parameter. first parameter is the Inquiry Index and the second is the remote device Port Number.

Command Call Examples

  • "OpenAudioGatewayClient 1 1" Attempts to Open a Audio Gateway client port on inquiry index #1 and remote Port Number #1.
  • "OpenAudioGatewayClient 2 3" Attempts to Open a Audio Gateway client port on inquiry index #2 and remote Port Number #3.

Possible Return Values

  • (0) AG Client opened successfully
  • (-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-4) FUNCTION_ERROR
  • (-8) INVALID_STACK_ID_ERROR
  • (-1000) BTHFRE_ERROR_INVALID_PARAMETER
  • (-1001) BTHFRE_ERROR_NOT_INITIALIZED
  • (-1002) BTHFRE_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-1003) BTHFRE_ERROR_LIBRARY_INITIALIZATION_ERROR
  • (-1004) BTHFRE_ERROR_INSUFFICIENT_RESOURCES
  • (-1005) BTHFRE_ERROR_INVALID_OPERATION
  • (-1006) BTHFRE_ERROR_INVALID_CODEC_ID

API Call

HFRE_Open_Remote_Hands-free_Port(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam-1)], TempParam->Params[1].intParam, Hands-free Profile Commands, ServiceDiscovery, OpenAudioGatewayClient, DEFAULT_AG_SUPPORTED_FEATURES, DEFAULT_CALL_HOLDING_SUPPORT, 0, NULL, HFRE_Event_Callback, (unsigned long)0)

API Prototype

BTPSAPI_DECLARATION int BTPSAPI HFRE_Open_Remote_Hands-free_Port(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, unsigned int RemoteServerPort, unsignedlong SupportedFeaturesMask, unsigned long CallHoldSupportMask, unsigned int NumberAdditionalIndicators, HFRE_Control_Indicator_Entry_t AdditionalSupportedIndicators[],HFRE_Event_Callback_t EventCallback, unsigned long CallbackParameter)

Description of API

The following function is responsible for Opening a Remote Hands-Free Port on the specified Remote Device. This function accepts the Bluetooth Stack ID of the Bluetooth Stack whichis to open the HFRE Connection as the first parameter. The second parameter specifies the Board Address (NON NULL) of the Remote Bluetooth Device to connect with. The thirdparameter specifies the features the local Audio Gateway supports. The next parameter is a bit mask which specifies the Call Hold and Multiparty Handling Features that are supported.The fifth parameter to this function is the number of indicator names which appear in the list represented by the previous parameter. The next parameter is a list of additional indicatorsin which this Audio Gateway supports. If the Additional Indicators parameter is NULL and Number Additional Indicators is zero no additional parameters is supported. The finaltwo parameters specify the HFRE Event Callback function, and callback parameter, respectively, of the HFRE Event Callback that is to process any further interaction with the specifiedRemote Port (Opening Status, Close Status,etc). This function returns a non-zero, positive, value if successful, or a negative return error code if this function is unsuccessful. If thisfunction is successful, the return value represents the HFRE Port ID that can be passed to all other functions that require it. Once a Remote Hands-Free unit is opened, it can only beclosed via a call to the HFRE_Close_Port() function (passing the return value from this function).

Note: The Mandatory Hands-Free Indicators (call, service, and call_set-up) areautomatically added to the list and need not be specified as additional indicators.