Zigbee Protocol Controller 1.6.0
ota_download Namespace Reference

Functions

void set_image_cache_size (unsigned long int cache_size)
 Set the image cache size for download. More...
 
void set_image_base_path (const std::string &image_base_path)
 Set the image base path where image files are saved. More...
 
void set_image_available_callback (const uic_ota::image_available_func_t &image_available_cb)
 Set the callback called for available images. More...
 
bool available_info_callback_initialized ()
 Check if available info callback is initialized. More...
 
void info_callback (const char *topic, const char *message, const size_t message_length)
 Callback function to be called when revceiving image files information on info topic. More...
 
void get (const std::string &image_key, const std::string &subscribe_topic, const std::string &publish_topic, const uic_ota::image_ready_funct_t &image_ready_cb, uint32_t timeout_s)
 Function for downloading images. More...
 

Function Documentation

◆ available_info_callback_initialized()

bool ota_download::available_info_callback_initialized ( )

Check if available info callback is initialized.

Returns
boolean if available info callback is not a nullptr.

◆ get()

void ota_download::get ( const std::string &  image_key,
const std::string &  subscribe_topic,
const std::string &  publish_topic,
const uic_ota::image_ready_funct_t image_ready_cb,
uint32_t  timeout_s 
)

Function for downloading images.

Parameters
image_keyunique image key for downloading for this image.
subscribe_topicthe data topic to subscribe to where image file is received.
publish_topictopic to publish to telling image provider to provide image file.
image_ready_cbcallback for when image is ready for over the air transfer.
timeout_sTimeout in seconds

◆ info_callback()

void ota_download::info_callback ( const char *  topic,
const char *  message,
const size_t  message_length 
)

Callback function to be called when revceiving image files information on info topic.

Parameters
topicinfo MQTT topic.
messageimage file contents transferred.
message_lengthsize of image file.

◆ set_image_available_callback()

void ota_download::set_image_available_callback ( const uic_ota::image_available_func_t image_available_cb)

Set the callback called for available images.

Parameters
image_available_cbcallback which is called when an image is available.

◆ set_image_base_path()

void ota_download::set_image_base_path ( const std::string &  image_base_path)

Set the image base path where image files are saved.

Parameters
image_base_pathpath to directory where images should be saved.

◆ set_image_cache_size()

void ota_download::set_image_cache_size ( unsigned long int  cache_size)

Set the image cache size for download.

Parameters
cache_sizethe cache size input. Maximum is 256 Mb.