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.

CC2340R5: Setting the periConnParamsAtt of appMainParams didn't work.

Part Number: CC2340R5

Tool/software:

Hi Teams,

SDK:8.10

Device: LP-EM-CC2340R5

I am using the basic_ble and I want to change GGS paramters by setting the value on BLEAppUtil_GeneralParams_t appMainParams. Please see the code snippet.

BLEAppUtil_GeneralParams_t appMainParams =
{
    .taskPriority = 1,
    .taskStackSize = 1024,
    .profileRole = (BLEAppUtil_Profile_Roles_e)(HOST_CONFIG),
    .addressMode = DEFAULT_ADDRESS_MODE,
    .deviceNameAtt = attDeviceName,
    .pDeviceRandomAddress = pRandomAddress,
    .periConnParamsAtt = {20, 50, 0, 200}
};

However, it didn't work.

Am I setting with the correct params?

Thanks,

BR,

Connor

  • Hello Connor,

    The peripheral can only suggest its preferred conn parameters, but it will be up to the central to make the decision of which one to use at the end. I would suggest to try GAP_UpdateLinkParamReq() after both devices have connected, something like this:

    #define RC_IDLE_TIMEOUT         5000 // 5 seconds
    #define CLOCK_UNITS_MS          1000  // convert to ms
    static ClockP_Struct rc_parmupdate_clkStruct;
    ClockP_Handle rc_parmupdate_clkHandle;
    ClockP_Params clockpParams;
    
    // Kick off timeout for requesting parameter update
    static void rc_parmupdate_clkHandleCB(void)
    {
        gapUpdateLinkParamReq_t pParamUpdateReq =
        {
         .connectionHandle = 0,
         .intervalMin = 6,
         .intervalMax = 6,
         .connLatency = 200,
         .connTimeout = 600
        };
    
        GAP_UpdateLinkParamReq(&pParamUpdateReq);
    }
    
    void config_parmupdate(void)
    {
        ClockP_Params_init(&clockpParams);
        uint32_t clockTicks = RC_IDLE_TIMEOUT * (CLOCK_UNITS_MS);
        clockpParams.period = 0;
        clockpParams.startFlag = true;
        clockpParams.arg = (uintptr_t)rc_parmupdate_clkHandleCB;
        rc_parmupdate_clkHandle = ClockP_construct(&rc_parmupdate_clkStruct, (void *)BLEAppUtil_invokeFunctionNoData, clockTicks, &clockpParams); // Initialize clock instance.
    }

    BR,

    David.