Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to reject buttonless DFU attempt ?

Hi,

Is there a way to reject a buttonless DFU attempt (nRF52832, SDK14.2) ?

I want my application to allow DFU only when certain conditions are met.

I thought using case BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE: in ble_dfu_evt_handler().

However, since it does not return any value (void) I don't see a way to 'abort' the DFU attempt (without messing with the DFU service implementation).

Any thoughts?

Thanks

  • Hei eyalasko, 

    Yes, the ble_dfu_evt_handler is only used to notify the application which state the DFU Service module is in, there's no events that needs to be confirmed etc. So I am afraid that you will have to modify the DFU service implementation to do this. 

    You should be able to check if the conditions are met when the DFU_OP_ENTER_BOOTLOADER opcode is written to the Buttonless DFU Control point, see ble_dfu_buttonless_on_ctrl_pt_write() in ble_dfu_unbonded.c or ble_dfu_bonded.c if you support bonds. 

    Best regards

    Bjørn

Related