Loading...
Searching...
No Matches
rpble.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include <string.h>
19#if IS_USED(MODULE_NIMBLE_RPBLE)
20#include "nimble_rpble.h"
21#endif
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#if IS_USED(MODULE_NIMBLE_RPBLE)
28static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
29{
31
32 if (dodag == NULL) {
34 return;
35 }
36
37 ctx.inst_id = dodag->instance->id;
38 memcpy(ctx.dodag_id, &dodag->dodag_id, 16);
39 ctx.version = dodag->version;
40 ctx.rank = dodag->my_rank;
41 ctx.role = dodag->node_status;
43}
44#else
45static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
46{
47 (void)dodag;
48 /* do nothing here */
49}
50#endif
51
52#ifdef __cplusplus
53}
54#endif
55
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:221