Bluedroid:如何发送 LL_CONNECTION_UPDATE_REQ

Bluedroid: How to send LL_CONNECTION_UPDATE_REQ

我想用一些特定的连接参数强制发送 LL_CONNECTION_UPDATE_REQ 到从站。我如何在 Bluedroid 中实现这一点? Bluedroid 可以吗?

目标:AOSP v5.1+

通过调用函数 btsnd_hcic_ble_upd_ll_conn_params() [在 l2c_ble.c] 函数在 hciblecmds.c

中定义

如果 slave 和 master 都支持 BLUETOOTH SPECIFICATION Version 4.2 规范 9.3.9 中定义的 Connection Parameter Update Procedure 并在 LL_FEATURE_REQ (2.4.2.9)LL_FEATURE_RSP (2.4.2.10) 中声明,Link层发送 LL_CONNECTION_PARAM_REQ (2.4.2.16).

如果任一主机不支持此功能,LL 将发送 LL_CONNECTION_UPDATE_REQ 2.4.2.1

来自 9.3.9.2 ConditionsBLUETOOTH SPECIFICATION Version 4.2 中:

A Central initiating the connection parameter update procedure shall use the Link Layer Connection Update procedure defined in [Vol. 6], Part B Section 5.1.1 with the required connection parameters if either the Central or the Peripheral does not support the Connection Parameters Request Link Layer Control procedure.

If both the Central and Peripheral support the Connection Parameters Request Link Layer control procedure, then the Central or Peripheral initiating the connection parameter update procedure shall use the Connection Parameters Request Link Layer Control procedure defined in [Vol. 6], Part B Section 5.1.7 with the required connection parameters.

虽然我要在这里补充一点,btsnd_hcic_ble_upd_ll_conn_params() 只需要最小和最大连接间隔,并将它们用作 提示

根据我的经验,当传递一个范围的值时,LL会选择范围内的任何值。

我只做了有限的测试,所以我不确定 LL 是否总是从提供的范围中选择,或者在某些情况下是否可以从这个范围之外选择,例如。如果一个已经连接的从站有 CI 超出这个范围

5.1.1 Connection Update Procedure开始,LL 将始终 从主机提供的范围内选择连接间隔。 感谢@Emil 指出这一点。