Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
tr_over_the_air_bootloading_client.h File Reference

ZCL Over the Air Bootloading cluster client implementation. More...

#include "tr_af.h"
Include dependency graph for tr_over_the_air_bootloading_client.h:

Go to the source code of this file.

Data Structures

union  tr_over_the_air_bootloading_query_next_image_request_field_control_t
union  tr_over_the_air_bootloading_image_block_request_field_control_t
struct  tr_over_the_air_bootloading_server_info_t
struct  tr_over_the_air_bootloading_client_info_t

Macros

#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES   5
#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_TIMER_INTERVAL   (60L * ZB_TIME_ONE_SECOND * TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES)
#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_INCLUDE_HW_VERSION   0
#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_MAX_DATA_SIZE   64
#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_IMAGE_BLOCK_REQUEST_INCLUDE_IEEE_ADDRESS   0
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MAX_ZCL_RETRIES   3
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_QUERY_JITTER_MAX_VALUE   100
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_RESEND_DELAY   (ZB_TIME_ONE_SECOND * 15)
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_OFFSET_DEF_VALUE   0xFFFFFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_CURRENT_FILE_VERSION_DEF_VALUE   0xFFFFFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_DOWNLOADED_FILE_VERSION_DEF_VALUE   0xFFFFFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_ID_DEF_VALUE   0xFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_DEF_VALUE   0xFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_HW_VERSION_DEF_VALUE   0
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_UPGRADE_TIME_DEF_VALUE   0xFFFFFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_CODE_WILDCARD_VALUE   0xFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_WILDCARD_VALUE   0xFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_VERSION_WILDCARD_VALUE   0xFFFFFFFF
#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_TAG_HEADER_LENGTH   (sizeof(tr_zcl_over_the_air_bootloading_sub_element_t) - 1)
#define tr_over_the_air_bootloading_client_printf(...)
#define tr_over_the_air_bootloading_client_println(...)

Typedefs

struct { 
   zb_uint8_t   status 
   zb_uint32_t   current_time 
   zb_uint32_t   request_time 
   zb_uint16_t   minimum_block_period 
tr_over_the_air_bootloading_image_block_response_wait_for_data_cmd_t
struct { 
   zb_uint32_t   file_id 
   zb_uint16_t   header_version 
   zb_uint16_t   header_length 
   zb_uint16_t   fc 
   zb_uint16_t   manufacturer_code 
   zb_uint16_t   image_type 
   zb_uint32_t   file_version 
   zb_uint16_t   stack_version 
   zb_char_t   header_string [32] 
   zb_uint32_t   total_image_size 
tr_zcl_over_the_air_bootloading_file_header_t
struct { 
   zb_uint16_t   tag_id 
   zb_uint32_t   length 
   zb_uint8_t   value [1] 
tr_zcl_over_the_air_bootloading_sub_element_t

Enumerations

enum  tr_over_the_air_bootloading_client_image_notify_payload_type_t {
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER = 0x00 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE = 0x01 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE_IMAGE = 0x02 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE_IMAGE_VER = 0x03
}
enum  tr_over_the_air_bootloading_client_status_t {
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_NORMAL = 0x00 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_DOWNLOADING = 0x01 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_DOWNLOADED = 0x02 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAITING_UPGRADE = 0x03 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_COUNT_DOWN = 0x04 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAIT_FOR_MORE = 0x05 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAIT_TO_UPGRADE_VIA_EXT_EVENT = 0x06 ,
  TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_UNKNOWN = 0xFF
}
enum  tr_zcl_ota_upgrade_sub_element_tag {
  TR_ZCL_OTA_UPGRADE_FILE_TAG_UPGRADE_IMAGE = 0x0000 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA = 0x0001 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_CERT = 0x0002 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_IMAGE_INTEGRITY_CODE = 0x0003 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_PICTURE_DATA = 0x0004 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_V_2 = 0x0005 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_CERT_V_2 = 0x0006 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_MANUF_MIN = 0xf000 ,
  TR_ZCL_OTA_UPGRADE_FILE_TAG_MANUF_MAX = 0xffff
}

Functions

void tr_over_the_air_bootloading_client_init_cb (zb_uint8_t endpoint)
 Callback fires when the Over the Air Bootloading client cluster plugin is initialized.
zb_bool_t tr_over_the_air_bootloading_client_command_received_cb (zb_zcl_parsed_hdr_t *cmd_info)
 Callback that user can declare to handle any Over the Air Bootloading client commands.
void tr_over_the_air_bootloading_client_write_attr_cb (zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code)
 Callback fires when an Over the Air Bootloading client attribute is about to be written.
zb_bool_t tr_over_the_air_bootloading_client_image_notify_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t payload_type, zb_uint8_t query_jitter, zb_uint16_t manufacturer_id, zb_uint16_t image_type, zb_uint32_t new_file_version)
 Callback that user can declare to handle over the air bootloading cluster image notify command.
zb_bool_t tr_over_the_air_bootloading_client_query_next_image_response_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t status, zb_uint16_t manufacturer_id, zb_uint16_t image_type, zb_uint32_t file_version, zb_uint32_t image_size)
 Callback that user can declare to handle over the air bootloading cluster query next image response command.
zb_bool_t tr_over_the_air_bootloading_client_image_block_response_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t status, zb_uint16_t manufacturer_id, zb_uint16_t image_type, zb_uint32_t file_version, zb_uint32_t file_offset, zb_uint8_t data_size, zb_uint8_t *image_data)
 Callback that user can declare to handle over the air bootloading cluster image block response command.
zb_bool_t tr_over_the_air_bootloading_client_upgrade_end_response_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t manufacturer_id, zb_uint16_t image_type, zb_uint32_t file_version, zb_uint32_t current_time, zb_uint32_t upgrade_time)
 Callback that user can declare to handle over the air bootloading cluster upgrade end response command.
zb_bool_t tr_over_the_air_bootloading_client_query_specific_file_response_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t status, zb_uint16_t manufacturer_id, zb_uint16_t image_type, zb_uint32_t file_version, zb_uint32_t image_size)
 Callback that user can declare to handle over the air bootloading cluster query specific file response command.
void tr_over_the_air_bootloading_client_version_cb (zb_uint8_t endpoint, zb_uint32_t *fw_version, zb_uint16_t *mfg_id, zb_uint16_t *image_type, zb_uint16_t *hw_version)
 Callback that user can declare to override image upgrade parameters.
void tr_over_the_air_bootloading_client_upgrade_start_cb (zb_uint32_t image_version, zb_uint32_t image_size, zb_uint32_t starting_offset)
 Callback fires to notify the application that an OTA download is about to start.
void tr_over_the_air_bootloading_client_mfg_tag_found_cb (tr_zcl_over_the_air_bootloading_sub_element_t *tag_header)
 Callback fires when a file is fully downloaded and verified, and has manufacturer specific tags.
zb_bool_t tr_over_the_air_bootloading_client_check_for_zigbee_upgrade_cb (zb_uint32_t downloaded_fw_version)
 Callback to allow the application to determine if the zigbee firmware needs to be upgraded.
void tr_over_the_air_bootloading_client_server_not_found_cb (void)
 Callback to notify the application that no ota upgrade server was found.
tr_over_the_air_bootloading_server_info_ttr_over_the_air_bootloading_client_get_server_info (void)
 API to get the OTA server info.
tr_over_the_air_bootloading_client_info_ttr_over_the_air_bootloading_client_get_client_info (void)
 API to get the OTA client info.
tr_zcl_over_the_air_bootloading_sub_element_ttr_over_the_air_bootloading_client_find_tag_header (zb_uint16_t tag_id)
 API to locate a specific tag header in the ota file that is in flash.
tr_zcl_over_the_air_bootloading_file_header_ttr_over_the_air_bootloading_client_get_ota_header (void)
 API to return a pointer to the downloaded OTA file header.
void tr_over_the_air_bootloading_client_stop (void)
 API to stop the OTA upgrade client.
void tr_over_the_air_bootloading_client_start (void)
 API to start the OTA upgrade client.
void tr_over_the_air_bootloading_client_connection_state_cb (tr_conn_state_e conn_state)
void tr_over_the_air_bootloading_client_init (void)

Detailed Description

ZCL Over the Air Bootloading cluster client implementation.


SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2025 Trident IoT, LLC https://www.tridentiot.com


Macro Definition Documentation

◆ TR_OVER_THE_AIR_BOOTLOADING_CLIENT_IMAGE_BLOCK_REQUEST_INCLUDE_IEEE_ADDRESS

#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_IMAGE_BLOCK_REQUEST_INCLUDE_IEEE_ADDRESS   0

◆ TR_OVER_THE_AIR_BOOTLOADING_CLIENT_MAX_DATA_SIZE

#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_MAX_DATA_SIZE   64

◆ tr_over_the_air_bootloading_client_printf

#define tr_over_the_air_bootloading_client_printf ( ...)

debug prints


◆ tr_over_the_air_bootloading_client_println

#define tr_over_the_air_bootloading_client_println ( ...)

◆ TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES

#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES   5

◆ TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_INCLUDE_HW_VERSION

#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_INCLUDE_HW_VERSION   0

◆ TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_TIMER_INTERVAL

#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_TIMER_INTERVAL   (60L * ZB_TIME_ONE_SECOND * TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES)

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CURRENT_FILE_VERSION_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_CURRENT_FILE_VERSION_DEF_VALUE   0xFFFFFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_DOWNLOADED_FILE_VERSION_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_DOWNLOADED_FILE_VERSION_DEF_VALUE   0xFFFFFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_OFFSET_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_OFFSET_DEF_VALUE   0xFFFFFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_VERSION_WILDCARD_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_VERSION_WILDCARD_VALUE   0xFFFFFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_HW_VERSION_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_HW_VERSION_DEF_VALUE   0

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_DEF_VALUE   0xFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_WILDCARD_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_WILDCARD_VALUE   0xFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_MAX_ZCL_RETRIES

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MAX_ZCL_RETRIES   3

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_CODE_WILDCARD_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_CODE_WILDCARD_VALUE   0xFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_ID_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_ID_DEF_VALUE   0xFFFF

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_QUERY_JITTER_MAX_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_QUERY_JITTER_MAX_VALUE   100

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_RESEND_DELAY

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_RESEND_DELAY   (ZB_TIME_ONE_SECOND * 15)

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_TAG_HEADER_LENGTH

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_TAG_HEADER_LENGTH   (sizeof(tr_zcl_over_the_air_bootloading_sub_element_t) - 1)

◆ TR_ZCL_OVER_THE_AIR_BOOTLOADING_UPGRADE_TIME_DEF_VALUE

#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_UPGRADE_TIME_DEF_VALUE   0xFFFFFFFF

Typedef Documentation

◆ [struct]

◆ [struct]

typedef ZB_PACKED_PRE struct { ... } tr_zcl_over_the_air_bootloading_file_header_t

◆ [struct]

typedef ZB_PACKED_PRE struct { ... } tr_zcl_over_the_air_bootloading_sub_element_t

Enumeration Type Documentation

◆ tr_over_the_air_bootloading_client_image_notify_payload_type_t

Enumerator
TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE_IMAGE 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE_IMAGE_VER 

◆ tr_over_the_air_bootloading_client_status_t

Enumerator
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_NORMAL 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_DOWNLOADING 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_DOWNLOADED 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAITING_UPGRADE 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_COUNT_DOWN 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAIT_FOR_MORE 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAIT_TO_UPGRADE_VIA_EXT_EVENT 
TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_UNKNOWN 

◆ tr_zcl_ota_upgrade_sub_element_tag

Enumerator
TR_ZCL_OTA_UPGRADE_FILE_TAG_UPGRADE_IMAGE 
TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA 
TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_CERT 
TR_ZCL_OTA_UPGRADE_FILE_TAG_IMAGE_INTEGRITY_CODE 
TR_ZCL_OTA_UPGRADE_FILE_TAG_PICTURE_DATA 
TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_V_2 
TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_CERT_V_2 
TR_ZCL_OTA_UPGRADE_FILE_TAG_MANUF_MIN 
TR_ZCL_OTA_UPGRADE_FILE_TAG_MANUF_MAX 

Function Documentation

◆ tr_over_the_air_bootloading_client_connection_state_cb()

void tr_over_the_air_bootloading_client_connection_state_cb ( tr_conn_state_e conn_state)

function prototypes consumed by framework


◆ tr_over_the_air_bootloading_client_init()

void tr_over_the_air_bootloading_client_init ( void )

Variable Documentation

◆ current_time

zb_uint32_t current_time

◆ fc

zb_uint16_t fc

◆ file_id

zb_uint32_t file_id

◆ file_version

zb_uint32_t file_version

◆ header_length

zb_uint16_t header_length

◆ header_string

zb_char_t header_string[32]

◆ header_version

zb_uint16_t header_version

◆ image_type

zb_uint16_t image_type

◆ length

zb_uint32_t length

◆ manufacturer_code

zb_uint16_t manufacturer_code

◆ minimum_block_period

zb_uint16_t minimum_block_period

◆ request_time

zb_uint32_t request_time

◆ stack_version

zb_uint16_t stack_version

◆ status

zb_uint8_t status

◆ tag_id

zb_uint16_t tag_id

◆ total_image_size

zb_uint32_t total_image_size

◆ value

zb_uint8_t value[1]