Skip to content

lorawan: pass callback pointer to callback invocation #86868

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mniestroj
Copy link
Member

This allows to make use of CONTAINER_OF() macro when registered struct lorawan_downlink_cb is
part of another structure.

@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from 9aebdd0 to 21fb262 Compare March 10, 2025 12:15
@mniestroj mniestroj changed the title lorawan: pass pointer callback to callback invocation lorawan: pass callback pointer to callback invocation Mar 10, 2025
Copy link
Contributor

@JordanYates JordanYates left a comment

Choose a reason for hiding this comment

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

Makes sense, the change will need a migration notes entry though.

@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from 21fb262 to 826c387 Compare March 17, 2025 15:25
@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label Mar 17, 2025
@mniestroj mniestroj force-pushed the lorawan-pass-callback branch 2 times, most recently from 4320f69 to 2846066 Compare March 18, 2025 13:19
@mniestroj mniestroj force-pushed the lorawan-pass-callback branch 2 times, most recently from d6e6ced to 28010b0 Compare March 18, 2025 13:21
@mniestroj mniestroj requested a review from JordanYates March 18, 2025 15:46
@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from 28010b0 to dd39249 Compare March 19, 2025 07:03
@@ -122,7 +123,8 @@ static void smp_lorawan_uplink_thread(void *p1, void *p2, void *p3)
}
#endif

static void smp_lorawan_downlink(uint8_t port, uint8_t flags, int16_t rssi, int8_t snr,
static void smp_lorawan_downlink(struct lorawan_downlink_cb *cb,
uint8_t port, uint8_t flags, int16_t rssi, int8_t snr,
uint8_t len, const uint8_t *hex_data)
{
ARG_UNUSED(flags);
Copy link
Contributor

Choose a reason for hiding this comment

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

ARG_UNUSED()?

@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from dd39249 to 1684921 Compare March 19, 2025 07:59
@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from 1684921 to 0cfdc1a Compare April 17, 2025 08:34
@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from 0cfdc1a to 754c9fd Compare April 17, 2025 11:52
@mniestroj mniestroj requested a review from JordanYates April 17, 2025 12:06
This allows to make use of CONTAINER_OF() macro when registered 'struct
lorawan_downlink_cb' is part of another structure.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This structure has updated callback, with additional parameter.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
@mniestroj mniestroj force-pushed the lorawan-pass-callback branch from 754c9fd to fdd541b Compare April 22, 2025 17:19
Copy link
Member

@martinjaeger martinjaeger left a comment

Choose a reason for hiding this comment

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

Tiny change request, otherwise LGTM.

@@ -305,6 +305,13 @@ SPI
Other subsystems
****************

LoRa
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LoRa
LoRaWAN

@de-nordic de-nordic removed their request for review June 3, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LoRa area: mcumgr area: Samples Samples Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants