nRF5 SDK for Mesh v5.0.0
nrf_mesh_dfu.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 NRF_MESH_DFU_H__
38 #define NRF_MESH_DFU_H__
39 
40 #include <stdint.h>
41 #include <stdbool.h>
42 #include "nrf_mesh_config_core.h"
43 #include "nrf_mesh_config_dfu.h"
44 #include "nrf_mesh.h"
45 #include "nrf_mesh_dfu_types.h"
46 #include "dfu_types_internal.h"
47 #include "bl_if.h"
48 
63 #define NRF_MESH_DFU_AUTH_LEVEL_MIN (1)
64 
65 #define NRF_MESH_DFU_AUTH_LEVEL_MAX (7)
66 
79 typedef enum
80 {
99 uint32_t nrf_mesh_dfu_init(void);
100 
111 uint32_t nrf_mesh_dfu_enable(void);
112 
121 uint32_t nrf_mesh_dfu_jump_to_bootloader(void);
122 
135 uint32_t nrf_mesh_dfu_rx(const uint8_t * p_packet,
136  uint32_t length,
137  const nrf_mesh_rx_metadata_t * p_metadata);
138 
169  const nrf_mesh_fwid_t* p_fwid,
170  const uint32_t* p_bank_addr);
171 
197  const nrf_mesh_fwid_t* p_fwid);
198 
208 uint32_t nrf_mesh_dfu_abort(void);
209 
225 
239 uint32_t nrf_mesh_dfu_bank_flash(nrf_mesh_dfu_type_t bank_type);
240 
253 uint32_t nrf_mesh_dfu_state_get(nrf_mesh_dfu_transfer_state_t* p_dfu_transfer_state);
254 
257 #endif /* NRF_MESH_DFU_H__ */
uint32_t nrf_mesh_dfu_init(void)
Initialize the DFU module.
uint32_t nrf_mesh_dfu_bank_info_get(nrf_mesh_dfu_type_t type, nrf_mesh_dfu_bank_info_t *p_bank_info)
Get info on the bank of the given type.
RX packet metadata.
Definition: nrf_mesh.h:161
uint32_t nrf_mesh_dfu_enable(void)
Enable the DFU module in the Bootloader.
#define NRF_MESH_DFU_AUTH_LEVEL_MIN
Lowest authentication level available for DFU requests.
Definition: nrf_mesh_dfu.h:63
nrf_mesh_dfu_source_authority_t
Guiding authority values for sourcing a transfer.
Definition: nrf_mesh_dfu.h:79
uint32_t nrf_mesh_dfu_abort(void)
Abort the ongoing DFU operation.
Authority level for gateway-type nodes, which are able to provide the DFU directly from the external ...
Definition: nrf_mesh_dfu.h:89
uint32_t nrf_mesh_dfu_jump_to_bootloader(void)
Manually trigger the bootloader.
uint32_t nrf_mesh_dfu_state_get(nrf_mesh_dfu_transfer_state_t *p_dfu_transfer_state)
Get the current state of the DFU module.
Current state of a transfer.
uint32_t nrf_mesh_dfu_bank_flash(nrf_mesh_dfu_type_t bank_type)
Flash the bank of the given type.
uint32_t nrf_mesh_dfu_relay(nrf_mesh_dfu_type_t type, const nrf_mesh_fwid_t *p_fwid)
Relay an ongoing transfer.
uint32_t nrf_mesh_dfu_rx(const uint8_t *p_packet, uint32_t length, const nrf_mesh_rx_metadata_t *p_metadata)
Pass a DFU packet to the DFU module.
uint32_t nrf_mesh_dfu_request(nrf_mesh_dfu_type_t type, const nrf_mesh_fwid_t *p_fwid, const uint32_t *p_bank_addr)
Request a DFU transfer.
Authority level for nodes which are participating in the network, and have plenty of capacity to spar...
Definition: nrf_mesh_dfu.h:86
#define NRF_MESH_DFU_AUTH_LEVEL_MAX
Highest authentication level available for DFU requests.
Definition: nrf_mesh_dfu.h:65
ID of a standalone firmware segment.
DFU Bank info structure.
Lowest authority level, for nodes that should only be chosen if no other option is available...
Definition: nrf_mesh_dfu.h:83
nrf_mesh_dfu_type_t
DFU transfer types.

Documentation feedback | Developer Zone | Subscribe | Updated