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

sys: uartpb: use a unique ID to identify each Protobuf message #76

Conversation

ecourtois
Copy link
Contributor

Using a unique ID for each Protobuf message allows libraries/applications defining these messages to register a callback function associated with each ID. This way, uartpb is not dependent of applications anymore, which had to declare a Protobuf message gathering all known Protobuf messages.

This unique ID will be sent first, followed by encoded Protobuf message. The unique id can also be sent alone if the message does not required any content (like a reset or trigger message).

Embedded Template Library (ETL) is a drop-in replacement for
the C++ standard library with fixed-size containers [1].
ETL package was introduced in RIOT 2022.04 [2].

Add -Wno-cast-align compilation flag to suppress warnings introduced
by ETL headers.

[1] https://www.etlcpp.com/
[2] RIOT-OS/RIOT#17477

Signed-off-by: Eric Courtois <eric.courtois@gmail.com>
@ecourtois ecourtois requested a review from gdoffe July 29, 2022 11:31
@ecourtois ecourtois self-assigned this Jul 29, 2022
@ecourtois ecourtois linked an issue Jul 29, 2022 that may be closed by this pull request
sys/shell_menu/Menu.cpp Outdated Show resolved Hide resolved
Using a unique id for each Protobuf message allows libraries/applications
defining these messages to register a callback function associated
with each id.
This way, uartpb is not dependent of applications anymore, which had to
declare a Protobuf message gathering all known Protobuf messages.

This unique id will be sent first, followed by encoded Protobuf message.
The unique id can also be sent alone if the message does not required
any content (like a reset or trigger message).

This commit also updates all modules and applications affected by this
refactoring.

Fixes #67

Signed-off-by: Eric Courtois <eric.courtois@gmail.com>
@ecourtois ecourtois force-pushed the 67-sys-uartpb-use-a-unique-id-to-identify-each-protobuf-message branch from 35576c6 to 4bac8d2 Compare July 29, 2022 14:04
@ecourtois ecourtois requested a review from gdoffe July 29, 2022 14:06
Copy link
Contributor

@gdoffe gdoffe left a comment

Choose a reason for hiding this comment

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

LGTM assuming few points on log/error/debug messages !
Good job @ecourtois !

@ecourtois ecourtois merged commit b07dff0 into master Jul 29, 2022
@ecourtois ecourtois deleted the 67-sys-uartpb-use-a-unique-id-to-identify-each-protobuf-message branch July 29, 2022 14:58
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.

sys: uartpb: use a unique ID to identify each Protobuf message
2 participants