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

net/ble/skald: make advertising interval configurable per context #17834

Merged
merged 3 commits into from
Jun 21, 2022

Conversation

haukepetersen
Copy link
Contributor

Contribution description

Until now, skald was implemented in a way that all active advertisings were using the same, compile-time-configured, advertising interval. But making the interval configurable per context make skald much more flexible, trading 4 byte in RAM overhead and a single pointer deref - quite OK I'd say :-) The actual change consists of two lines, adding the adv_itvl_ms field to the context struct and substituting CONFIG_SKALD_INTERVAL_MS for ctx->adv_itvl_ms in the implementation. All the rest is just the adaption of the two ibeaon and eddystone wrappers...

Testing procedure

Run the two provided skald examples (examples/skald_ibeacon) and (examples/skald_eddystone) and verify they still advertise as expected.

Issues/PRs references

none

@haukepetersen haukepetersen added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: BLE Area: Bluetooth Low Energy support labels Mar 21, 2022
@github-actions github-actions bot added Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: network Area: Networking Area: sys Area: System labels Mar 21, 2022
@haukepetersen haukepetersen changed the title Opt skald advitvlconfig net/ble/skald: make advertising interval configurable per context Mar 21, 2022
@haukepetersen
Copy link
Contributor Author

rebased

Comment on lines -65 to -67
#ifndef CONFIG_SKALD_INTERVAL_MS
#define CONFIG_SKALD_INTERVAL_MS (1000U)
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to keep this? Maybe not as a CONFIG_ define, but at least as a default? This way you would not need to duplicate the defines it in the main.cs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really. That 1000ms is a pretty arbitrary value and far from a BLE advertising default... So I don't see a benefit of keeping it.

@miri64
Copy link
Member

miri64 commented May 24, 2022

Otherwise tested: I can see both beacons with the nRF connect app.

@haukepetersen
Copy link
Contributor Author

@miri64 are you satisfied by my comment and would you consent to continue with this PR?

@miri64
Copy link
Member

miri64 commented Jun 21, 2022

@miri64 are you satisfied by my comment and would you consent to continue with this PR?

I am satisfied.

@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 21, 2022
@miri64 miri64 enabled auto-merge June 21, 2022 07:26
@miri64 miri64 merged commit 03dfad8 into RIOT-OS:master Jun 21, 2022
@haukepetersen haukepetersen deleted the opt_skald_advitvlconfig branch June 22, 2022 16:54
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BLE Area: Bluetooth Low Energy support Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants