Contiki-Inga 3.x
contiki-default-conf.h
1 /*
2  * Copyright (c) 2012, Thingsquare, http://www.thingsquare.com/.
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 copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  */
31 
32 #ifndef CONTIKI_DEFAULT_CONF_H
33 #define CONTIKI_DEFAULT_CONF_H
34 
35 /*---------------------------------------------------------------------------*/
36 /* Netstack configuration
37  *
38  * The netstack configuration is typically overridden by the platform
39  * configuration, as defined in contiki-conf.h
40  */
41 
42 /* NETSTACK_CONF_RADIO specifies the radio driver. The radio driver
43  typically depends on the radio used on the target hardware. */
44 #ifndef NETSTACK_CONF_RADIO
45 #define NETSTACK_CONF_RADIO nullradio_driver
46 /* #define NETSTACK_CONF_RADIO cc2420_driver */
47 #endif /* NETSTACK_CONF_RADIO */
48 
49 /* NETSTACK_CONF_FRAMER specifies the over-the-air frame format used
50  by Contiki radio packets. For IEEE 802.15.4 radios, use the
51  framer_802154 driver. */
52 #ifndef NETSTACK_CONF_FRAMER
53 #define NETSTACK_CONF_FRAMER framer_nullmac
54 /* #define NETSTACK_CONF_FRAMER framer_802154 */
55 #endif /* NETSTACK_CONF_FRAMER */
56 
57 /* NETSTACK_CONF_RDC specifies the Radio Duty Cycling (RDC) layer. The
58  nullrdc_driver never turns the radio off and is compatible with all
59  radios, but consumes a lot of power. The contikimac_driver is
60  highly power-efficent and allows sleepy routers, but is not
61  compatible with all radios. */
62 #ifndef NETSTACK_CONF_RDC
63 #define NETSTACK_CONF_RDC nullrdc_driver
64 /* #define NETSTACK_CONF_RDC contikimac_driver */
65 #endif /* NETSTACK_CONF_RDC */
66 
67 /* NETSTACK_CONF_MAC specifies the Medium Access Control (MAC)
68  layer. The nullmac_driver does not provide any MAC
69  functionality. The csma_driver is the default CSMA MAC layer, but
70  is not compatible with all radios. */
71 #ifndef NETSTACK_CONF_MAC
72 #define NETSTACK_CONF_MAC nullmac_driver
73 /* #define NETSTACK_CONF_MAC csma_driver */
74 #endif /* NETSTACK_CONF_MAC */
75 
76 /* NETSTACK_CONF_NETWORK specifies the network layer and can be either
77  sicslowpan_driver, for IPv6 networking, or rime_driver, for the
78  custom Rime network stack. */
79 #ifndef NETSTACK_CONF_NETWORK
80 #define NETSTACK_CONF_NETWORK rime_driver
81 /* #define NETSTACK_CONF_NETWORK sicslowpan_driver */
82 #endif /* NETSTACK_CONF_NETWORK */
83 
84 /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE specifies the channel check
85  rate of the RDC layer. This defines how often the RDC will wake up
86  and check for radio channel activity. A higher check rate results
87  in higher communication performance at the cost of a higher power
88  consumption. */
89 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
90 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
91 #endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */
92 
93 /*---------------------------------------------------------------------------*/
94 /* Packet buffer size options.
95  *
96  * The packet buffer size options can be tweaked on a per-project
97  * basis to reduce memory consumption.
98  */
99 
100 /* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue
101  buffers are used throughout the Contiki netstack but the
102  configuration option can be tweaked to save memory. Performance can
103  suffer with a too low number of queue buffers though. */
104 #ifndef QUEUEBUF_CONF_NUM
105 #define QUEUEBUF_CONF_NUM 8
106 #endif /* QUEUEBUF_CONF_NUM */
107 /*---------------------------------------------------------------------------*/
108 /* uIPv6 configuration options.
109  *
110  * Many of the uIPv6 configuration options can be overriden by a
111  * project-specific configuration to save memory.
112  */
113 
114 /* UIP_CONF_IPV6 specifies whether or not IPv6 should be used. If IPv6
115  is not used, IPv4 is used instead. */
116 #ifndef UIP_CONF_IPV6
117 #define UIP_CONF_IPV6 0
118 #endif /* UIP_CONF_IPV6 */
119 
120 /* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
121  for the uIP packet buffer. This sets an upper bound on the largest
122  IP packet that can be received by the system. */
123 #ifndef UIP_CONF_BUFFER_SIZE
124 #define UIP_CONF_BUFFER_SIZE 128
125 #endif /* UIP_CONF_BUFFER_SIZE */
126 
127 /* UIP_CONF_ROUTER specifies if the IPv6 node should be a router or
128  not. By default, all Contiki nodes are routers. */
129 #ifndef UIP_CONF_ROUTER
130 #define UIP_CONF_ROUTER 1
131 #endif /* UIP_CONF_ROUTER */
132 
133 /* UIP_CONF_IPV6_RPL specifies if RPL is to be used for IPv6
134  routing. */
135 #ifndef UIP_CONF_IPV6_RPL
136 #define UIP_CONF_IPV6_RPL 1
137 #endif /* UIP_CONF_IPV6_RPL */
138 
139 /* UIP_CONF_MAX_ROUTES specifies the maximum number of routes that each
140  node will be able to handle. */
141 #ifndef UIP_CONF_MAX_ROUTES
142 #define UIP_CONF_MAX_ROUTES 20
143 #endif /* UIP_CONF_MAX_ROUTES */
144 
145 /* UIP_CONF_UDP specifies if UDP support should be included or
146  not. Disabling UDP saves memory but breaks a lot of stuff. */
147 #ifndef UIP_CONF_UDP
148 #define UIP_CONF_UDP 1
149 #endif /* UIP_CONF_UDP */
150 
151 /* UIP_CONF_MAX_CONNECTIONS specifies the maximum number of
152  simultaneous TCP connections. */
153 #ifndef UIP_CONF_MAX_CONNECTIONS
154 #define UIP_CONF_MAX_CONNECTIONS 8
155 #endif /* UIP_CONF_MAX_CONNECTIONS */
156 
157 /* UIP_CONF_TCP specifies if TCP support should be included or
158  not. Disabling TCP saves memory. */
159 #ifndef UIP_CONF_TCP
160 #define UIP_CONF_TCP 1
161 #endif /* UIP_CONF_TCP */
162 
163 /* UIP_CONF_MAX_CONNECTIONS specifies the maximum number of
164  simultaneous TCP connections. */
165 #ifndef UIP_CONF_MAX_CONNECTIONS
166 #define UIP_CONF_MAX_CONNECTIONS 8
167 #endif /* UIP_CONF_MAX_CONNECTIONS */
168 
169 
170 /* UIP_CONF_TCP_SPLIT enables a performance optimization hack, where
171  each maximum-sized TCP segment is split into two, to avoid the
172  performance degradation that is caused by delayed ACKs. */
173 #ifndef UIP_CONF_TCP_SPLIT
174 #define UIP_CONF_TCP_SPLIT 0
175 #endif /* UIP_CONF_TCP_SPLIT */
176 
177 /* NBR_TABLE_CONF_MAX_NEIGHBORS specifies the maximum number of neighbors
178  that each node will be able to handle. */
179 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
180 #define NBR_TABLE_CONF_MAX_NEIGHBORS 8
181 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
182 
183 /*---------------------------------------------------------------------------*/
184 /* 6lowpan configuration options.
185  *
186  * These options change the behavior of the 6lowpan header compression
187  * code (sicslowpan). They typically depend on the type of radio used
188  * on the target platform, and are therefore platform-specific.
189  */
190 
191 /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS specifies how many times the
192  MAC layer should resend packets if no link-layer ACK was
193  received. This only makes sense with the csma_driver
194  NETSTACK_CONF_MAC. */
195 #ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
196 #define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 4
197 #endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
198 
199 /* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be
200  used or not. Fragmentation is on by default. */
201 #ifndef SICSLOWPAN_CONF_FRAG
202 #define SICSLOWPAN_CONF_FRAG 1
203 #endif /* SICSLOWPAN_CONF_FRAG */
204 
205 /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD specifies the maximum size of
206  packets before they get fragmented. The default is 127 bytes (the
207  maximum size of a 802.15.4 frame) - 25 bytes (for the 802.15.4 MAC
208  layer header). This can be increased for systems with larger packet
209  sizes. */
210 #ifndef SICSLOWPAN_CONF_MAC_MAX_PAYLOAD
211 #define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD (127 - 25)
212 #endif /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD */
213 
214 /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD sets a lower threshold for
215  when packets should not be compressed. This is used by ContikiMAC,
216  which requires packets to be larger than a given minimum size. */
217 #ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
218 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 0
219 /* #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63 */
220 #endif /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD */
221 
222 /* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
223  mechanism to be used. 6lowpan hc06 is the default in Contiki. */
224 #ifndef SICSLOWPAN_CONF_COMPRESSION
225 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
226 #endif /* SICSLOWPAN_CONF_COMPRESSION */
227 
228 /*---------------------------------------------------------------------------*/
229 /* ContikiMAC configuration options.
230  *
231  * These are typically configured on a per-platform basis.
232  */
233 
234 /* CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION specifies if ContikiMAC
235  should optimize for the phase of neighbors. The phase optimization
236  may reduce power consumption but is not compatible with all timer
237  settings and is therefore off by default. */
238 #ifndef CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION
239 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
240 #endif /* CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION */
241 
242 
243 #endif /* CONTIKI_DEFAULT_CONF_H */