Optimized RF24Network Layer
2.1.1
2024 - Optimized RF24 Network Layer for NRF24L01 & NRF52x radios
Loading...
Searching...
No Matches
RF24Network_config.h
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>
4
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
version 2 as published by the Free Software Foundation.
8
*/
9
10
#ifndef __RF24NETWORK_CONFIG_H__
11
#define __RF24NETWORK_CONFIG_H__
12
14
#ifndef NETWORK_DEFAULT_ADDRESS
15
#define NETWORK_DEFAULT_ADDRESS 04444
16
#endif
// NETWORK_DEFAULT_ADDRESS
17
19
#define NETWORK_MULTICAST_ADDRESS 0100
20
22
#define NETWORK_AUTO_ROUTING 070
23
24
#ifdef DOXYGEN_FORCED
34
#define SLOW_ADDR_POLL_RESPONSE 10
35
#endif
// defined DOXYGEN_FORCED
36
41
#define NUM_PIPES 6
42
43
#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
44
45
/********** USER CONFIG - non ATTiny **************/
46
47
//#define ENABLE_SLEEP_MODE //AVR only
49
#define RF24NetworkMulticast
50
51
/* Saves memory by disabling fragmentation */
52
//#define DISABLE_FRAGMENTATION
53
54
/* System defines */
55
63
#ifndef MAX_PAYLOAD_SIZE
64
#if defined linux || defined __linux || !defined F_CPU || F_CPU >= 50000000
65
#define MAX_PAYLOAD_SIZE 1514
66
#else
67
#define MAX_PAYLOAD_SIZE 144
68
#endif
69
#endif
// MAX_PAYLOAD_SIZE
70
78
#define MAIN_BUFFER_SIZE (MAX_PAYLOAD_SIZE + FRAME_HEADER_SIZE)
79
80
/* Disable user payloads. Saves memory when used with RF24Ethernet or software that uses external data.*/
81
//#define DISABLE_USER_PAYLOADS
82
83
/* Enable tracking of success and failures for all transmissions, routed and user initiated */
84
//#define ENABLE_NETWORK_STATS
85
86
#ifndef DISABLE_DYNAMIC_PAYLOADS
88
#define ENABLE_DYNAMIC_PAYLOADS
89
#endif
// DISABLE_DYNAMIC_PAYLOADS
90
91
#if defined ARDUINO_ARCH_ESP8266 || ARDUINO_ARCH_ESP32
92
#define RF24NETWORK_DELAY(x) RF24NetworkDelay(x)
93
#else
94
#define RF24NETWORK_DELAY(x) delay(x)
95
#endif
96
97
/* Debug Options */
98
//#define RF24NETWORK_DEBUG
99
//#define RF24NETWORK_DEBUG_MINIMAL
100
//#define RF24NETWORK_DEBUG_ROUTING
101
//#define RF24NETWORK_DEBUG_FRAGMENTATION
102
//#define RF24NETWORK_DEBUG_FRAGMENTATION_L2
103
/*************************************/
104
105
#else
// Different set of defaults for ATTiny - fragmentation is disabled and user payloads are set to 3 max
106
/********** USER CONFIG - ATTiny **************/
107
//#define ENABLE_SLEEP_MODE //AVR only
108
#define RF24NetworkMulticast
109
// NOTE: Only 24 bytes of a payload are used when DISABLE_FRAGMENTATION is defined
110
#define MAX_PAYLOAD_SIZE 72
111
#define MAIN_BUFFER_SIZE (MAX_PAYLOAD_SIZE + FRAME_HEADER_SIZE)
112
#define DISABLE_FRAGMENTATION
113
#define ENABLE_DYNAMIC_PAYLOADS
114
//#define DISABLE_USER_PAYLOADS
115
#endif
116
/*************************************/
117
118
#endif
// RF24_NETWORK_CONFIG_H
119
120
#ifdef __cplusplus
121
122
#if (defined(__linux) || defined(linux)) && !defined(__ARDUINO_X86__) && !defined(USE_RF24_LIB_SRC)
123
#include <RF24/RF24_config.h>
124
125
// ATXMega
126
#elif defined(XMEGA)
127
#include "../../rf24lib/rf24lib/RF24_config.h"
128
#else
129
#include <RF24_config.h>
130
#endif
131
132
#if !defined(ARDUINO_ARCH_AVR)
133
// sprintf is used by RF24NetworkHeader::toString
134
#ifndef sprintf_P
135
#define sprintf_P sprintf
136
#endif
137
#endif
138
139
#ifdef RF24NETWORK_DEBUG
140
#define IF_RF24NETWORK_DEBUG(x) ({ x; })
141
#else
142
#define IF_RF24NETWORK_DEBUG(x)
143
#endif
144
#if defined(RF24NETWORK_DEBUG_MINIMAL)
145
#define IF_RF24NETWORK_DEBUG_MINIMAL(x) ({ x; })
146
#else
147
#define IF_RF24NETWORK_DEBUG_MINIMAL(x)
148
#endif
149
150
#if defined(RF24NETWORK_DEBUG_FRAGMENTATION)
151
#define IF_RF24NETWORK_DEBUG_FRAGMENTATION(x) ({ x; })
152
#else
153
#define IF_RF24NETWORK_DEBUG_FRAGMENTATION(x)
154
#endif
155
156
#if defined(RF24NETWORK_DEBUG_FRAGMENTATION_L2)
157
#define IF_RF24NETWORK_DEBUG_FRAGMENTATION_L2(x) ({ x; })
158
#else
159
#define IF_RF24NETWORK_DEBUG_FRAGMENTATION_L2(x)
160
#endif
161
162
#if defined(RF24NETWORK_DEBUG_ROUTING)
163
#define IF_RF24NETWORK_DEBUG_ROUTING(x) ({ x; })
164
#else
165
#define IF_RF24NETWORK_DEBUG_ROUTING(x)
166
#endif
167
168
#endif
// RF24_CONFIG_H
Generated on
for Optimized RF24Network Layer by
1.15.0