nRF5 SDK for Mesh v5.0.0
mesh_stack.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_STACK_H__
39 #define MESH_STACK_H__
40 
41 #include "nrf_mesh.h"
42 #include "config_server_events.h"
43 #include "health_server.h"
44 #include "nrf_mesh_prov_events.h"
45 
61 typedef void (*mesh_stack_models_init_cb_t)(void);
62 
70 typedef struct
71 {
76 
77  struct
78  {
89 
98 
110 
115 
123  } models;
124 
126 
146 uint32_t mesh_stack_init(const mesh_stack_init_params_t * p_init_params,
147  bool * p_device_provisioned);
148 
160 uint32_t mesh_stack_start(void);
161 
174 void mesh_stack_power_down(void);
175 
198  const uint8_t * p_devkey);
199 
205 void mesh_stack_config_clear(void);
206 
214 
223 void mesh_stack_device_reset(void);
224 
235 uint32_t mesh_stack_persistence_flash_usage(const uint32_t ** pp_start, uint32_t * p_length);
236 
245 health_server_t * mesh_stack_health_server_get(void);
246 
251 #endif /* MESH_STACK_H__ */
void mesh_stack_power_down(void)
Start the power down procedure.
void mesh_stack_config_clear(void)
Clear the saved configuration and network state of the mesh node.
uint32_t mesh_stack_start(void)
Start dynamic behavior on the mesh stack.
mesh_stack_models_init_cb_t models_init_cb
Pointer to a function used to allow initialization of application-specific models.
Definition: mesh_stack.h:122
uint8_t health_server_num_selftests
Number of self-tests provided by p_health_server_selftest_array.
Definition: mesh_stack.h:114
nrf_mesh_init_params_t core
Core initialization parameters structure.
Definition: mesh_stack.h:75
void(* mesh_stack_models_init_cb_t)(void)
Models initialization callback.
Definition: mesh_stack.h:61
config_server_evt_cb_t config_server_cb
Pointer to a function used to inform about events from the configuration server.
Definition: mesh_stack.h:88
uint32_t mesh_stack_init(const mesh_stack_init_params_t *p_init_params, bool *p_device_provisioned)
Initialize the mesh stack.
void(* config_server_evt_cb_t)(const config_server_evt_t *p_evt)
Config server event callback type.
health_server_attention_cb_t health_server_attention_cb
Attention callback function.
Definition: mesh_stack.h:97
void mesh_stack_device_reset(void)
Resets the device.
Initialization parameters structure.
Definition: nrf_mesh.h:431
Mesh stack configuration parameters.
Definition: mesh_stack.h:70
void(* health_server_attention_cb_t)(const health_server_t *p_server, bool attention_state)
Callback function for the attention state.
Definition: health_server.h:71
Provisioning data to transmit to a device.
uint32_t mesh_stack_persistence_flash_usage(const uint32_t **pp_start, uint32_t *p_length)
Gets which flash areas used by the mesh stack for storing persistent data.
uint32_t mesh_stack_provisioning_data_store(const nrf_mesh_prov_provisioning_data_t *p_prov_data, const uint8_t *p_devkey)
Store received provisioning data in flash.
const health_server_selftest_t * p_health_server_selftest_array
Self-test function array.
Definition: mesh_stack.h:109
health_server_t * mesh_stack_health_server_get(void)
Gets a pointer to the Health Server instance in the primary element.
Structure defining a self-test function.
Definition: health_server.h:92
bool mesh_stack_is_device_provisioned(void)
Check if the device has been provisioned.

Documentation feedback | Developer Zone | Subscribe | Updated