From 9ce8c26d34eb7fef27ea1186d1dda93dbaf2d14b Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Tue, 29 Nov 2022 10:27:46 +0100 Subject: [PATCH] net: l2: ieee802154: Add missing scan callback registration Initializing an event callback with net_mgmt_init_event_callback() just sets some of the callback fields but do not propagate those masks in the core. If we want to use the callback, it is necessary to also call net_mgmt_add_event_callback(). Signed-off-by: Miquel Raynal --- subsys/net/l2/ieee802154/ieee802154_shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/net/l2/ieee802154/ieee802154_shell.c b/subsys/net/l2/ieee802154/ieee802154_shell.c index b9b1791b428..88ff207e3c0 100644 --- a/subsys/net/l2/ieee802154/ieee802154_shell.c +++ b/subsys/net/l2/ieee802154/ieee802154_shell.c @@ -228,6 +228,7 @@ static int cmd_ieee802154_scan(const struct shell *shell, net_mgmt_init_event_callback(&scan_cb, scan_result_cb, NET_EVENT_IEEE802154_SCAN_RESULT); + net_mgmt_add_event_callback(&scan_cb); if (!strcmp(argv[1], "active")) { scan_type = NET_REQUEST_IEEE802154_ACTIVE_SCAN;