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 
18 #include <string.h>
19 #if IS_USED(MODULE_NIMBLE_RPBLE)
20 #include "nimble_rpble.h"
21 #endif
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #if IS_USED(MODULE_NIMBLE_RPBLE)
28 static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
29 {
31  ctx.inst_id = dodag->instance->id;
32  memcpy(ctx.dodag_id, &dodag->dodag_id, 16);
33  ctx.version = dodag->version;
34  ctx.rank = dodag->my_rank;
35  ctx.role = dodag->node_status;
36  nimble_rpble_update(&ctx);
37 }
38 #else
39 static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
40 {
41  (void)dodag;
42  /* do nothing here */
43 }
44 #endif
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
int nimble_rpble_update(const nimble_rpble_ctx_t *ctx)
Update the current RPL context.
Interface for the nimble_rpble module.
RPL DODAG information.
Definition: nimble_rpble.h:125
uint16_t rank
the node's rank in the DODAG
Definition: nimble_rpble.h:130
uint8_t dodag_id[16]
DODAG ID.
Definition: nimble_rpble.h:127
uint8_t role
RPL role of the node.
Definition: nimble_rpble.h:129
uint8_t version
DODAG version.
Definition: nimble_rpble.h:128
uint8_t inst_id
instance ID
Definition: nimble_rpble.h:126
struct gnrc_rpl_dodag gnrc_rpl_dodag_t
DODAG representation.
Definition: structs.h:221