Loading...
Searching...
No Matches
rpble.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
19#ifndef NET_GNRC_RPL_RPBLE_H
20#define NET_GNRC_RPL_RPBLE_H
21
22#include <string.h>
23#if IS_USED(MODULE_NIMBLE_RPBLE)
24#include "nimble_rpble.h"
25#endif
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#if IS_USED(MODULE_NIMBLE_RPBLE)
32static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
33{
35 ctx.inst_id = dodag->instance->id;
36 memcpy(ctx.dodag_id, &dodag->dodag_id, 16);
37 ctx.version = dodag->version;
38 ctx.rank = dodag->my_rank;
39 ctx.role = dodag->node_status;
41}
42#else
43static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
44{
45 (void)dodag;
46 /* do nothing here */
47}
48#endif
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif /* NET_GNRC_RPL_RPBLE_H */
int nimble_rpble_update(const nimble_rpble_ctx_t *ctx)
Update the current RPL context.
Interface for the nimble_rpble module.
RPL DODAG information.
uint16_t rank
the node's rank in the DODAG
uint8_t dodag_id[16]
DODAG ID.
uint8_t role
RPL role of the node.
uint8_t version
DODAG version.
uint8_t inst_id
instance ID
struct gnrc_rpl_dodag gnrc_rpl_dodag_t
DODAG representation.
Definition structs.h:225