My intention is to program Mesh DFU event callback in such a way that the device always takes the relay role, with an option of simultaneously being the target. However, I cannot make heads or tails of the Mesh DFU documentation.
"Integrating DFU process into the application (nRF5 SDK for Mesh v4.0.0)" document states:
Depending on the the parameters supplied in nrf_mesh_evt_dfu_t::fw_outdated, the application may decide to either:
- Receive new firmware if the version of the application in the supplied parameters is higher than the one installed.
- Relay the packets from other relay nodes or target.
If neither nrf_mesh_dfu_request nor nrf_mesh_dfu_relay is called as a result of a NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED (or NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH) event, the update is ignored.
I take the meaning of "the update is ignored" as that unless nrf_mesh_dfu_request or nrf_mesh_dfu_relay is called the device will completely ignore the DFU packets. The paragraph also says that only one of the two functions can be called (one making the device DFU target and the other DFU relay) in response to the "firmware outdated event". However, I'd like the device to always relay and optionally accept the update (which seems to be a reasonably common scenario).
Reading the API reference for nrf_mesh_dfu_relay function I find that "(It) Should only be used as a response to an NRF_MESH_EVT_DFU_REQ_RELAY." This seems to contradict directly "Integrating DFU process into the application" document cited above and the Mesh DFU example where the function is called in response to NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED or NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH events. Am I missing something here?
Browsing the DevZone I come across an answer stating "As long as the node has DFU support it will relay DFU packets". I read this as my node will always act as a relay regardless of whether nrf_mesh_dfu_request or nrf_mesh_dfu_relay is called in response to "firmware outdated event" (which seems to contradict "the update is ignored" statement above). Which is true?
In case "a node supporting DFU always relays" is true, what is the purpose of calling nrf_mesh_dfu_relay?
Thanks!