SWRA769 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 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.
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.
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 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).