mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-14 00:53:49 +01:00
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.
39 lines
697 B
C
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(¬ify->ack);
|
|
|
|
return res;
|
|
}
|
|
|
|
/** @} */
|