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.

HIDAdvRemote: ADV_DIRECT_IND

Hi,

   BLE Stack: BLE-CC254x-1.4.0.

   Project code: HIDAdvRemote (or, HIDAdvRemote-Audio)

 

1) When the remote is unpaired, it will use the ADV_IND advertising.

When the Remote is already paired, and link is terminated after 60s, then on keypress, it should be linking back to the same host. And, it should be using ADV_DIRECT_IND too.

Implementing the ADV_DIRECT_IND for reconnecting after the 60s Idle timeout, I will need the host address GAPRole_GetParameter( GAPROLE_CONN_BD_ADDR, HostAddress ).

However, during the IDLE timeout, the Gap module reset the Address to 0.

[Q1]: If I comment out this statement (please refer to below code), will it cause any issue to the stack ?

    case GAP_LINK_TERMINATED_EVENT:

      {

        gapTerminateLinkEvent_t *pPkt = (gapTerminateLinkEvent_t *)pMsg;

 

        VOID GAPBondMgr_ProcessGAPMsg( (gapEventHdr_t *)pMsg );

        //osal_memset( gapRole_ConnectedDevAddr, 0, B_ADDR_LEN );

 

        // Erase connection information

        gapRole_ConnInterval = 0;

        gapRole_ConnSlaveLatency = 0;

        gapRole_ConnTimeout = 0;

 

2) Assuming that the Remote is paired, and then the battery is replaced.

When the remote is powered up and trying to re-establish the link using ADV_DIRECT_IND.

There could be a problem. The Host BD Address will be 0, as this is stored inside XDATA.

So, to use ADV_DIRECT_IND, the Remote needs to store this info into the NVM area. In this case, the Application can do this storage.

[Q2]: The question is, shouldn't the stack be handling this ?

 

Thanks in advance.

  • Q1: I don't believe this should cause any issues as long as you didn't make any other modifications to peripheral.c. Alternatively you could leave this as-is and just store the address at the application layer when the link is established. That way when the link is terminated you will still have access to the address without needing to get it from the peripheral role profile layer.

    Q2: Instead of using directed advertisements the application uses the whitelist. The code in hidDev.c handles this and the address is stored in the bond manager. You could do something with directed advertising with a bit of modification.

  • Hi,

    Can you advise the pros and cons between using the ADV_DIRECT_IND and using the whitelist?

    Under what circumstances will the ADV_DIRECT_IND be useful in BLE?

    Thanks and regards,

    TP