Contiki-NG
Toggle main menu visibility
Loading...
Searching...
No Matches
tsch-rpl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014, SICS Swedish ICT.
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
* 1. Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* 2. Redistributions in binary form must reproduce the above copyright
11
* notice, this list of conditions and the following disclaimer in the
12
* documentation and/or other materials provided with the distribution.
13
* 3. Neither the name of the Institute nor the names of its contributors
14
* may be used to endorse or promote products derived from this software
15
* without specific prior written permission.
16
*
17
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
* SUCH DAMAGE.
28
*
29
*/
30
31
/**
32
* \addtogroup tsch
33
* @{
34
* \file
35
* TSCH-RPL interaction
36
*/
37
38
#ifndef TSCH_RPL_H_
39
#define TSCH_RPL_H_
40
41
/********** Includes **********/
42
43
#include "
net/routing/routing.h
"
44
#if ROUTING_CONF_RPL_LITE
45
#include "net/routing/rpl-lite/rpl.h"
46
#elif ROUTING_CONF_RPL_CLASSIC
47
#include "net/routing/rpl-classic/rpl.h"
48
#endif
49
50
/********** Functions *********/
51
52
/**
53
* \brief Report statiscs from KA packet sent in RPL.
54
* To use, set TSCH_CALLBACK_KA_SENT to tsch_rpl_callback_ka_sent
55
* \param status The packet sent status
56
* \param transmissions The total number of transmissions
57
*/
58
void
tsch_rpl_callback_ka_sent
(
int
status,
int
transmissions);
59
/**
60
* \brief Let RPL know that TSCH joined a new network.
61
* To use, set TSCH_CALLBACK_JOINING_NETWORK to tsch_rpl_callback_joining_network
62
*/
63
void
tsch_rpl_callback_joining_network
(
void
);
64
/**
65
* \brief Let RPL know that TSCH joined a new network. Triggers a local repair.
66
* To use, set TSCH_CALLBACK_LEAVING_NETWORK to tsch_rpl_callback_leaving_network
67
*/
68
void
tsch_rpl_callback_leaving_network
(
void
);
69
/**
70
* \brief Set TSCH EB period based on current RPL DIO period.
71
* To use, set RPL_CALLBACK_NEW_DIO_INTERVAL to tsch_rpl_callback_new_dio_interval
72
* \param dio_interval The new DIO interval in clock ticks
73
*/
74
void
tsch_rpl_callback_new_dio_interval
(clock_time_t dio_interval);
75
/**
76
* \brief Set TSCH time source based on current RPL preferred parent.
77
* To use, set RPL_CALLBACK_PARENT_SWITCH to tsch_rpl_callback_parent_switch
78
* \param old The old RPL parent
79
* \param new The new RPL parent
80
*/
81
void
tsch_rpl_callback_parent_switch
(rpl_parent_t *old, rpl_parent_t *
new
);
82
/**
83
* \brief Check RPL has joined DODAG.
84
* To use, set TSCH_RPL_CHECK_DODAG_JOINED tsch_rpl_check_dodag_joined
85
* \return 1 if joined, 0 otherwise
86
*/
87
int
tsch_rpl_check_dodag_joined
(
void
);
88
89
#endif
/* TSCH_RPL_H_ */
90
/** @} */
tsch_rpl_callback_parent_switch
void tsch_rpl_callback_parent_switch(rpl_parent_t *old, rpl_parent_t *new)
Set TSCH time source based on current RPL preferred parent.
tsch_rpl_callback_joining_network
void tsch_rpl_callback_joining_network(void)
Let RPL know that TSCH joined a new network.
tsch_rpl_callback_leaving_network
void tsch_rpl_callback_leaving_network(void)
Let RPL know that TSCH joined a new network.
tsch_rpl_callback_new_dio_interval
void tsch_rpl_callback_new_dio_interval(clock_time_t dio_interval)
Set TSCH EB period based on current RPL DIO period.
tsch_rpl_callback_ka_sent
void tsch_rpl_callback_ka_sent(int status, int transmissions)
Report statiscs from KA packet sent in RPL.
tsch_rpl_check_dodag_joined
int tsch_rpl_check_dodag_joined(void)
Check RPL has joined DODAG.
routing.h
Routing driver header file.
os
net
mac
tsch
tsch-rpl.h
Generated on
for Contiki-NG by
1.17.0