dfu: add error callback

Add error callback in dfu stack to manage some board specific
behavior on DFU targets.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
This commit is contained in:
Patrick Delaunay
2021-05-18 15:12:12 +02:00
committed by Patrice Chotard
parent d4cb402577
commit d4710326c8
2 changed files with 23 additions and 0 deletions

View File

@@ -377,6 +377,17 @@ void dfu_initiated_callback(struct dfu_entity *dfu);
*/
void dfu_flush_callback(struct dfu_entity *dfu);
/**
* dfu_error_callback() - weak callback called at the DFU write error
*
* It is a callback function called by DFU stack after DFU write error.
* This function allows to manage some board specific behavior on DFU targets
*
* @dfu: pointer to the dfu_entity which cause the error
* @msg: the message of the error
*/
void dfu_error_callback(struct dfu_entity *dfu, const char *msg);
int dfu_transaction_initiate(struct dfu_entity *dfu, bool read);
void dfu_transaction_cleanup(struct dfu_entity *dfu);