SWRA770 august 2023 CC2564C
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 value on all errors. A Bluetooth Stack ID must exist before attempting to end pairing and the device must already be connected to a remote device. Please note that the use of the Pair and Inquiry commands before calling EndPairing are necessary to disconnect from a remote device.
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. This 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 the Bluetooth Address of the Device used in the Pair command.
GAP_End_Bonding(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam – 1)])
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)
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 bonding type 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 BluetoothDevice address of the remote Bluetooth Device that was specified to be bonded with (general bonding). This function terminates the ACL connection that was established. 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 successfully).