We have not discussed this yet with @Karel. Mainly because internally we use debuggers to upload firmware. I’ve created that API jump to DFU, but there are some security concerns. It is not safe to have plain MQTT message which would stop the device working at the customer location. This secure functionality has to be also implemented in gateway service.
The best solution would be that the
bcfutility in case you are flashing with --dfu sends message to gateway service by MQTT or by some other out-of-band mechanism. Then the gateway sends DFU switch command over USB and device boots to DFU. In any case there has to be alway implemented the
bc_dfu_jump() instruction in the previous and the actually flashed firmware. If update fails or the firmware is unstable then you would need to start DFU mode by pressing the buttons.
For debugging purporses you can implement it simply by registering new topic in the
subscribes array in https://github.com/bigclownlabs/bcf-usb-gateway/blob/master/app/application.c#L64 and creating a callback with DFU jump function.
If you have better ideas how to implement this functionality we can discuss it and implement in default firmwares.