Skip to content

Feature Request: Add void *user_data Context to esp_delta_ota Callbacks (IEC-410) #604

@erwinschrodinger1

Description

@erwinschrodinger1

Description

In the upstream detools library, there is a void* context pointer that allows injecting user-defined data into the read_cb function like write_cb.
However, this functionality appears to have been removed during the abstraction layer implementation in the ESP Delta OTA component:
https://github.com/espressif/idf-extra-components/blob/86bd7d98a0f6678e51ed21bf7211be1d5f61691a/esp_delta_ota/include/esp_delta_ota.h#L24C1-L25C81

Use Case

I’m using an ESP device to update firmware on external MCUs.
To manage multiple update targets and custom file I/O operations, it’s necessary to pass context-specific data (e.g., file handles, device interfaces, metadata) into the read callbacks.
Without a user_data pointer, this becomes cumbersome and requires using global or static variables, which is not ideal in concurrent or multi-instance setups.

Suggested Improvement

Add a void *user_data field to esp_delta_ota_cfg_t and pass it to both read_cb as of write_cb callbacks—similar to how detools handles it.
This change would preserve backward compatibility while greatly improving flexibility and modularity.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions