Skip to content

Conversation

@larsgk
Copy link
Contributor

@larsgk larsgk commented Nov 30, 2022

This changes HAS registration to be dynamic
and let's the application set Hearing Aid Type

Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.

This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.

Signed-off-by: Lars Knudsen [email protected]
Co-author: Soren Engquist [email protected]

Copy link
Contributor

@MariuszSkamra MariuszSkamra left a comment

Choose a reason for hiding this comment

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

Few changes requested, otherwise LGTM

@Thalley
Copy link
Contributor

Thalley commented Dec 1, 2022

@larsgk Will review after UPF :)

@larsgk larsgk force-pushed the dynamic_has_register branch from 16cdc62 to fdc4e33 Compare December 1, 2022 12:11
@MariuszSkamra MariuszSkamra self-requested a review December 1, 2022 12:21
Copy link
Contributor

@MariuszSkamra MariuszSkamra left a comment

Choose a reason for hiding this comment

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

As the bt_has_hearing_aid_type represent 2 LSB bits in features, you need to redefine the enum values so that:

enum bt_has_hearing_aid_type {
	BT_HAS_HEARING_AID_TYPE_BINAURAL = BIT(0),
	BT_HAS_HEARING_AID_TYPE_MONAURAL = BIT(1),
	BT_HAS_HEARING_AID_TYPE_BANDED = BIT(2),
};

@larsgk
Copy link
Contributor Author

larsgk commented Dec 1, 2022

As the bt_has_hearing_aid_type represent 2 LSB bits in features, you need to redefine the enum values so that:

enum bt_has_hearing_aid_type {
	BT_HAS_HEARING_AID_TYPE_BINAURAL = BIT(0),
	BT_HAS_HEARING_AID_TYPE_MONAURAL = BIT(1),
	BT_HAS_HEARING_AID_TYPE_BANDED = BIT(2),
};

oops - will fix ;)

@larsgk larsgk force-pushed the dynamic_has_register branch 3 times, most recently from bc759fa to 409fb20 Compare December 2, 2022 12:05
@larsgk larsgk removed the request for review from jhedberg December 2, 2022 12:50
This changes HAS registration to be dynamic and let's the
application set Hearing Aid Type and binaural features.

Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.

This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.

Signed-off-by: Lars Knudsen <[email protected]>
Co-author: Soren Engquist <[email protected]>
Copy link
Contributor

@Thalley Thalley left a comment

Choose a reason for hiding this comment

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

If we truly want to make HAS dynamically registered, this is OK as it is for me now :)

@larsgk larsgk requested review from MariuszSkamra and fredrikdanebjer and removed request for MariuszSkamra December 20, 2022 08:16
@fabiobaltieri fabiobaltieri merged commit 081b835 into zephyrproject-rtos:main Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants