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

End Pairing

Description

The EndPairing command is responsible for ending a previously initiated bonding session with a remote device. The function returns zero on a successful execution and a negative valueon all errors. A Bluetooth Stack ID must exist before attempting to end pairing and the device must already be connected to a remote device. It is also important to note that the use ofthe Pair and Inquiry commands before calling EndPairing are necessary to disconnect from a remote device.

Parameters

The EndPairing command requires one parameter which is the Inquiry Index of the Remote Bluetooth Device. This value can be found after an Inquiry or displayed when the commandDisplayInquiryList is used. It is the same value as the first parameter used in the Pair command, unless a new Inquiry has been called after pairing. If this is the case, find theBluetooth Address of the device used in the Pair command.

Command Call Examples

  • "EndPairing 5" Attempts to end pairing with the remote device at the fifth Inquiry Index.
  • "EndPairing 8" Attempts to end pairing with the remote device at the eighth Inquiry Index.

Possible Return Values

  • (0) Successful End Pairing
  • (-2)BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-1)BTPS_ERROR_INVALID_PARAMETER
  • (-58)BTPS_ERROR_INVALID_MODE
  • (-4) FUNCTION_ERROR
  • (-6) INVALID_PARAMETERS_ERROR
  • (-8) INVALID_STACK_ID_ERROR

API Call

GAP_End_Bonding(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam – 1)]);

API Protoype

int BTPSAPI GAP_Initiate_Bonding(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, GAP_Bonding_Type_t GAP_Bonding_Type, GAP_Event_Callback_tGAP_Event_Callback, unsigned long CallbackParameter);

Description of API

This function is provided to allow a means to terminate a connection that was established via a call to the GAP_Initiate_Bonding function (that specified general bonding as the bondingtype to perform). This function has NO effect if the bonding procedure was initiated using dedicated bonding (or the device is already disconnected). This function accepts the Bluetooth device address of the remote Bluetooth device that was specified to be bonded with (general bonding). This function terminates the ACL connection that was established and NO GAP Event Callbacks are issued to the GAP Event Callback that was specified in the original GAP_Initiate_Bonding function call (if this function returns success).