10#ifndef TR_OVER_THE_AIR_BOOTLOADING_CLIENT_H
11#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_H
15#ifndef TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES
16#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES 5
19#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_TIMER_INTERVAL (60L * ZB_TIME_ONE_SECOND * TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_DELAY_MINUTES)
22#ifndef TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_INCLUDE_HW_VERSION
23#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_QUERY_INCLUDE_HW_VERSION 0
26#ifndef TR_OVER_THE_AIR_BOOTLOADING_CLIENT_MAX_DATA_SIZE
27#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_MAX_DATA_SIZE 64
33#ifndef TR_OVER_THE_AIR_BOOTLOADING_CLIENT_IMAGE_BLOCK_REQUEST_INCLUDE_IEEE_ADDRESS
34#define TR_OVER_THE_AIR_BOOTLOADING_CLIENT_IMAGE_BLOCK_REQUEST_INCLUDE_IEEE_ADDRESS 0
38#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MAX_ZCL_RETRIES 3
41#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_QUERY_JITTER_MAX_VALUE 100
44#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_RESEND_DELAY (ZB_TIME_ONE_SECOND * 15)
47#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_OFFSET_DEF_VALUE 0xFFFFFFFF
48#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_CURRENT_FILE_VERSION_DEF_VALUE 0xFFFFFFFF
49#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_DOWNLOADED_FILE_VERSION_DEF_VALUE 0xFFFFFFFF
50#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_ID_DEF_VALUE 0xFFFF
51#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_DEF_VALUE 0xFFFF
52#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_HW_VERSION_DEF_VALUE 0
54#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_UPGRADE_TIME_DEF_VALUE 0xFFFFFFFF
57#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_MFG_CODE_WILDCARD_VALUE 0xFFFF
58#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_TYPE_WILDCARD_VALUE 0xFFFF
59#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_FILE_VERSION_WILDCARD_VALUE 0xFFFFFFFF
109typedef ZB_PACKED_PRE
struct
142typedef ZB_PACKED_PRE
struct
156typedef ZB_PACKED_PRE
struct
163#define TR_ZCL_OVER_THE_AIR_BOOTLOADING_TAG_HEADER_LENGTH (sizeof(tr_zcl_over_the_air_bootloading_sub_element_t) - 1)
181#if defined(TR_OVER_THE_AIR_BOOTLOADING_CLIENT_PLUGIN_PRINT_ENABLE) && (TR_OVER_THE_AIR_BOOTLOADING_CLIENT_PLUGIN_PRINT_ENABLE == 1)
182#define tr_over_the_air_bootloading_client_printf(...) tr_zcl_printf(__VA_ARGS__)
183#define tr_over_the_air_bootloading_client_println(...) tr_zcl_println(__VA_ARGS__)
185#define tr_over_the_air_bootloading_client_printf(...)
186#define tr_over_the_air_bootloading_client_println(...)
211 zb_uint8_t *new_value,
310 zb_uint32_t *fw_version,
313 zb_uint16_t *hw_version);
321 zb_uint32_t starting_offset);
zb_uint8_t query_jitter
Definition tr_zcl_cmd_structs.h:654
zb_uint32_t new_file_version
Definition tr_zcl_cmd_structs.h:657
zb_uint8_t * image_data
Definition tr_zcl_cmd_structs.h:679
zb_uint32_t file_offset
Definition tr_zcl_cmd_structs.h:612
zb_uint8_t payload_type
Definition tr_zcl_cmd_structs.h:653
zb_uint32_t image_size
Definition tr_zcl_cmd_structs.h:667
zb_uint16_t manufacturer_id
Definition tr_zcl_cmd_structs.h:599
zb_uint8_t data_size
Definition tr_zcl_cmd_structs.h:678
zb_uint32_t upgrade_time
Definition tr_zcl_cmd_structs.h:689
tr_over_the_air_bootloading_server_info_t * tr_over_the_air_bootloading_client_get_server_info(void)
API to get the OTA server info.
tr_zcl_over_the_air_bootloading_sub_element_t * tr_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.
void tr_over_the_air_bootloading_client_start(void)
API to start the OTA upgrade client.
tr_over_the_air_bootloading_client_info_t * tr_over_the_air_bootloading_client_get_client_info(void)
API to get the OTA client info.
tr_zcl_over_the_air_bootloading_file_header_t * tr_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.
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.
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.
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_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_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 comman...
void tr_over_the_air_bootloading_client_server_not_found_cb(void)
Callback to notify the application that no ota upgrade server was found.
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_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 respons...
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.
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 comman...
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.
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 c...
Definition tr_over_the_air_bootloading_client.h:128
zb_uint16_t mfg_id
Definition tr_over_the_air_bootloading_client.h:133
zb_uint32_t download_file_size
Definition tr_over_the_air_bootloading_client.h:130
zb_uint8_t endpoint
Definition tr_over_the_air_bootloading_client.h:136
zb_uint32_t offset_at_last_attr_save
Definition tr_over_the_air_bootloading_client.h:131
zb_uint16_t saved_min_block_period
Definition tr_over_the_air_bootloading_client.h:135
zb_uint8_t end_req_retries
Definition tr_over_the_air_bootloading_client.h:138
zb_uint8_t end_req_status
Definition tr_over_the_air_bootloading_client.h:139
zb_uint8_t block_req_retries
Definition tr_over_the_air_bootloading_client.h:137
zb_uint16_t image_type
Definition tr_over_the_air_bootloading_client.h:132
zb_uint16_t hw_version
Definition tr_over_the_air_bootloading_client.h:134
zb_uint32_t fw_version
Definition tr_over_the_air_bootloading_client.h:129
Definition tr_over_the_air_bootloading_client.h:119
zb_uint32_t image_size
Definition tr_over_the_air_bootloading_client.h:120
zb_uint8_t endpoint
Definition tr_over_the_air_bootloading_client.h:123
zb_uint16_t short_addr
Definition tr_over_the_air_bootloading_client.h:122
zb_uint32_t fw_version
Definition tr_over_the_air_bootloading_client.h:121
Trident application framework include.
tr_conn_state_e
Definition tr_af.h:24
tr_door_lock_user_status_t status
Definition tr_door_lock_server.h:26
zb_uint8_t endpoint
Definition tr_nvram_attr.h:176
zb_uint16_t manuf_code
Definition tr_nvram_attr.h:180
zb_uint16_t attr_id
Definition tr_nvram_attr.h:178
ZB_PACKED_PRE struct @215301053273224120306224226164135246007144231067 tr_over_the_air_bootloading_image_block_response_wait_for_data_cmd_t
zb_char_t header_string[32]
Definition tr_over_the_air_bootloading_client.h:152
ZB_PACKED_PRE struct @152126221307375011043075175234276362307071330300 tr_zcl_over_the_air_bootloading_sub_element_t
zb_uint32_t file_id
Definition tr_over_the_air_bootloading_client.h:144
zb_uint32_t request_time
Definition tr_over_the_air_bootloading_client.h:113
tr_over_the_air_bootloading_client_image_notify_payload_type_t
Definition tr_over_the_air_bootloading_client.h:63
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE_IMAGE
Definition tr_over_the_air_bootloading_client.h:66
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER
Definition tr_over_the_air_bootloading_client.h:64
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE
Definition tr_over_the_air_bootloading_client.h:65
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_IMAGE_NOTIFY_PAYLOAD_JITTER_CODE_IMAGE_VER
Definition tr_over_the_air_bootloading_client.h:67
tr_over_the_air_bootloading_client_status_t
Definition tr_over_the_air_bootloading_client.h:97
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_DOWNLOADING
Definition tr_over_the_air_bootloading_client.h:99
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAITING_UPGRADE
Definition tr_over_the_air_bootloading_client.h:101
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAIT_FOR_MORE
Definition tr_over_the_air_bootloading_client.h:103
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_UNKNOWN
Definition tr_over_the_air_bootloading_client.h:105
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_COUNT_DOWN
Definition tr_over_the_air_bootloading_client.h:102
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_NORMAL
Definition tr_over_the_air_bootloading_client.h:98
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_WAIT_TO_UPGRADE_VIA_EXT_EVENT
Definition tr_over_the_air_bootloading_client.h:104
@ TR_ZCL_OVER_THE_AIR_BOOTLOADING_CLIENT_STATUS_DOWNLOADED
Definition tr_over_the_air_bootloading_client.h:100
zb_uint32_t file_version
Definition tr_over_the_air_bootloading_client.h:150
zb_uint16_t manufacturer_code
Definition tr_over_the_air_bootloading_client.h:148
zb_uint16_t fc
Definition tr_over_the_air_bootloading_client.h:147
zb_uint32_t length
Definition tr_over_the_air_bootloading_client.h:159
zb_uint16_t header_version
Definition tr_over_the_air_bootloading_client.h:145
void tr_over_the_air_bootloading_client_init(void)
zb_uint16_t minimum_block_period
Definition tr_over_the_air_bootloading_client.h:114
zb_uint8_t value[1]
Definition tr_over_the_air_bootloading_client.h:160
zb_uint16_t stack_version
Definition tr_over_the_air_bootloading_client.h:151
ZB_PACKED_PRE struct @125105020254034332120146102374364003242067252221 tr_zcl_over_the_air_bootloading_file_header_t
void tr_over_the_air_bootloading_client_connection_state_cb(tr_conn_state_e conn_state)
zb_uint16_t image_type
Definition tr_over_the_air_bootloading_client.h:149
zb_uint32_t total_image_size
Definition tr_over_the_air_bootloading_client.h:153
tr_zcl_ota_upgrade_sub_element_tag
Definition tr_over_the_air_bootloading_client.h:166
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_PICTURE_DATA
Definition tr_over_the_air_bootloading_client.h:171
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_IMAGE_INTEGRITY_CODE
Definition tr_over_the_air_bootloading_client.h:170
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA
Definition tr_over_the_air_bootloading_client.h:168
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_MANUF_MAX
Definition tr_over_the_air_bootloading_client.h:175
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_UPGRADE_IMAGE
Definition tr_over_the_air_bootloading_client.h:167
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_MANUF_MIN
Definition tr_over_the_air_bootloading_client.h:174
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_CERT_V_2
Definition tr_over_the_air_bootloading_client.h:173
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_V_2
Definition tr_over_the_air_bootloading_client.h:172
@ TR_ZCL_OTA_UPGRADE_FILE_TAG_ECDSA_CERT
Definition tr_over_the_air_bootloading_client.h:169
zb_uint16_t tag_id
Definition tr_over_the_air_bootloading_client.h:158
zb_uint32_t current_time
Definition tr_over_the_air_bootloading_client.h:112
zb_uint16_t header_length
Definition tr_over_the_air_bootloading_client.h:146
Definition tr_over_the_air_bootloading_client.h:84
zb_uint8_t data
Definition tr_over_the_air_bootloading_client.h:92
zb_uint8_t minimum_block_period_present
Definition tr_over_the_air_bootloading_client.h:88
zb_uint8_t unused
Definition tr_over_the_air_bootloading_client.h:89
zb_uint8_t ieee_address_present
Definition tr_over_the_air_bootloading_client.h:87
Definition tr_over_the_air_bootloading_client.h:72
zb_uint8_t hw_version_present
Definition tr_over_the_air_bootloading_client.h:75
zb_uint8_t unused
Definition tr_over_the_air_bootloading_client.h:76
zb_uint8_t data
Definition tr_over_the_air_bootloading_client.h:79