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.

RTOS/CC2640R2F: RTOS/CC2640R2F: RTOS/CC2640R2F: RTOS/LAUNCHXL-CC2640R2: Connection parameter update Process in Multi-role

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hello,

I am working on Launch pad with multi-role sample TI example code (reference code C:\ti\simplelink_cc2640r2_sdk_1_30_00_25\examples\rtos\CC2640R2_LAUNCHXL\blestack\multi_role) and I am able to connect to multiple devices(Central/peripherals).

I have few questions to be clarified :

1) " multi_role_paramUpdateDecisionCB() "  Function in multi_role.c is a Callback for application to decide whether or not to accept a parameter update request coming from Client.

But it seems like this function is never used.

2) In multi.c  File, gapRole_processGAPMsg()  Function has case GAP_UPDATE_LINK_PARAM_REQ_EVENT:  which is Sent during a Connection Parameter Update Procedure from Client.

 case GAP_UPDATE_LINK_PARAM_REQ_EVENT:
    {
      gapUpdateLinkParamReqEvent_t *pReq;
      gapUpdateLinkParamReqReply_t rsp;

      pReq = (gapUpdateLinkParamReqEvent_t *)pMsg;

      // Add in connection handle.
      rsp.connectionHandle = pReq->req.connectionHandle;

      // If forwarding to the application to decide
      if(gapRole_updateConnParams.paramUpdateEnable ==
         GAPROLE_LINK_PARAM_UPDATE_APP_DECIDES)
      {
        if (pGapRoles_AppCGs && pGapRoles_AppCGs->pfnParamUpdateAppDecision)
        { 
          // Call application callback
          pGapRoles_AppCGs->pfnParamUpdateAppDecision(&(pReq->req), &rsp);
        }

        // Reject if there is no registered callback
        else
        {
          rsp.accepted = FALSE;
        }
      }

      // If rejecting all parameter update requests
      else if (gapRole_updateConnParams.paramUpdateEnable ==
               GAPROLE_LINK_PARAM_UPDATE_REJECT)
      {
        rsp.accepted = FALSE;
      }

      // If accepting all parameter update rqeuests
      else if (gapRole_updateConnParams.paramUpdateEnable ==
               GAPROLE_LINK_PARAM_UPDATE_ACCEPT)
      {
        // Link Parameter update is accepted
        rsp.accepted = TRUE;

        // Use remote requested values
        rsp.intervalMin = pReq->req.intervalMin;
        rsp.intervalMax = pReq->req.intervalMax;
        rsp.connLatency = pReq->req.connLatency;
        rsp.connTimeout = pReq->req.connTimeout;
      }

      // Send parameters back to stack
      VOID GAP_UpdateLinkParamReqReply(&rsp);
    }

But i have checked it by putting breakpoints, when I am connecting with a BLE client(phone) ,  control will never hit this break point.

I think Ideally it should come here for application to take decision to Accept/Reject the parameter Update, using the same function in point 1 above.

 

I simply want to receive the update request  from BLE client and send the response with my updated connection parameters.

This all should be done by the APIs already provided.

Please point out if my understanding is wrong or an appropriate way to handle this issue.

Any help will be appreciated...!

Thanks..!

  • Where did you place your breakpoint? If you don't get any breakpoint triggers on GAP_UPDATE_LINK_PARAM_REQ_EVENT, then perhaps the phone isn't sending a connection param update request. Do you have a sniffer log to show that the phone is sending such a request?

    You can also test this function via using simple peripheral. I think it does send a connection parameter update request.

    Tom
  • Hello Tom,

    I have placed the breakpoint at GAP_UPDATE_LINK_PARAM_REQ_EVENT only.
    I am getting triggers  at GAP_LINK_PARAM_UPDATE_EVENT but not at GAP_UPDATE_LINK_PARAM_REQ_EVENT.
    I have also tested the same in  simple peripheral.

    Below are the sniffer logs, please have a look:

    Please point out where things are going wrong.

    Any help will be appreciated.

    Thanks...! :)