Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE: Enable/Disable Automatic sending of Connection Parameter update request on Timeout. #21058

Closed
kipm-ot opened this issue Nov 28, 2019 · 3 comments · Fixed by #21174
Closed
Assignees
Labels
area: Bluetooth Enhancement Changes/Updates/Additions to existing features

Comments

@kipm-ot
Copy link
Contributor

kipm-ot commented Nov 28, 2019

Problem:
We want our peripheral to have the Peripheral Preferred Connection Parameters characteristic in the Generic Access service, but we do NOT want the Zephyr stack of our peripheral to automatically send an L2CAP Connection Parameter Update Request if the central doesn't change the connection parameters within a certain time (this behavior is optional according to the spec). We want our peripheral application layer to decide if/when such requests are sent.

Currently, it seems that the Zephyr configuration setting CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS controls both functionalities at once. If and only if the setting is enabled, the characteristic will be present (in gatt.c), and the update request will automatically be sent (in conn.c). So there doesn't seem to be a way to get one without the other.
In conn.c, when the time out happens, conn_update_timeout() is invoked and Zephyr will Automatically sends out the Connection Parameter update request. If CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS is enabled it will take the values from Characteristics else internal values.

Solution:
Add a new KConfig flag, say CONFIG_BT_GAP_AUTO_SEND_CONN_PARAMS_ON_TIMEOUT and this can be disabled if the Application layer do not want to automatially send the Update request on time out.
And update conn_update_timeout() in conn.c something like below.

#if defined (CONFIG_BT_GAP_AUTO_SEND_CONN_PARAMS_ON_TIMEOUT)
#if defined (CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS)
.......
.......
.......
#endif
#endif

@kipm-ot kipm-ot added the Enhancement Changes/Updates/Additions to existing features label Nov 28, 2019
@aescolar
Copy link
Member

CC: @jhedberg

@carlescufi
Copy link
Member

@kipm-ot will you send a PR for this?

@kipm-ot
Copy link
Contributor Author

kipm-ot commented Dec 4, 2019

@carlescufi yes I am preparing the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants