Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
1a967ab2
Commit
1a967ab2
authored
7 years ago
by
Sebastian Meiling
Browse files
Options
Downloads
Patches
Plain Diff
sys: enhance trickle docu
parent
b7eecca9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/include/trickle.h
+17
-10
17 additions, 10 deletions
sys/include/trickle.h
with
17 additions
and
10 deletions
sys/include/trickle.h
+
17
−
10
View file @
1a967ab2
...
@@ -12,9 +12,14 @@
...
@@ -12,9 +12,14 @@
/**
/**
* @defgroup sys_trickle Trickle Timer
* @defgroup sys_trickle Trickle Timer
* @ingroup sys
* @ingroup sys
* @brief Implementation of a generic Trickle Algorithm (RFC 6206)
*
* @see https://tools.ietf.org/html/rfc6206
*
* @{
* @{
*
* @file
* @file
* @brief
Implementation of a generic Trickle Algorithm (RFC 6206)
* @brief
Trickle timer interface definition
*
*
* @author Eric Engel <eric.engel@fu-berlin.de>
* @author Eric Engel <eric.engel@fu-berlin.de>
* @author Cenk Gündoğan <cenk.guendogan@haw-hamburg.de>
* @author Cenk Gündoğan <cenk.guendogan@haw-hamburg.de>
...
@@ -31,29 +36,31 @@
...
@@ -31,29 +36,31 @@
#include
"thread.h"
#include
"thread.h"
/**
/**
* @brief a generic callback function with arguments that is called by
* @brief Trickle callback function with arguments
* trickle periodically
*/
*/
typedef
struct
{
typedef
struct
{
void
(
*
func
)(
void
*
);
/**< callback function pointer */
void
(
*
func
)(
void
*
);
/**< callback function pointer */
void
*
args
;
/**< callback function arguments */
void
*
args
;
/**< callback function arguments */
}
trickle_callback_t
;
}
trickle_callback_t
;
/** @brief all state variables for a trickle timer */
/**
* @brief all state variables of a trickle timer
*/
typedef
struct
{
typedef
struct
{
uint8_t
k
;
/**< redundancy constant */
uint8_t
k
;
/**< redundancy constant */
uint8_t
Imax
;
/**< maximum interval size, described as doublings */
uint8_t
Imax
;
/**< maximum interval size,
described as of Imin doublings */
uint16_t
c
;
/**< counter */
uint16_t
c
;
/**< counter */
uint32_t
Imin
;
/**< minimum interval size */
uint32_t
Imin
;
/**< minimum interval size */
uint32_t
I
;
/**< current interval size */
uint32_t
I
;
/**< current interval size */
uint32_t
t
;
/**< time within the current interval */
uint32_t
t
;
/**< time within the current interval */
kernel_pid_t
pid
;
/**< pid of trickles target thread */
kernel_pid_t
pid
;
/**< pid of trickles target thread */
trickle_callback_t
callback
;
/**<
the
callback function and parameter that
trickle is calling
trickle_callback_t
callback
;
/**< callback function and parameter that
after each interval */
trickle calls
after each interval */
msg_t
msg
;
/**< the msg_t to use for intervals */
msg_t
msg
;
/**< the msg_t to use for intervals */
uint64_t
msg_time
;
/**< interval in ms */
uint64_t
msg_time
;
/**< interval in ms */
xtimer_t
msg_timer
;
/**< xtimer to send a msg_t to the target
thread
xtimer_t
msg_timer
;
/**< xtimer to send a msg_t to the target
for a new interval */
thread
for a new interval */
}
trickle_t
;
}
trickle_t
;
/**
/**
...
@@ -106,7 +113,7 @@ void trickle_increment_counter(trickle_t *trickle);
...
@@ -106,7 +113,7 @@ void trickle_increment_counter(trickle_t *trickle);
void
trickle_interval
(
trickle_t
*
trickle
);
void
trickle_interval
(
trickle_t
*
trickle
);
/**
/**
* @brief is called after the
callback
interval is over and
calls the
callback function
* @brief is called after the interval is over and
executes
callback function
*
*
* @param[in] trickle trickle timer
* @param[in] trickle trickle timer
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment