227 const std::string &image_base_path,
228 unsigned long int cache_size,
274 const std::string &uiid,
311 const size_t size_file);
329 const size_t offset);
365 const time_t apply_after);
383 const std::string ¤t_version);
401 const std::string &target_version);
uint32_t sl_status_t
Definition: sl_status.h:139
last_error_t
Structure used to indicate the last error status. Used by protocol controllers to report firmware dow...
Definition: ota.hpp:153
@ NOT_AUTHORIZED
no permission to download image
status_t
Structure used to indicate the firmware upload status. used in function ota::status_update.
Definition: ota.hpp:127
@ WAITING_TO_UPGRADE_VIA_EXTERNAL_EVENT
void update_target_version(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const std::string &target_version)
Target version update of firmware upgrade OTA MQTT for the image_listener component specific for a UI...
void subscribe_unid(const std::string &unid, const std::string &uiid)
Listen for images that match the UNID + UIID pair/ when changes to this key is detected,...
void unretain_ota_status()
Clean up MQTT status for UNIDs and endpoints.
void unsubscribe_all_unids_uiid(const std::string &unid)
Stop watching all images for unid and unretain MQTT messages.
void clear_cache()
Utility function to clear the internal cache.
image_ready_result_t
Result enum that describes if an image is ready for the caller to be used to donwload its clients.
Definition: ota.hpp:170
@ ERROR
mqtt client error. the mqtt transport could not get images
void update_apply_after(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const time_t apply_after)
Apply after update of firmware upgrade OTA MQTT for the image_listener component specific for a UIID,...
void update_current_version(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const std::string ¤t_version)
Current version update of firmware upgrade OTA MQTT for the image_listener component specific for a U...
sl_status_t init(const image_available_func_t &image_available_cb, const std::string &image_base_path, unsigned long int cache_size, uint32_t timeout_s, uint16_t cluster_revision=DEFAULT_CLUSTER_REVISION)
initialize ota_listener
void update_offset(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const size_t offset)
Offset update of firmware upgrade OTA MQTT for the image_listener component specific for a UIID,...
void update_status(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const status_t status)
Status update of firmware upgrade OTA MQTT for the image_listener component specific for a UIID,...
void update_size(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const size_t size_file)
Size file of firmware upgrade OTA MQTT for the image_listener component specific for a UIID,...
void update_last_error(const dotdot_unid_t &unid, const dotdot_endpoint_id_t &endpoint, const ota_uiid_t &uiid, const last_error_t last_error)
Last error update of firmware upgrade OTA MQTT for the image_listener component specific for a UIID,...
std::function< void(const image_ready_result_t, const std::string &)> image_ready_funct_t
this callback is returned when the actually firmware image is downloaded and stored to disk,...
Definition: ota.hpp:209
void unsubscribe_unid(const std::string &unid, const std::string &uiid)
Stop watching specific images.
std::function< void(const meta_t &)> image_available_func_t
Callback function that is triggered when an new firmware image is detected on the image provider.
Definition: ota.hpp:201
void unretain_ota_status_by_unid(const dotdot_unid_t &unid)
Clean up MQTT status for a UNID and related endpoints.
void get_by_unid(const std::string &unid, const std::string &uiid, const image_ready_funct_t &get_ready_cb)
After an image_available call is triggered.
constexpr uint16_t DEFAULT_CLUSTER_REVISION
Definition: ota.hpp:25
Generic type definitions for Unify.
const char * ota_uiid_t
Definition: uic_typedefs.h:40
uint8_t dotdot_endpoint_id_t
Definition: uic_typedefs.h:38
const char * dotdot_unid_t
Definition: uic_typedefs.h:39