1 /******************************************************************************
3 @file config.h
5 @brief TI-15.4 Stack configuration parameters for Sensor applications
7 Group: WCS LPC
8 Target Device: CC13xx
10 ******************************************************************************
12 Copyright (c) 2016-2017, Texas Instruments Incorporated
13 All rights reserved.
15 Redistribution and use in source and binary forms, with or without
16 modification, are permitted provided that the following conditions
17 are met:
19 * Redistributions of source code must retain the above copyright
20 notice, this list of conditions and the following disclaimer.
22 * Redistributions in binary form must reproduce the above copyright
23 notice, this list of conditions and the following disclaimer in the
24 documentation and/or other materials provided with the distribution.
26 * Neither the name of Texas Instruments Incorporated nor the names of
27 its contributors may be used to endorse or promote products derived
28 from this software without specific prior written permission.
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 ******************************************************************************
43 Release Name: simplelink_cc13x0_sdk_1_30_00_06"
44 Release Date: 2017-03-08 14:43:30
45 *****************************************************************************/
46 #ifndef CONFIG_H
47 #define CONFIG_H
49 /******************************************************************************
50 Includes
51 *****************************************************************************/
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
58 /******************************************************************************
59 Constants and definitions
60 *****************************************************************************/
61 /* config parameters */
62 /*! Security Enable - set to true to turn on security */
63 #define CONFIG_SECURE true
64 /*! PAN ID */
65 #define CONFIG_PAN_ID 0xFFFF
66 /*! FH disabled as default */
67 #define CONFIG_FH_ENABLE false
68 /*! link quality */
69 #define CONFIG_LINKQUALITY 1
70 /*! percent filter */
71 #define CONFIG_PERCENTFILTER 0xFF
73 /*! Enable BLE advertiser */
74 #define CONFIG_BLE_SUPPORT false
76 /*! Enable URL Toggle for BLE advertiser */
77 #define CONFIG_URL_TOGGLE false
78 /*!
79 beacon order, value of 15 indicates non beacon mode,
80 8 is a good value for beacon mode
81 */
82 #define CONFIG_BEACON_ORDER 15
83 /*!
84 superframe order, value of 15 indicates non beacon mode,
85 6 is a good value for beacon mode
86 */
87 #define CONFIG_SUPERFRAME_ORDER 15
88 /*! Maximum number of message failure, to indicate sync loss */
89 #define CONFIG_MAX_DATA_FAILURES 3
90 /*!
91 Maximum number of attempts for association in FH mode
92 after reception of a PAN Config frame
93 */
94 #define CONFIG_FH_MAX_ASSOCIATION_ATTEMPTS 3
95 /* Interval for scan backoff */
96 #define CONFIG_SCAN_BACKOFF_INTERVAL 5000
97 /* Interval for delay between orphan notifications */
98 #define CONFIG_ORPHAN_BACKOFF_INTERVAL 300000
100 /*! Setting for Phy ID */
101 #define CONFIG_PHY_ID (APIMAC_STD_US_915_PHY_1)
103 #if ((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_STD_PHY_ID_END))
104 /*! Setting for channel page */
105 #define CONFIG_CHANNEL_PAGE (APIMAC_CHANNEL_PAGE_9)
106 #elif ((CONFIG_PHY_ID >= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_END))
107 /*! Setting for channel page */
108 #define CONFIG_CHANNEL_PAGE (APIMAC_CHANNEL_PAGE_10)
109 #else
110 #error "PHY ID is wrong."
111 #endif
113 #if ((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN))
114 /*! scan duration */
115 #define CONFIG_SCAN_DURATION 5
116 #elif ((CONFIG_PHY_ID >= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN + 1) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_END))
117 /*! scan duration */
118 #define CONFIG_SCAN_DURATION 9
119 #else
120 #error "PHY ID is wrong."
121 #endif
123 /*!
124 Coordinator Short Address When Operating in LRM mode with FH Enabled.
125 This value will be ignored in all other modes
126 */
127 #define FH_LRM_COORD_SHORT_ADDR 0xAABB
128 /*!
129 Range Extender Mode setting.
130 The following modes are available.
131 APIMAC_NO_EXTENDER - does not have PA/LNA
132 APIMAC_HIGH_GAIN_MODE - high gain mode
133 To enable CC1190, use
134 #define CONFIG_RANGE_EXT_MODE APIMAC_HIGH_GAIN_MODE
135 */
136 #define CONFIG_RANGE_EXT_MODE APIMAC_NO_EXTENDER
138 /*! Setting Default Key*/
139 #define KEY_TABLE_DEFAULT_KEY {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,\
140 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
142 /*!
143 Channel mask used when CONFIG_FH_ENABLE is false.
144 Each bit indicates if the corresponding channel is to be scanned
145 First byte represents channels 0 to 7 and the last byte represents
146 channels 128 to 135.
147 For byte zero in the bit mask, LSB representing Ch0.
148 For byte 1, LSB represents Ch8 and so on.
149 e.g., 0x01 0x10 represents Ch0 and Ch12 are included.
150 The default of 0x0F represents channels 0-3 are selected.
151 APIMAC_STD_US_915_PHY_1 (50kbps/2-FSK/915MHz band) has channels 0 - 128.
152 APIMAC_STD_ETSI_863_PHY_3 (50kbps/2-FSK/863MHz band) has channels 0 - 33.
153 APIMAC_GENERIC_CHINA_433_PHY_128 (50kbps/2-FSK/433MHz band) has channels 0 - 6.
154 */
155 #define CONFIG_CHANNEL_MASK { 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, \
156 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
157 0x00, 0x00, 0x00, 0x00, 0x00 }
158 /*!
159 Channel mask used when CONFIG_FH_ENABLE is true.
160 Represents the list of channels on which the device can hop.
161 When CONFIG_RX_ON_IDLE is true, the actual sequence will
162 be based on DH1CF function. When it is set to false, the sequence
163 shall be a linear hopping over available channels in ascending order and
164 shall be used to change channel during the join phase.
165 It is represented as a bit string with LSB representing Ch0.
166 e.g., 0x01 0x10 represents Ch0 and Ch12 are included.
167 */
168 #define CONFIG_FH_CHANNEL_MASK { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
169 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, \
170 0x00, 0x00, 0x00, 0x00, 0x00,}
171 /* FH related config variables */
172 /*!
173 List of channels to target the Async frames
174 It is represented as a bit string with LSB representing Ch0
175 e.g., 0x01 0x10 represents Ch0 and Ch12 are included
176 It should cover all channels that could be used by a target device in its
177 hopping sequence. Channels marked beyond number of channels supported by
178 PHY Config will be excluded by stack. To avoid interference on a channel,
179 it should be removed from Async Mask and added to exclude channels
180 (CONFIG_CHANNEL_MASK).
181 */
182 #define FH_ASYNC_CHANNEL_MASK { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
183 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
184 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
186 /*! Rx on when idle, false for sleepy device, true for non sleepy device */
187 #define CONFIG_RX_ON_IDLE false
189 /* FH related config variables */
190 /*!
191 The number of non sleepy end devices to be supported.
192 It is to be noted that the total number of devices supported (sleepy/
193 non sleepy) must be less than 50. Stack will allocate memory proportional
194 to the number of end devices requested.
195 The minimum valid value is 2, upper limit is 50.
196 */
197 #define FH_NUM_NON_SLEEPY_NEIGHBORS 2
198 /*!
199 The number of sleepy end devices to be supported.
200 It is to be noted that the total number of devices supported (sleepy/
201 non sleepy) must be less than 50. Stack will allocate memory proportional
202 to the number of end devices requested.
203 The minimum valid value is 2, upper limit is 50.
204 */
205 #define FH_NUM_SLEEPY_NEIGHBORS 2
206 /*!
207 Dwell Time: The duration for which a non sleepy end device shall
208 stay on a specific channel before hopping to next channel.
209 */
210 #define CONFIG_DWELL_TIME 250
212 #if ((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN))
213 /*! Polling interval in milliseconds */
214 #define CONFIG_POLLING_INTERVAL 6000
215 /*! PAN Advertisement Solicit trickle timer duration in milliseconds */
216 #define CONFIG_PAN_ADVERT_SOLICIT_CLK_DURATION 6000
217 /*! PAN Config Solicit trickle timer duration in milliseconds */
218 #define CONFIG_PAN_CONFIG_SOLICIT_CLK_DURATION 6000
219 /*! Default Reporting Interval - in milliseconds */
220 #define CONFIG_REPORTING_INTERVAL 180000
221 #else
222 /*! Polling interval in milliseconds */
223 #define CONFIG_POLLING_INTERVAL 60000
224 /*! PAN Advertisement Solicit trickle timer duration in milliseconds */
225 #define CONFIG_PAN_ADVERT_SOLICIT_CLK_DURATION 60000
226 /*! PAN Config Solicit trickle timer duration in milliseconds */
227 #define CONFIG_PAN_CONFIG_SOLICIT_CLK_DURATION 60000
228 /*! Default Reporting Interval - in milliseconds */
229 #define CONFIG_REPORTING_INTERVAL 600000
230 #endif
232 /*! FH Poll/Sensor msg start time randomization window */
233 #define CONFIG_FH_START_POLL_DATA_RAND_WINDOW 10000
235 /*! If enabled, the periodic sensor message shall be sent as a fixed size
236 * packet of specified size. If set to 0, the periodic sensor message shall be
237 * of type sensor data specified in smsgs.h
238 */
239 #define SENSOR_TEST_RAMP_DATA_SIZE 0
241 /*! value for ApiMac_FHAttribute_netName */
242 #define CONFIG_FH_NETNAME {"FHTest"}
243 /*!
244 Value for Transmit Power in dBm
245 Default value is 14, allowed values are any value
246 between 0 dBm and 14 dBm in 1 dB increments, and -10 dBm
247 When the nodes in the network are close to each other,
248 lowering this value will help reduce saturation */
249 /* For China band, allowed values are between 6dBm and 14dBm */
250 /* For CC1190, allowed values are between 18dBm and 27dBm */
251 #if CONFIG_RANGE_EXT_MODE
252 #define CONFIG_TRANSMIT_POWER 27
253 #else
254 #define CONFIG_TRANSMIT_POWER 14
255 #endif
257 /*!
258 * Enable this mode for certfication.
259 * For FH certification, CONFIG_FH_ENABLE should
260 * also be enabled
261 */
262 #define CERTIFICATION_TEST_MODE false
264 /* Check if all the necessary parameters have been set for FH mode */
265 #if CONFIG_FH_ENABLE
266 #if !defined(FEATURE_ALL_MODES) && !defined(FEATURE_FREQ_HOP_MODE)
267 #error "Do you want to build image with frequency hopping mode? \
268 Define either FEATURE_FREQ_HOP_MODE or FEATURE_ALL_MODES in features.h"
269 #endif
270 #endif
272 /* Check if stack level security is enabled if application security is enabled */
273 #if CONFIG_SECURE
274 #if !defined(FEATURE_MAC_SECURITY)
275 #error "Define FEATURE_MAC_SECURITY or FEATURE_ALL_MODES in features.h to \
276 be able to use security at application level"
277 #endif
278 #endif
280 /* Set beacon order and superframe order to 15 for FH mode to avoid user error */
281 #if CONFIG_FH_ENABLE
282 #if (CONFIG_BEACON_ORDER != 15) && (CONFIG_SUPERFRAME_ORDER != 15)
283 #error "Do you want to build image with frequency hopping mode? \
284 If yes, CONFIG_BEACON_ORDER and CONFIG_SUPERFRAME_ORDER \
285 should both be set to 15"
286 #endif
287 #if (FH_NUM_NON_SLEEPY_NEIGHBORS < 2) || (FH_NUM_SLEEPY_NEIGHBORS < 2)
288 #error "You have an invalid value for FH neighbors. Set the values \
289 for FH_NUM_NON_SLEEPY_NEIGHBORS and FH_NUM_SLEEPY_NEIGHBORS to at least 2"
290 #endif
291 #endif
293 #ifdef __cplusplus
294 }
295 #endif
297 #endif /* CONFIG_H */