This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Erase All Bonded devices from Peripheral

Hello,  

I am using CC2540 USB BLE Dongle with PC Application implemented in .Net.

Following Bond parameter has been set during initialization of this dongle.

GAPBOND_PAIRING_MODE -> 01-GAPBOND_PAIRING_WAIT_FOR_REQ
GAPBOND_MITM_PROTECTION -> 00-Disabled
GAPBOND_BONDING_ENABLED -> 01-Enabled
GAPBOND_IO_CAPABILITIES -> 03-No I/p No O/p

We are facing some issues in bonding with the central devices, and receiving terminate command with reason code 05.

When we flash the host test image with bonding enabled, the issues is not occurring till some 10+ central devices.

After that we start receiving termination command with 05, once the connection gets established.

So, We are trying to erase the bonding be setting the following Bond parameter.

GAPBOND_ERASE_ALLBONDS -> 00-No Value

But the execution of the above Bond set parameter give Parameter out of range as resultant. Please find the below code.

--------------------------------------------------------------------

[23] : <Tx> - 06:19:17.741

-Type : 0x01 (Command)

-OpCode : 0xFE36 (GAP_BondSetParam)

-Data Length : 0x04 (4) byte(s)

ParamID : 0x0409 (1033) (GAPBOND_ERASE_ALLBONDS)

ParamLength : 0x01 (1)

Value : 00

Dump(Tx):

0000:01 36 FE 04 09 04 01 00 .6......

--------------------------------------------------------------------

[24] : <Rx> - 06:19:17.759

-Type : 0x04 (Event)

-EventCode : 0x00FF (Event)

-Data Length : 0x06 (6) bytes(s)

Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)

Status : 0x18 (24) (A Parameter Is Out Of Range)

OpCode : 0xFE36 (GAP_BondSetParam)

DataLength : 0x00 (0)

Dump(Rx):

0000:04 FF 06 7F 06 18 36 FE 00 ......6..

--------------------------------------------------------------------

Can some one suggest me the usage of Bond set param of Erase All Bonding with correct value.

Thanks in Advance.

Regards,

Ramesh Kumar

  • Hello Ramesh,

    This error can occur if you are attempting to erase all bonds when a BLE connection is active. Can you confirm there is no connection active when this error occurs?

    Best wishes
  • Hi JXS,

    I am executing the command before start advertising the packets. So there is no active connection or connection being terminated before executing this command.

    Note:
    I forget to update the following details in the previous post.
    Central is initiating the pairing request and trying to bond the paired device in the next connection.

    During this bonding, Peripheral BLE stack gives the terminate command with reason code 0x05 to peripheral and Central BLE stack gives terminate command with reason code 0x16 to central.

    Connection is successful during pairing request and gets terminated during this bonding request.

    Thanks and Regards,
    Ramesh Kumar
  • Hi,
    Can you try setting the len to 0. It looks like it's set to 1 when you send the GAPBOND_ERASE_ALLBONDS command:
    ParamLength : 0x01 (1)

    Best wishes