Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
trickle.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 2016 Intel Corporation
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 */
12
13#ifndef ZEPHYR_INCLUDE_NET_TRICKLE_H_
14#define ZEPHYR_INCLUDE_NET_TRICKLE_H_
15
16#include <stdbool.h>
17#include <zephyr/types.h>
18
19#include <kernel.h>
20#include <net/net_core.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
33struct net_trickle;
34
45typedef void (*net_trickle_cb_t)(struct net_trickle *trickle,
46 bool do_suppress, void *user_data);
47
64
67 void *user_data;
68};
69
71#define NET_TRICKLE_INFINITE_REDUNDANCY 0
84int net_trickle_create(struct net_trickle *trickle,
85 uint32_t Imin,
86 uint8_t Imax,
87 uint8_t k);
88
99int net_trickle_start(struct net_trickle *trickle,
101 void *user_data);
102
110int net_trickle_stop(struct net_trickle *trickle);
111
119
127
135static inline bool net_trickle_is_running(struct net_trickle *trickle)
136{
137 NET_ASSERT(trickle);
138
139 return trickle->I != 0U;
140}
141
146#ifdef __cplusplus
147}
148#endif
149
150#endif /* ZEPHYR_INCLUDE_NET_TRICKLE_H_ */
void
Definition: eswifi_shell.c:15
void(* net_trickle_cb_t)(struct net_trickle *trickle, bool do_suppress, void *user_data)
Trickle timer callback.
Definition: trickle.h:45
int net_trickle_start(struct net_trickle *trickle, net_trickle_cb_t cb, void *user_data)
Start a Trickle timer.
int net_trickle_stop(struct net_trickle *trickle)
Stop a Trickle timer.
static bool net_trickle_is_running(struct net_trickle *trickle)
Check if the Trickle timer is running or not.
Definition: trickle.h:135
int net_trickle_create(struct net_trickle *trickle, uint32_t Imin, uint8_t Imax, uint8_t k)
Create a Trickle timer.
void net_trickle_consistency(struct net_trickle *trickle)
To be called by the protocol handler when it hears a consistent network transmission.
void net_trickle_inconsistency(struct net_trickle *trickle)
To be called by the protocol handler when it hears an inconsistent network transmission.
Network core definitions.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
A structure used to submit work after a delay.
Definition: kernel.h:3651
Definition: trickle.h:53
uint8_t Imax
Definition: trickle.h:55
bool double_to
Definition: trickle.h:63
struct k_work_delayable timer
Definition: trickle.h:65
void * user_data
Definition: trickle.h:67
uint32_t I
Definition: trickle.h:58
net_trickle_cb_t cb
Definition: trickle.h:66
uint8_t k
Definition: trickle.h:56
uint8_t c
Definition: trickle.h:60
uint32_t Istart
Definition: trickle.h:59
uint32_t Imin
Definition: trickle.h:54
uint32_t Imax_abs
Definition: trickle.h:62
static const intptr_t user_data[5]
Definition: main.c:590