Hallo all,
I am running a FRDM-KW36 with SDK 2.2.1 as BLE central. Chaning the connection parameters by peripheral request works fine. However, I have not found how to change the connection parameters by the central directly. Can someone please point me towards to API call to use here? I first thought of Gap_UpdateConnectionParameters(), but it seems this is used by the peripheral role.
Kind regards
Finn
已解决! 转到解答。
Hi Finn,
I could be wrong. But I thought the function Gap_UpdateConnectionParameters() can work both on central / peripheral sides. Have you tested this?
I think the structure "gConnReqParams" is only used when creating a connection, which is passed to the BLE stack via Gap_Connect(). So it only updates the connection parameters at the moment a connection is (re)established.
But I understood you that you want to keep the connection and update the parameters in the run time.
Regards,
Xiang
Hi Finn,
I could be wrong. But I thought the function Gap_UpdateConnectionParameters() can work both on central / peripheral sides. Have you tested this?
I think the structure "gConnReqParams" is only used when creating a connection, which is passed to the BLE stack via Gap_Connect(). So it only updates the connection parameters at the moment a connection is (re)established.
But I understood you that you want to keep the connection and update the parameters in the run time.
Regards,
Xiang
Hallo Mario, hallo Xiang,
yes, exactly. The parameters used in gapConnectionRequestParameters_t gConnReqParams are correctly passed and are in fact what I see when tracing the connection. But I want to update the parameters at run time later on - preferably not by triggering the change from a peripheral but by the central.
Xiang Li, you are right of course, Gap_UpdateConnectionParameters() works even for the central role. I did not see that earlier, but now realized that my peripheral overwrote the connection parameters with a request of it's own. This is why the interval I saw in the trace did not match my expectation.
Thank you!
Kind regards
Finn
Hi Finn,
Did you look at the next structure?
/* Default Connection Request Parameters */
gapConnectionRequestParameters_t gConnReqParams
Look at the initialization that has been defined in the app_config.c
Example:
.connIntervalMin = 30,
.connIntervalMax = 200
Regards,
Mario