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.

CC2640R2F: How to configure default connection parameters

Part Number: CC2640R2F

My device is has central role. I wan to change connection parameters in initial CONN_IND packet. please see contents in image below.

wireshark screenshot showing CONNECT_IND packet contents

I am aware of GAP_UpdateLinkParamReq but that can be used after the connection is established.

Is there a way to change these parameters? I could not find anything in docs.

  • Hello Patrik,

    I am reaching out to the expert who can further help you with this query. In the mean time, could you please share what SDK version are you using and if you are working with a specific out of the box example?

    BR,

    David.

  • Hello David,

    Sorry for alte reply, I have Simplelink CC2640R2 SDK 5.30.0.03

    I am not working with out of the box example, but ble5 stack Simple Central is the closest one (starting point for my code) and if demonstrated on that, I can adopt it into my code easily.

  • Greetings Patrik,

    Thank you for sharing details about the device you are using and the SDK version. Which parameters exactly do you want to change? If you want to change the parameters before the start of advertising, then this will still technically be setting-up of the advertisement parameters, and that can be done by directly manipulating the data structures.

    Best Regards,
    Achyut Ray

  • I was able to find relevant API functions thanks to "similar topics" here. Solution is to use GapInit_setPhyParam in Gap device init event.

    snippet my (c++) code:

    constexpr auto DEFAULT_INIT_PHY = INIT_PHY_1M;
    
    
    // in GAP DEVICE EVENT
    // (config is my struct with static variables)
    GapInit_setPhyParam(DEFAULT_INIT_PHY, INIT_PHYPARAM_CONN_INT_MIN, config::minInterval);
    GapInit_setPhyParam(DEFAULT_INIT_PHY, INIT_PHYPARAM_CONN_INT_MAX, config::maxInterval);
    GapInit_setPhyParam(DEFAULT_INIT_PHY, INIT_PHYPARAM_CONN_LATENCY, config::slaveLatency);
    GapInit_setPhyParam(DEFAULT_INIT_PHY, INIT_PHYPARAM_SUP_TIMEOUT, config::connTimeout);

    Later I also send Connection parameters change request, which may not be necessary. Thought GapInit_setPhyParam can't be left yout. If you do that and only send connection parameters change request, BLE stack will decline perfectly valid response!