# OTA User Configurations¶

group group_ota_config

Customer overrides for the OTA library.

Defines

CY_OTA_INITIAL_CHECK_SECS

Initial time for checking for OTA updates.

This is used to start the timer for the initial OTA update check after calling cy_ota_agent_start().

CY_OTA_NEXT_CHECK_INTERVAL_SECS

Next time for checking for OTA updates.

This is used to restart the timer after an OTA update check in the OTA Agent.

CY_OTA_RETRY_INTERVAL_SECS

Retry time which checking for OTA updates.

This is used to restart the timer after failing to contact the server during an OTA update check.

CY_OTA_CHECK_TIME_SECS

Length of time to check for downloads.

THE OTA Agent wakes up, connects to server, and waits this much time before disconnecting. This allows the OTA Agent to be inactive for long periods of time, only checking for short periods. Use 0x00 to continue checking once started.

CY_OTA_PACKET_INTERVAL_SECS

Expected maximum download time between each OTA packet arrival.

This is used verify that the download occurs in a reasonable time frame. Set to 0 to disable this check.

CY_OTA_JOB_CHECK_TIME_SECS

Length of time to check for getting Job document.

The OTA Agent wakes up, connects to broker/server, and waits this much time before disconnecting. This allows the OTA Agent to be inactive for long periods of time, only checking for short periods. Use 0x00 to continue checking once started.

CY_OTA_DATA_CHECK_TIME_SECS

Length of time to check for getting the OTA image data.

After getting the Job (or during a direct download), this is the amount of time to wait before canceling the download. Use 0x00 to disable.

CY_OTA_RETRIES

Number of retries when attempting an OTA update.

This is used to determine # retries when attempting an OTA update.

CY_OTA_CONNECT_RETRIES

Number of retries when attempting to contact the server.

This is used to determine # retries when connecting to the server during an OTA update check.

CY_OTA_MAX_DOWNLOAD_TRIES

PUBLISHER_LISTEN_TOPIC

Last part of the topic to subscribe.

Topic for the device to send a message to the Publisher: “COMPANY_TOPIC_PREPEND / BOARD_NAME / PUBLISHER_LISTEN_TOPIC” The combined topic must match the Publisher’s subscribe topic.

Override in cy_ota_config.h

COMPANY_TOPIC_PREPEND

First part of the topic to subscribe / publish.

Topic for the device to send a message to the Publisher: “COMPANY_TOPIC_PREPEND / BOARD_NAME / PUBLISHER_LISTEN_TOPIC”

PUBLISHER_DIRECT_TOPIC

End of topic to send a message to the Publisher for Direct download.

CY_OTA_RESULT_SUCCESS

Update Successful message.

Used with sprintf() to create the RESULT message to the Broker/server.

CY_OTA_RESULT_FAILURE

Update Failure message.

Used with sprintf() to create the RESULT message to the Broker/server.

CY_OTA_HTTP_JOB_FILE

Default Job document name.

Name of the update JSON file for HTTP.

CY_OTA_HTTP_DATA_FILE

Default OTA image file name.

Name of the OTA image for HTTP.

CY_OTA_SUBSCRIBE_UPDATES_AVAIL

Used with sprintf() to insert the current version and UniqueTopicName at runtime. Override if desired by defining in cy_ota_config.h.

CY_OTA_DOWNLOAD_REQUEST

Device message to the Publisher to ask for a full download.

• Used with sprintf() to insert values at runtime. Current Application Version UniqueTopicName Size Override if desired by defining in cy_ota_config.h.

CY_OTA_DOWNLOAD_CHUNK_REQUEST

Device message to the Publisher to ask for a chunk of data.

• Used with sprintf() to insert values at runtime. Current Application Version UniqueTopicName FileName Offset Size Override if desired by defining in cy_ota_config.h.

CY_OTA_DOWNLOAD_DIRECT_REQUEST

Device message to the Publisher to ask for a download.

• Used with sprintf() to insert the current version and UniqueTopicName at runtime. Override if desired by defining in cy_ota_config.h.

CY_OTA_MQTT_RESULT_JSON

Device JSON document to respond to the MQTT Publisher.

Used with sprintf() to create the JSON message. Override if desired by defining in cy_ota_config.h.

CY_OTA_HTTP_RESULT_JSON

Device JSON document to respond to the HTTP server.

Used with sprintf() to create the JSON message. Override if desired by defining in cy_ota_config.h.

CY_OTA_HTTP_GET_TEMPLATE

HTTP GET template.

Used with sprintf() to create the GET request for the HTTP server.

CY_OTA_HTTP_GET_RANGE_TEMPLATE

HTTP GET Range template.

Used with sprintf() to create the GET request for the HTTP server when requesting a range of data.

CY_OTA_HTTP_POST_TEMPLATE

HTTP POST template.

Used with sprintf() to create the POST message for the HTTP server.

CY_OTA_MQTT_KEEP_ALIVE_SECONDS

The keepalive interval for MQTT.

Maximum number of MQTT Topics.

An MQTT ping request will be sent periodically at this interval. The maximum number of Topics for subscribing.

CY_OTA_MQTT_MAX_TOPICS

Maximum number of MQTT Topics.

The maximum number of Topics for subscribing.

CY_OTA_MQTT_TOPIC_PREFIX

TOPIC prefix.

Used as prefix for “Will” and “Acknowledgement” messages.

CY_OTA_MQTT_CLIENT_ID_PREFIX

The first characters in the client identifier.

A timestamp is appended to this prefix to create a unique client identifer for each connection.