nRF5 SDK for Mesh v5.0.0
nrf_mesh_dfu_types.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 NRF_MESH_DFU_TYPES_H__
39 #define NRF_MESH_DFU_TYPES_H__
40 
41 #include <stdint.h>
42 #include <stdbool.h>
43 #include "nrf_mesh_assert.h"
44 
52 #define NRF_MESH_DFU_PUBLIC_KEY_LEN (64)
53 
54 #define NRF_MESH_DFU_SIGNATURE_LEN (64)
55 
56 #define NRF_MESH_DFU_SEGMENT_LENGTH (16)
57 
67 /*lint -align_max(push) -align_max(1) */
68 
70 typedef struct __attribute((packed))
71 {
73  uint8_t bl_id;
75  uint8_t bl_version;
77 
81 typedef struct __attribute((packed))
82 {
84  uint32_t company_id;
86  uint16_t app_id;
88  uint32_t app_version;
90 
92 typedef union __attribute((packed))
93 {
96  uint16_t softdevice;
98 
99 /*lint -align_max(pop) */
100 
102 typedef enum
103 {
114 
116  NRF_MESH_DFU_TYPE__LAST = NRF_MESH_DFU_TYPE_BL_INFO,
118 
120 typedef enum
121 {
134  NRF_MESH_DFU_STATE__LAST = NRF_MESH_DFU_STATE_RELAY,
136 
138 typedef enum
139 {
156  NRF_MESH_DFU_END_ERROR__LAST = NRF_MESH_DFU_END_ERROR_BANK_IN_BOOTLOADER_AREA,
158 
160 typedef enum
161 {
168  NRF_MESH_DFU_ROLE__LAST = NRF_MESH_DFU_ROLE_SOURCE,
170 
172 typedef struct
173 {
175  nrf_mesh_dfu_type_t dfu_type;
179 
181 typedef struct
182 {
183  nrf_mesh_dfu_type_t dfu_type;
185  bool is_signed;
186  uint32_t* p_start_addr;
187  uint32_t length;
189 
191 typedef struct
192 {
193  nrf_mesh_dfu_role_t role;
194  nrf_mesh_dfu_type_t type;
196  nrf_mesh_dfu_state_t state;
197  uint8_t data_progress;
199 
203 #endif /* NRF_MESH_DFU_TYPES_H__ */
DFU transfer information structure.
The DFU module has not been initialized.
The given bank address results in bootloader invalidation.
Too many packets were lost in the transfer.
nrf_mesh_fwid_t fwid
Firmware ID of the bank.
Not enough memory to handle transfer.
uint32_t * p_start_addr
Start address of the bank.
The signature check failed.
uint8_t data_progress
The progress of the transfer in percent (0-100).
There&#39;s no DFU operation in progress.
nrf_mesh_dfu_role_t
The various roles a device can play in a dfu transfer.
nrf_mesh_app_id_t application
Application ID.
nrf_mesh_dfu_end_t
Reasons for a DFU operation to end.
Beaconing intent to relay a transfer.
Timed out waiting for packets.
Application ID structure.
Passively relaying a transfer.
nrf_mesh_dfu_type_t dfu_type
DFU type of the bank.
Waiting for metadata about validated transfer to be written.
nrf_mesh_fwid_t id
Firmware target of transfer.
nrf_mesh_bootloader_id_t bootloader
Bootloader ID.
When copying the finished bank to its intended destination, it will have to overwrite itself...
The application requested to abort the transfer.
Current state of a transfer.
nrf_mesh_fwid_t fwid
The FWID of the new data in the transfer.
nrf_mesh_dfu_role_t role
This device&#39;s intended role in the transfer.
uint32_t app_version
Application version.
Receiving a transfer.
The DFU module has been initialized, but not started.
The transfer ended successfully.
nrf_mesh_dfu_type_t dfu_type
Type of transfer.
nrf_mesh_dfu_type_t type
The DFU type of the transfer.
The transfer does not meet its requirements.
Ready to receive a transfer.
bool is_signed
Flag indicating whether the bank is signed with an encryption key.
uint32_t company_id
Company ID.
nrf_mesh_dfu_state_t state
The current global state of the transfer.
Bootloader info transfer.
nrf_mesh_dfu_state_t
States of the DFU module.
Invalid transfer type.
uint8_t bl_version
Bootloader version number.
uint8_t bl_id
Bootloader identificator.
Failed to receive the start packet.
uint32_t length
Length of the firmware in the bank.
Bootloader ID structure.
uint16_t softdevice
Softdevice revision number.
ID of a standalone firmware segment.
DFU Bank info structure.
Device page contained invalid or corrupted data.
The transfer fell outside its designated flash section.
uint16_t app_id
Application ID.
Beaconing requests for transfers.
nrf_mesh_dfu_type_t
DFU transfer types.
Validating and finishing up a transfer.
The FWID was valid, and the bootloader stopped operation.

Documentation feedback | Developer Zone | Subscribe | Updated