nRF5 SDK for Mesh v5.0.0
mesh_friendship_types.h
1 /* Copyright (c) 2010 - 2020, Nordic Semiconductor ASA
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form, except as embedded into a Nordic
11  * Semiconductor ASA integrated circuit in a product or a software update for
12  * such product, must reproduce the above copyright notice, this list of
13  * conditions and the following disclaimer in the documentation and/or other
14  * materials provided with the distribution.
15  *
16  * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17  * contributors may be used to endorse or promote products derived from this
18  * software without specific prior written permission.
19  *
20  * 4. This software, with or without modification, must only be used with a
21  * Nordic Semiconductor ASA integrated circuit.
22  *
23  * 5. Any software provided in binary form under this license must not be reverse
24  * engineered, decompiled, modified and/or disassembled.
25  *
26  * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
27  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef MESH_FRIENDSHIP_TYPES_H__
39 #define MESH_FRIENDSHIP_TYPES_H__
40 
41 #include <stdint.h>
42 
58 typedef enum
59 {
60  MESH_FRIENDSHIP_RSSI_FACTOR_1_0 = 0,
61  MESH_FRIENDSHIP_RSSI_FACTOR_1_5 = 1,
62  MESH_FRIENDSHIP_RSSI_FACTOR_2_0 = 2,
63  MESH_FRIENDSHIP_RSSI_FACTOR_2_5 = 3
65 
73 typedef enum
74 {
75  MESH_FRIENDSHIP_RECEIVE_WINDOW_FACTOR_1_0 = 0,
76  MESH_FRIENDSHIP_RECEIVE_WINDOW_FACTOR_1_5 = 1,
77  MESH_FRIENDSHIP_RECEIVE_WINDOW_FACTOR_2_0 = 2,
78  MESH_FRIENDSHIP_RECEIVE_WINDOW_FACTOR_2_5 = 3
80 
86 typedef enum
87 {
88  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_PROHIBITED = 0,
89  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_2 = 1,
90  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_4 = 2,
91  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_8 = 3,
92  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_16 = 4,
93  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_32 = 5,
94  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_64 = 6,
95  MESH_FRIENDSHIP_MIN_FRIEND_QUEUE_SIZE_128 = 7
97 
98 typedef struct
99 {
100  uint16_t src;
101  uint16_t prev_friend_src;
102  uint16_t element_count;
103  uint16_t request_count;
105 
106 typedef struct
107 {
109  uint32_t poll_timeout_ms;
110  uint32_t poll_count;
113  int8_t avg_rssi;
115 
118 #endif /* MESH_FRIENDSHIP_TYPES_H__ */
uint8_t receive_delay_ms
Delay before the receive window starts, in milliseconds.
uint16_t prev_friend_src
Source of the previous Friend.
mesh_friendship_rssi_factor_t
Weight factor applied to the received RSSI by the Friend node.
uint32_t poll_count
Number of polls received from the LPN.
int8_t avg_rssi
Average RSSI of the LPN messages received.
uint32_t poll_timeout_ms
Poll Timeout in milliseconds.
mesh_friendship_lpn_t lpn
Low Power node data.
uint16_t src
LPN source address.
mesh_friendship_min_friend_queue_size_t
Minimum size of the Friend Queue.
mesh_friendship_receive_window_factor_t
Weight factor applied to the offered Receive Window by the Friend node.
uint16_t element_count
Number of elements in the LPN.
uint16_t request_count
Number of Friend Requests sent by the LPN.
uint8_t receive_window_ms
Length of the LPN&#39;s Receive Window in milliseconds.

Documentation feedback | Developer Zone | Subscribe | Updated