Ota Unicast Bootloader Server Plugin
Macros and APIs for ota-unicast-bootloader server. More...
Macros |
|
#define | EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_STACK_ERRORS 8 |
The number of consecutive stack message submission errors or stack related errors such as CSMA failures after which the plugin gives up.
More...
|
|
#define | EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_UNICAST_ERRORS 4 |
The number of consecutive unicast attempts after which a target is declared unreachable. Legal values for this are in the [0,7] range.
More...
|
|
#define | EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_RESPONSE_TIMEOUT_MS 250 |
The time in milliseconds after which the server gives up waiting for a response from a client.
More...
|
|
Functions |
|
EmberAfOtaUnicastBootloaderStatus | emberAfPluginOtaUnicastBootloaderServerInitiateImageDistribution ( EmberNodeId targetId, uint32_t imageSize, uint8_t imageTag) |
Initiate the image distribution process.
More...
|
|
EmberAfOtaUnicastBootloaderStatus | emberAfPluginUnicastBootloaderServerInitiateRequestTargetBootload (uint32_t bootloadDelayMs, uint8_t imageTag, EmberNodeId targetId) |
Request a target device to initiate the bootload of a received image at some point in the future.
More...
|
|
EmberAfOtaUnicastBootloaderStatus | emberAfPluginOtaUnicastBootloaderServerAbortCurrentProcess (void) |
Abort the ongoing process, such as image distribution or bootload request.
More...
|
|
Callbacks |
|
bool | emberAfPluginOtaUnicastBootloaderServerGetImageSegmentCallback (uint32_t startIndex, uint32_t endIndex, uint8_t imageTag, uint8_t *imageSegment) |
A callback invoked during an image distribution process to retrieve a contiguous segment of the image being distributed.
More...
|
|
void | emberAfPluginOtaUnicastBootloaderServerImageDistributionCompleteCallback ( EmberAfOtaUnicastBootloaderStatus status) |
A callback invoked when the image distribution process is terminated.
More...
|
|
void | emberAfPluginOtaUnicastBootloaderServerRequestTargetBootloadCompleteCallback ( EmberAfOtaUnicastBootloaderStatus status) |
A callback invoked when a bootload request process has completed.
More...
|
|
Detailed Description
Macros and APIs for ota-unicast-bootloader server.
OTA bootloading plugins are usable to send firmware images Over The Air when the application is running. When the firmware is downloaded to a device, a bootloader can be started to replace the application in the flash to the one just downloaded.
All Connect bootloader related code relies on the Gecko Bootloader for bootloading and it must be installed on the device for these plugins to work. For details on the Gecko Bootloader, see UG266.
The Unicast OTA plugins implement the OTA download operation in a unicast, addressed way, so only a single client can be addressed from a server in an OTA session, and downloading images to multiple devices will require the server to send the image multiple times. Communication relies on standard unicast data messages, which also means that the routing provided by the Connect stack is availble.
Although bootloading sleepy end devices is theoretically possible with polling, it is not very effective, and it's probably simpler to reconnect as a normal end device while the OTA is active.
Unicast OTA uses a plugin configurable endpoint, which is 13 by default.
Security can be also enabled as plugin configuration on the server, as well as the interval of the messages. The client has a timeout plugin configuration after which it stops the OTA session with an error.
See UG235.06 for further details.
- Note
- OTA Unicast Bootloading plugins are not available in MAC mode due to the lack of endpoints.
See
ota-unicast-bootloader-server.h
and ota-unicast-bootloader-server.c for source code.
Macro Definition Documentation
◆ EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_STACK_ERRORS
#define EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_STACK_ERRORS 8 |
The number of consecutive stack message submission errors or stack related errors such as CSMA failures after which the plugin gives up.
Definition at line
51
of file
ota-unicast-bootloader-server.h
.
◆ EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_UNICAST_ERRORS
#define EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_UNICAST_ERRORS 4 |
The number of consecutive unicast attempts after which a target is declared unreachable. Legal values for this are in the [0,7] range.
Definition at line
57
of file
ota-unicast-bootloader-server.h
.
◆ EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_RESPONSE_TIMEOUT_MS
#define EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_RESPONSE_TIMEOUT_MS 250 |
The time in milliseconds after which the server gives up waiting for a response from a client.
Definition at line
63
of file
ota-unicast-bootloader-server.h
.
Function Documentation
◆ emberAfPluginOtaUnicastBootloaderServerAbortCurrentProcess()
EmberAfOtaUnicastBootloaderStatus emberAfPluginOtaUnicastBootloaderServerAbortCurrentProcess | ( | void |
|
) |
Abort the ongoing process, such as image distribution or bootload request.
- Returns
-
An
EmberAfOtaUnicastBootloaderStatus
value of:
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_SUCCESS if the current ongoing process was successfully aborted.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_INVALID_CALL if the server is not currently involved in any process.
◆ emberAfPluginOtaUnicastBootloaderServerGetImageSegmentCallback()
bool emberAfPluginOtaUnicastBootloaderServerGetImageSegmentCallback | ( | uint32_t |
startIndex,
|
uint32_t |
endIndex,
|
||
uint8_t |
imageTag,
|
||
uint8_t * |
imageSegment
|
||
) |
A callback invoked during an image distribution process to retrieve a contiguous segment of the image being distributed.
- Parameters
-
[in] startIndex
The index of the first byte the application should copy into the passed array. [in] endIndex
The index of the last byte the application should copy into the passed array. [in] imageTag
A 1-byte tag of the image for which a segment is requested. [out] imageSegment
An array of (endIndex - startIndex + 1) length to which the application should copy the requested image segment.
- Returns
- A boolean indicating whether the application successfully copied the requested bytes into the passed array. If the application returns false , the server will abort the ongoing distribution process.
◆ emberAfPluginOtaUnicastBootloaderServerImageDistributionCompleteCallback()
void emberAfPluginOtaUnicastBootloaderServerImageDistributionCompleteCallback | ( | EmberAfOtaUnicastBootloaderStatus |
status
|
) |
A callback invoked when the image distribution process is terminated.
- Parameters
-
[in] status
An EmberAfOtaUnicastBootloaderStatus value of: - EMBER_OTA_UNICAST_BOOTLOADER_STATUS_SUCCESS if the target confirms that the full image is received.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_DATA_UNDERFLOW if the application failed to supply the requested image segments.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_STACK_ERROR if the server encountered multiple consecutive transmission errors. The Server gives up the image distribution process if EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_STACK_ERRORS consecutive transmission errors are encountered.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_FAILED if the distribution process terminated prematurely because the target can't be reached.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_UNREACHABLE if the server can not establish communication with the target client.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_ABORTED if the application aborted the current image distribution process.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_REFUSED if the client refused the image.
◆ emberAfPluginOtaUnicastBootloaderServerInitiateImageDistribution()
EmberAfOtaUnicastBootloaderStatus emberAfPluginOtaUnicastBootloaderServerInitiateImageDistribution | ( | EmberNodeId |
targetId,
|
uint32_t |
imageSize,
|
||
uint8_t |
imageTag
|
||
) |
Initiate the image distribution process.
- Parameters
-
[in] targetId
The node ID of the target. [in] imageSize
The image size in bytes to be distributed. [in] imageTag
A 1-byte tag that will be embedded in the server-to-client over-the-air messages. The application can use the image tag for versioning purposes and/or for distinguishing between different image types.
- Returns
-
An
EmberAfOtaUnicastBootloaderStatus
value of:
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_BUSY if an image distribution is already in progress
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_INVALID_CALL if the given target or the image size is invalid
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_SUCCESS if the image distribution was successfully initiated.
◆ emberAfPluginOtaUnicastBootloaderServerRequestTargetBootloadCompleteCallback()
void emberAfPluginOtaUnicastBootloaderServerRequestTargetBootloadCompleteCallback | ( | EmberAfOtaUnicastBootloaderStatus |
status
|
) |
A callback invoked when a bootload request process has completed.
- Parameters
-
[in] status
An EmberAfOtaUnicastBootloaderStatus value of: - EMBER_OTA_UNICAST_BOOTLOADER_STATUS_SUCCESS if the target has been requested to perform a bootload.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_STACK_ERROR if the server encountered multiple consecutive transmission errors. The Server gives up the bootload request process if EMBER_AF_PLUGIN_OTA_UNICAST_BOOTLOADER_SERVER_MAX_STACK_ERRORS consecutive transmission errors are encountered.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_ABORTED if the application aborted the current bootload request process.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_UNREACHABLE if the server can not establish communication with the target client.
◆ emberAfPluginUnicastBootloaderServerInitiateRequestTargetBootload()
EmberAfOtaUnicastBootloaderStatus emberAfPluginUnicastBootloaderServerInitiateRequestTargetBootload | ( | uint32_t |
bootloadDelayMs,
|
uint8_t |
imageTag,
|
||
EmberNodeId |
targetId
|
||
) |
Request a target device to initiate the bootload of a received image at some point in the future.
- Parameters
-
[in] bootloadDelayMs
The delay in milliseconds after which the target should perform an image bootload. [in] imageTag
A 1-byte tag that identifies the image to be bootloaded at the target device. [in] targetId
The node ID of the target.
- Returns
-
An
EmberAfOtaUnicastBootloaderStatus
value of:
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_SUCCESS if the plugin successfully started the process to request a target and initiate a bootload. If this is the case, the corresponding callback emberAfPluginOtaUnicastBootloaderServerRequestTargetBootloadCompleteCallback() is invoked when the request process is completed.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_INVALID_CALL if some of the passed parameters are invalid.
- EMBER_OTA_UNICAST_BOOTLOADER_STATUS_BUSY if the server is currently involved in another over-the-air process.