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.

LAUNCHXL-CC26X2R1: How do I get the Identity Address of a peer device?

Part Number: LAUNCHXL-CC26X2R1

Hi

How do you use GAPBondMgr_FindAddr while in a bonded connection with an ios device and get the identity address?

in case GAP_LINK_ESTABLISHED_EVENT:

...

status1 = GAPBondMgr_FindAddr(pPkt->devAddr, PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID, pIdx1, pIdentityAddrType1, pIdentityAddr1);

status1 = GAPBondMgr_FindAddr(pPkt->devAddr, PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID, pIdx1, pIdentityAddrType1, pIdentityAddr1);

both calls do NOT change the argument pIdentityAddr1.

I am using the simplePeripheral project with version 2.3 of the 26x2 sdk.

*edit: corrected statement in bold

  • I have rebuild the stack library with no optimization to be able to debug in gapbondmgr.c properly.
    It looks like the data GAPBondMgr_FindAddr() is working on is not as I expect it:
    The bond array has one entry (the bond with the ios central) but it has the address type PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID. Should it not be PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID?

  • Hi Hermann,

    You can find the API description for GAPBondMgr_FindAddr() here: dev.ti.com/.../group___g_a_p_bond_mgr.html

    I don't understand why you need the peer device identity address in the application.
  • Hi Marie,

    I have several central devices (ios) that are supposed to connect to the peripheral (ti ble5 stack). I need to identify these centrals in the usercode of the peripherals because they have different settings. Just imagine a simple peripheral project which has different connection settings (spConnRec_t) for each central device. Also, the periphereal has to do something different for each central device when the conncetion is not active. I need a persistent unique identifier for central device and the stack provides the IRK and the IA as the only build-in options , right?

    In the application at SimplePeripheral_processGapMessage-> GAP_LINK_ESTABLISHED_EVENT is the point where we can first react with user code to a new connection. It seems that if the connection has been bonded before the address that comes with event message (pPkt->devAddr) already is the identy address? Atleast the devAddr seems to be persistent between reconnects and rebonds. Also this seems to be the same address we can access by means of using linkDB_GetInfo(...)->addr. Sidequestion: What is the addrPriv in linkDBInfo_t for?

    It is also the address we can find in the bond array that is searched when we call GAPBondMgr_FindAddr(...) when bonded before. It seems that the bonding/irk/IA resolution has already happend before SimplePeripheral_processGapMessage is called and we are presented with the IA if there was a bond or a generic rpa address if there as no bond.

    Best Regards

  • Hi Hermann,

    I see. In simple_central we have implemented a global variable to keep track of the connected devices (connList). If I were you I would expand this to also contain the identity address.

    You should be able to use linkDB_GetInfo() to get all the information (including identity address) for a connection. (Link: dev.ti.com/.../group___link_d_b.html ).

    Note that you will not be able to find any identity address before the devices are bonded.
  • Hi Marie,

    This means the data  linkDB_GetInfo() operates on is updated the moment a bond is made? What exactly is the private address in linkDBInfo_t  and what is it for?

    Marie H said:
    I see. In simple_central we have implemented a global variable to keep track of the connected devices (connList). If I were you I would expand this to also contain the identity address.

    Why do you say expand it with the IA? Can you explain the befefits of adding that? ConnList already contains addr[B_ADDR_LEN] which is to my understanding already the IA if the devices are bonded. Is it not?

    In other words: When the connection established callback is invoked, the device address that is provided with the callback argument already is the IA if the devices are bonded. If the devices are not bonded, the device address provided is a random address which can not be resolved because the stack does not know the appropriate IRK at that time. If the stack would know, it could resolve the random address to its IA and it would be the IA that is provided as an argument by the connection established callback and not a random address.

    Best Regards

  • Hi Hermann,

    The private address is the address that can change, in contrast to the identity address which never changes.

    If the addr[B_ADDR_LEN] answers your need then you can use this one. If you wish you can probably update this one by using linkDB_GetInfo() when the devices have finished bonding.