1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-14 00:53:49 +01:00
RIOT/sys/net/gnrc/netapi/notify/gnrc_netapi_notify.c
Elena Frank 19a4ba04d1 gnrc/netapi: add notify message API
The netapi notify API enables protocol-independent, cross-layer
notification events.
Lower layers in the network stack can use this to inform upper
layers of network events.
2025-12-09 16:03:59 +01:00

39 lines
697 B
C

/*
* SPDX-FileCopyrightText: 2025 TU Dresden
* SPDX-License-Identifier: LGPL-2.1-only
*/
/**
* @{
* @ingroup net_gnrc_netapi_notify
* @file
* @brief Helper functions to extract data from netapi notify events.
*
* @author Elena Frank <elena.frank@tu-dresden.de>
*/
#include <errno.h>
#include "net/gnrc/netapi/notify.h"
int gnrc_netapi_notify_copy_event_data(gnrc_netapi_notify_t *notify, uint8_t data_len, void *data)
{
(void) data_len;
(void) data;
int res;
switch (notify->event) {
default:
res = -EINVAL;
break;
}
/* Acknowledge the read data */
gnrc_netapi_notify_ack(&notify->ack);
return res;
}
/** @} */