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
28 extern "C" {
29 #endif
30 
31 #if IS_USED(MODULE_NIMBLE_RPBLE)
32 static 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;
40  nimble_rpble_update(&ctx);
41 }
42 #else
43 static 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.
Definition: nimble_rpble.h:126
uint16_t rank
the node's rank in the DODAG
Definition: nimble_rpble.h:131
uint8_t dodag_id[16]
DODAG ID.
Definition: nimble_rpble.h:128
uint8_t role
RPL role of the node.
Definition: nimble_rpble.h:130
uint8_t version
DODAG version.
Definition: nimble_rpble.h:129
uint8_t inst_id
instance ID
Definition: nimble_rpble.h:127
struct gnrc_rpl_dodag gnrc_rpl_dodag_t
DODAG representation.
Definition: structs.h:225