-
Notifications
You must be signed in to change notification settings - Fork 116
Description
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.