We have some devices out in the field with a mixture of application versions. In one particular case, we have device A on application version 10 and we have device B on application version 20. Both devices are near each other so once device A sees device B's FWID packet, it requests a DFU by sending out a DFU Ready packet with application version 20. However, we have a host that's capable of issuing mesh DFUs and it's trying to update device A to application version 15.
I was looking through the nRF5 Mesh Bootloader to see if it would work and I noticed it does some checks in the handle_state_packet() function that would prevent device A from accepting the DFU with application version 15, while it's requesting application version 20. In the code below, it looks like the ready_packet_matches_our_req() function, which is called in handle_state_packet(), checks to see if the incoming packet's version is equal to or higher than the version in its current request.
bool ready_packet_matches_our_req(dfu_packet_t* p_packet, dfu_type_t dfu_type_req, fwid_union_t* p_fwid_req) { if (dfu_type_req != p_packet->payload.state.dfu_type && dfu_type_req != DFU_TYPE_NONE) { return false; } if (tid_cache_has_entry(p_packet->payload.state.transaction_id)) { return false; } return (fwid_union_id_cmp(&p_packet->payload.state.fwid, p_fwid_req, dfu_type_req) && (fwid_union_version_cmp(&p_packet->payload.state.fwid, p_fwid_req, dfu_type_req) >= 0)); }
Is this the intended behavior? Or is the device expected to accept a DFU with a version lower than what it's asking for (but still higher than its current version)?
For your reference, I'm using the mesh bootloader from nRF Mesh v3.1.0.