Contiki-NG
Toggle main menu visibility
Loading...
Searching...
No Matches
rpl-timers.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010, Swedish Institute of Computer Science.
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
* This file is part of the Contiki operating system.
30
*
31
*/
32
33
/**
34
* \addtogroup rpl-lite
35
* @{
36
*
37
* \file
38
* Header file for rpl-timers module
39
* \author
40
* Joakim Eriksson <joakime@sics.se>, Nicolas Tsiftes <nvt@sics.se>,
41
* Simon DUquennoy <simon.duquennoy@inria.fr>
42
*
43
*/
44
45
#ifndef RPL_TIMERS_H
46
#define RPL_TIMERS_H
47
48
/********** Includes **********/
49
50
#include "net/routing/rpl-lite/rpl.h"
51
52
/********** Public functions **********/
53
54
/**
55
* Schedule periodic DIS with a random delay based on RPL_DIS_INTERVAL, until
56
* we join a DAG.
57
*/
58
void
rpl_timers_schedule_periodic_dis
(
void
);
59
60
/**
61
* Cancel scheduled leaving if any
62
*/
63
void
rpl_timers_unschedule_leaving
(
void
);
64
65
/**
66
* Schedule leaving after RPL_DELAY_BEFORE_LEAVING
67
*/
68
void
rpl_timers_schedule_leaving
(
void
);
69
70
/**
71
* Initialize rpl-timers module
72
*/
73
void
rpl_timers_init
(
void
);
74
75
/**
76
* Stop all timers related to the DAG
77
*/
78
void
rpl_timers_stop_dag_timers
(
void
);
79
80
/**
81
* Reset DIO Trickle timer
82
*
83
* \param str A textual description of caused the DIO timer reset
84
*/
85
void
rpl_timers_dio_reset
(
const
char
*str);
86
87
/**
88
* Schedule unicast DIO with no delay
89
*/
90
void
rpl_timers_schedule_unicast_dio
(rpl_nbr_t *target);
91
92
/**
93
* Schedule a DAO with random delay based on RPL_DAO_DELAY
94
*/
95
void
rpl_timers_schedule_dao
(
void
);
96
97
/**
98
* Schedule a DAO-ACK with no delay
99
*/
100
void
rpl_timers_schedule_dao_ack
(uip_ipaddr_t *target, uint16_t sequence);
101
102
/**
103
* Let the rpl-timers module know that the last DAO was ACKed
104
*/
105
void
rpl_timers_notify_dao_ack
(
void
);
106
107
/**
108
* Schedule probing with delay RPL_PROBING_DELAY_FUNC()
109
*/
110
void
rpl_schedule_probing
(
void
);
111
112
/**
113
* Schedule probing within a few seconds
114
*/
115
void
rpl_schedule_probing_now
(
void
);
116
117
/**
118
* Schedule a state update ASAP. Useful to force an update from a context
119
* where updating directly would be unsafe.
120
*/
121
void
rpl_timers_schedule_state_update
(
void
);
122
123
/**
124
* Cancelled any scheduled state update.
125
*/
126
static
inline
void
127
rpl_timers_unschedule_state_update
(
void
)
128
{
129
if
(curr_instance.used) {
130
ctimer_stop
(&curr_instance.dag.state_update);
131
}
132
}
133
134
/** @} */
135
136
#endif
/* RPL_TIMERS_H */
ctimer_stop
void ctimer_stop(struct ctimer *c)
Stop a pending callback timer.
Definition
ctimer.c:150
rpl_timers_stop_dag_timers
void rpl_timers_stop_dag_timers(void)
Stop all timers related to the DAG.
Definition
rpl-timers.c:538
rpl_schedule_probing
void rpl_schedule_probing(void)
Schedule probing with delay RPL_PROBING_DELAY_FUNC().
rpl_timers_unschedule_state_update
static void rpl_timers_unschedule_state_update(void)
Cancelled any scheduled state update.
Definition
rpl-timers.h:127
rpl_schedule_probing_now
void rpl_schedule_probing_now(void)
Schedule probing within a few seconds.
rpl_timers_notify_dao_ack
void rpl_timers_notify_dao_ack(void)
Let the rpl-timers module know that the last DAO was ACKed.
rpl_timers_schedule_dao
void rpl_timers_schedule_dao(void)
Schedule a DAO with random delay based on RPL_DAO_DELAY.
Definition
rpl-timers.c:263
rpl_timers_schedule_leaving
void rpl_timers_schedule_leaving(void)
Schedule leaving after RPL_DELAY_BEFORE_LEAVING.
Definition
rpl-timers.c:493
rpl_timers_dio_reset
void rpl_timers_dio_reset(const char *str)
Reset DIO Trickle timer.
Definition
rpl-timers.c:150
rpl_timers_init
void rpl_timers_init(void)
Initialize rpl-timers module.
Definition
rpl-timers.c:505
rpl_timers_schedule_dao_ack
void rpl_timers_schedule_dao_ack(uip_ipaddr_t *target, uint16_t sequence)
Schedule a DAO-ACK with no delay.
rpl_timers_unschedule_leaving
void rpl_timers_unschedule_leaving(void)
Cancel scheduled leaving if any.
Definition
rpl-timers.c:483
rpl_timers_schedule_periodic_dis
void rpl_timers_schedule_periodic_dis(void)
Schedule periodic DIS with a random delay based on RPL_DIS_INTERVAL, until we join a DAG.
Definition
rpl-timers.c:93
rpl_timers_schedule_state_update
void rpl_timers_schedule_state_update(void)
Schedule a state update ASAP.
Definition
rpl-timers.c:555
rpl_timers_schedule_unicast_dio
void rpl_timers_schedule_unicast_dio(rpl_nbr_t *target)
Schedule unicast DIO with no delay.
Definition
rpl-timers.c:208
os
net
routing
rpl-lite
rpl-timers.h
Generated on
for Contiki-NG by
1.17.0