Skip to content

bluetooth: hrs: change hrm_encode return type to uint16_t#780

Open
PizzaAllTheWay wants to merge 1 commit intonrfconnect:mainfrom
PizzaAllTheWay:hrm-encode-return-type
Open

bluetooth: hrs: change hrm_encode return type to uint16_t#780
PizzaAllTheWay wants to merge 1 commit intonrfconnect:mainfrom
PizzaAllTheWay:hrm-encode-return-type

Conversation

@PizzaAllTheWay
Copy link
Copy Markdown
Contributor

hrm_encode() returned uint8_t, but both places that use it expect a uint16_t (ble_gatts_attr_t.init_len and ble_gatts_hvx_params_t.p_len from the SoftDevice API).

In practice the length never goes above 255, so this was not a real bug, just an inconsistency that forced the compiler to silently widen the value. Changing the return type (and the internal len variable) to uint16_t makes everything line up.

No functional change.

hrm_encode() returned uint8_t, but both places that use it expect
a uint16_t (ble_gatts_attr_t.init_len and ble_gatts_hvx_params_t.p_len
from the SoftDevice API).

In practice the length never goes above 255, so this was not a real
bug, just an inconsistency that forced the compiler to silently widen
the value. Changing the return type (and the internal len variable)
to uint16_t makes everything line up.

No functional change.

Signed-off-by: Martynas Smilingis <martynas.smilingis@nordicsemi.no>
@github-actions github-actions Bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Apr 28, 2026
@github-actions
Copy link
Copy Markdown

You can find the documentation preview for this PR here.

@PizzaAllTheWay PizzaAllTheWay marked this pull request as ready for review April 28, 2026 07:35
@PizzaAllTheWay PizzaAllTheWay requested a review from a team as a code owner April 28, 2026 07:35
@eivindj-nordic eivindj-nordic removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Apr 28, 2026
@eivindj-nordic
Copy link
Copy Markdown
Contributor

Static function, no changelog required.

@PizzaAllTheWay PizzaAllTheWay self-assigned this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants