OTA API

Zigbee OTA Upgrade Cluster related APIs for ESP Zigbee SDK.

API Reference

Header File

Functions

esp_err_t esp_zb_ota_upgrade_server_notify_req(esp_zb_ota_upgrade_server_notify_req_t *req)

Notify the image upgrade event of OTA upgrade server.

Parameters

req[in] The OTA file information request esp_zb_ota_upgrade_server_notify_req_s

Returns

  • ESP_OK: On success

  • ESP_ERR_NOT_FOUND: Not found the variable table in the OTA server side

  • ESP_ERR_INVALID_ARG: The input arguments are incorrect or invalid.

Structures

struct esp_zb_ota_zcl_information_s

The basic zcl information for OTA command.

Public Members

esp_zb_zcl_addr_t src_addr

The source address

uint16_t dst_short_addr

The destination short address

uint8_t src_endpoint

The source endpoint identifier

uint8_t dst_endpoint

The destination endpoint identifier

uint16_t cluster_id

The cluster identifier

uint16_t profile_id

The profile identifier

uint8_t command_id

The command identifier

uint16_t manufacturer_specific

The manufacturer specific data

struct esp_zb_ota_file_header_s

The Zigbee ZCL OTA file header struct.

Public Members

uint16_t manufacturer_code

OTA header manufacturer code

uint16_t image_type

Image type value to distinguish the products

uint32_t file_version

File version represents the release and build number of the image’s application and stack

uint32_t image_size

Total image size in bytes transferred from the server to the client

struct esp_zb_zcl_ota_upgrade_client_variable_s

The Zigbee ZCL OTA upgrade client variable configuration struct.

Public Members

uint16_t timer_query

The field indicates the time of querying OTA imagge for OTA upgrade client

uint16_t hw_version

The hardware version

uint8_t max_data_size

The maxinum size of OTA data

struct esp_zb_zcl_ota_upgrade_server_variable_s

The Zigbee ZCL OTA upgrade server variable configuration struct.

Public Members

uint8_t query_jitter

Query jitter

uint32_t current_time

Current time of OTA server

uint8_t file_count

The field specifies the maximum number of OTA files for the OTA upgrade server variable.

struct esp_zb_ota_upgrade_server_notify_req_s

The Zigbee ZCL OTA upgrade server notification request struct.

Public Members

uint8_t endpoint

The endpoint identifier for ota server cluster

uint8_t index

The index of OTA file

uint8_t notify_on

The field indicates whether send the notification request directly

uint32_t ota_upgrade_time

The time indicates the interval for the OTA file upgrade after the OTA process is completed

esp_zb_ota_file_header_t ota_file_header

The header is used to register the basic OTA upgrade information

esp_zb_ota_next_data_callback_t next_data_cb

The callback is used to retrieve the next OTA data, which will be transmitted to the OTA client side

Type Definitions

typedef struct esp_zb_ota_zcl_information_s esp_zb_ota_zcl_information_t

The basic zcl information for OTA command.

typedef struct esp_zb_ota_file_header_s esp_zb_ota_file_header_t

The Zigbee ZCL OTA file header struct.

typedef esp_err_t (*esp_zb_ota_next_data_callback_t)(esp_zb_ota_zcl_information_t message, uint16_t index, uint8_t size, uint8_t **data)

A callback for the OTA Server to retrieve the next OTA data.

Param message

[in] The message will provide the basic OTA cluster information, esp_zb_ota_zcl_information_s

Param index

[in] The index of the OTA file

Param size

[in] The size indicates how many bytes the user needs to allocate for the data

Param data

[out] The next OTA data that will be transmit to OTA Client by the OTA Server

typedef struct esp_zb_zcl_ota_upgrade_client_variable_s esp_zb_zcl_ota_upgrade_client_variable_t

The Zigbee ZCL OTA upgrade client variable configuration struct.

typedef struct esp_zb_zcl_ota_upgrade_server_variable_s esp_zb_zcl_ota_upgrade_server_variable_t

The Zigbee ZCL OTA upgrade server variable configuration struct.

typedef struct esp_zb_ota_upgrade_server_notify_req_s esp_zb_ota_upgrade_server_notify_req_t

The Zigbee ZCL OTA upgrade server notification request struct.