Skip to main content
OKloe.1
Associate II
May 5, 2023
Question

Disconnect a BLE connection as a peripferal leads to error code

  • May 5, 2023
  • 0 replies
  • 781 views

Dear all,

I am using a BlueNRG-LPS in my current project. Stack Library 3.1a is used.

The device works as a peripheral.

It works fine to establish a connection to the peripheral, but I am facing an issue to disconnect.

There are several reasons that our custom application on the peripheral device has to terminate a connection.

Ther is a function to do so:

/**
 * @brief Command the controller to terminate the connection. A @ref
 * hci_disconnection_complete_event event will be generated when the link
 * is disconnected. It is important to leave an 100 ms blank window
 * before sending any new command (including system hardware reset),
 * since immediately after @ref hci_disconnection_complete_event event,
 * system could save important information in non volatile memory.
 * @param Connection_Handle Connection handle that identifies the connection.
 * Values:
 * - 0x0000 ... 0x0EFF
 * @param Reason The reason for ending the connection.
 * Values:
 * - 0x05: Authentication Failure
 * - 0x13: Remote User Terminated Connection
 * - 0x14: Remote Device Terminated Connection due to Low Resources
 * - 0x15: Remote Device Terminated Connection due to Power Off
 * - 0x1A: Unsupported Remote Feature
 * - 0x3B: Unacceptable Connection Parameters
 * @retval Value indicating success or error code.
 */
tBleStatus aci_gap_terminate(uint16_t Connection_Handle,
 uint8_t Reason);

The reasons 0x05 or 0x13 both work fine. But I always get an error when reason 0x14 (low resources) is used.

The Error code I get in this case is 0x12 which means "invalid parameter".

Any ideas what could be wrong?

This topic has been closed for replies.