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 
9 #pragma once
10 
21 #include <string.h>
22 #if IS_USED(MODULE_NIMBLE_RPBLE)
23 #include "nimble_rpble.h"
24 #endif
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #if IS_USED(MODULE_NIMBLE_RPBLE)
31 static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
32 {
34  ctx.inst_id = dodag->instance->id;
35  memcpy(ctx.dodag_id, &dodag->dodag_id, 16);
36  ctx.version = dodag->version;
37  ctx.rank = dodag->my_rank;
38  ctx.role = dodag->node_status;
39  nimble_rpble_update(&ctx);
40 }
41 #else
42 static inline void gnrc_rpl_rpble_update(const gnrc_rpl_dodag_t *dodag)
43 {
44  (void)dodag;
45  /* do nothing here */
46 }
47 #endif
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
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:224