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.

CC2745R10-Q1: ECC key generation in GAPBondMgr_GenerateEccKeys()

Part Number: CC2745R10-Q1

Tool/software:

Hi,

Could you tell us the following?

ECC key generation is executed in the following order in "simplelink_lowpower_f3_sdk_9_10_00_83", but ECC key generation is not completed.

(1) Receive GAP_DEVICE_INIT_DONE_EVENT (Device Initialization Complete)

(2) ECC key generation with GAPBondMgr_GenerateEccKeys() (Generation result: SUCCESS)

(3) We don't get notified of GAPBOND_GENERATE_ECC_DONE

For simplelink_cc13xx_cc26xx_sdk_6_30_01_03, GAPBOND_GENERATE_ECC_DONE are notified in the same order as above.

Should ECC key generation be performed at a separate event?

■References

C:\ti\simplelink_lowpower_f3_sdk_9_10_00_83\source\ti\ble\host\gapbondmgr\src\gapbondmgr.c

  • Hello,

    You will need to add BLEAPPUTIL_GENERATE_ECC_DONE event to your pairing event handler:

    BLEAppUtil_EventHandler_t PairingPairStateHandler =
    {
        .handlerType    = BLEAPPUTIL_PAIR_STATE_TYPE,
        .pEventHandler  = Pairing_pairStateHandler,
        .eventMask      = BLEAPPUTIL_PAIRING_STATE_STARTED |
                          BLEAPPUTIL_PAIRING_STATE_COMPLETE |
                          BLEAPPUTIL_PAIRING_STATE_ENCRYPTED |
                          BLEAPPUTIL_PAIRING_STATE_BOND_SAVED |
                          BLEAPPUTIL_GENERATE_ECC_DONE,
    };
    

    You can find this in the app_pairing.c file in the basic_ble project.

    Best,

    Nima Behmanesh

  • Hi,

    Our project does not use BLEAppUtil.We are not using BLEAppUtil, but are instead trying to receive the ECC key generation completion notification (GAPBOND_GENERATE_ECC_DONE) using the GAPBondMgr callback function.
    Adding BLEAppUtil would require significant changes, so we would like to avoid that. We are considering a method that can achieve this using only GAPBondMgr functions.

    Step A: ECC Key Generation Does Not Complete

    1. Register the callback function with GAPBondMgr_Register().
    2. When the ICall event GAP_DEVICE_INIT_DONE_EVENT occurs, call GAPBondMgr_GenerateEccKeys().
    3. The callback function is not notified of GAPBOND_GENERATE_ECC_DONE.

    Step B: ECC Key Generation Complete

    1. Register the callback function with GAPBondMgr_Register().
    2. Do nothing when the ICall event GAP_DEVICE_INIT_DONE_EVENT occurs.
    3. Connect via BLE, and when the ICall event GAP_LINK_ESTABLISHED_EVENT occurs, call GAPBondMgr_GenerateEccKeys().
    4. The callback function receives a GAPBOND_GENERATE_ECC_DONE notification.

    If ECC key generation completion notification is received solely through the GAPBondMgr callback function, is there a limitation that prevents ECC key generation from being completed if GAPBondMgr_GenerateEccKeys() is called immediately after GAP_DEVICE_INIT_DONE_EVENT occurs?

  • Hello Nakamura-san, 

    The ECC keys are generated after the connection is established, and pairing is initiated. This is why the function works as expected after the connection is established.

    When you attempt to generate the ECC keys after the GAP_DEVIC_INIT_DONE_EVENT, there is not connection, and the GAP layer has just finished initialization. Since there are no connections, there are no keys to be generated. 

    Additionally, ECC keys are only generated if both devices in the connection have bonding enabled. 

    Thanks,
    Isaac