KW36: Changing connection parameters by central

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

KW36: Changing connection parameters by central

跳至解决方案
1,390 次查看
finn_schmitz
Contributor II

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

标签 (2)
1 解答
1,274 次查看
Xiang_Li
NXP Employee
NXP Employee

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

在原帖中查看解决方案

3 回复数
1,275 次查看
Xiang_Li
NXP Employee
NXP Employee

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

1,274 次查看
finn_schmitz
Contributor II

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

1,274 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复