nRF5 SDK for Mesh v5.0.0
example_common.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 #ifndef EXAMPLE_COMMON_H__
38 #define EXAMPLE_COMMON_H__
39 
40 #include "sdk_config.h"
41 #include "uri.h"
42 
43 #define RTT_INPUT_POLL_PERIOD_MS (100)
44 
45 #define LED_BLINK_INTERVAL_MS (200)
46 #define LED_BLINK_SHORT_INTERVAL_MS (50)
47 #define LED_BLINK_CNT_START (2)
48 #define LED_BLINK_CNT_RESET (3)
49 #define LED_BLINK_CNT_PROV (4)
50 #define LED_BLINK_CNT_NO_REPLY (6)
51 #define LED_BLINK_CNT_ERROR (6)
52 
53 /* An interval larger than half a second might not show LED blinking effect. */
54 #define LED_BLINK_ATTENTION_INTERVAL_MS (50)
55 #define LED_BLINK_ATTENTION_COUNT(s) (((s) * 500) / LED_BLINK_ATTENTION_INTERVAL_MS)
56 
60 #if defined(S110)
61  #define DEV_BOARD_LF_CLK_CFG NRF_CLOCK_LFCLKSRC_XTAL_20_PPM
62 #elif NRF_SD_BLE_API_VERSION >= 5
63  #define DEV_BOARD_LF_CLK_CFG { \
64  .source = NRF_SDH_CLOCK_LF_SRC, \
65  .rc_ctiv = NRF_SDH_CLOCK_LF_RC_CTIV, \
66  .rc_temp_ctiv = NRF_SDH_CLOCK_LF_RC_TEMP_CTIV, \
67  .accuracy = NRF_SDH_CLOCK_LF_ACCURACY \
68  }
69 #else
70  #define DEV_BOARD_LF_CLK_CFG { \
71  .source = NRF_CLOCK_LF_SRC_XTAL, \
72  .rc_ctiv = 0, \
73  .rc_temp_ctiv = 0, \
74  .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM \
75  }
76 #endif
77 
84 #define EX_URI_BEACON URI_SCHEME_EXAMPLE "URI for Beacon example"
85 #define EX_URI_DFU URI_SCHEME_EXAMPLE "URI for DFU example"
86 #define EX_URI_ENOCEAN URI_SCHEME_EXAMPLE "URI for Enocean example"
87 #define EX_URI_DM_CLIENT URI_SCHEME_EXAMPLE "URI for Dimming Client example"
88 #define EX_URI_DM_SERVER URI_SCHEME_EXAMPLE "URI for Dimming Server example"
89 #define EX_URI_LPN URI_SCHEME_EXAMPLE "URI for LPN example"
90 #define EX_URI_LS_CLIENT URI_SCHEME_EXAMPLE "URI for LS Client example"
91 #define EX_URI_LS_SERVER URI_SCHEME_EXAMPLE "URI for LS Server example"
92 #define EX_URI_LL_CLIENT URI_SCHEME_EXAMPLE "URI for Light Lightness Client example"
93 #define EX_URI_LL_SERVER URI_SCHEME_EXAMPLE "URI for Light Lightness Setup Server example"
94 #define EX_URI_LC_SERVER URI_SCHEME_EXAMPLE "URI for Light LC Setup Server example"
95 #define EX_URI_CTL_CLIENT URI_SCHEME_EXAMPLE "URI for Light CTL Client example"
96 #define EX_URI_CTL_SERVER URI_SCHEME_EXAMPLE "URI for Light CTL Setup Server example"
97 #define EX_URI_CTL_LC_SERVER URI_SCHEME_EXAMPLE "URI for Light CTL+LC Setup Servers example"
98 #define EX_URI_PBR_CLIENT URI_SCHEME_EXAMPLE "URI for PB Remote Client example"
99 #define EX_URI_PBR_SERVER URI_SCHEME_EXAMPLE "URI for PB Remote Server example"
100 #define EX_URI_SERIAL URI_SCHEME_EXAMPLE "URI for Serial example"
101 #define EX_URI_SENSOR_SERVER URI_SCHEME_EXAMPLE "URI for Sensor Server example"
102 #define EX_URI_SENSOR_CLIENT URI_SCHEME_EXAMPLE "URI for Sensor Client example"
103 #define EX_URI_SCENE_CLIENT URI_SCHEME_EXAMPLE "URI for Scene Client example"
104 
106 #define STATIC_AUTH_DATA {0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x5F, 0x65, 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x5F, 0x31}
107 
109 #define STATIC_AUTH_DATA_PB_REMOTE {0xc7, 0xf7, 0x9b, 0xec, 0x9c, 0xf9, 0x74, 0xdd, 0xb9, 0x62, 0xbd, 0x9f, 0xd1, 0x72, 0xdd, 0x73}
110 
111 #endif /* EXAMPLE_COMMON_H__ */

Documentation feedback | Developer Zone | Subscribe | Updated