src/app/clusters/ota-requestor/README.md
This is an implementation of the Matter OTA Requestor functionality that can be used by Matter applications for OTA software updates
There are various components defined to support OTA software updates. The Matter SDK supplies the default implementation to all components. If so desired, a custom implementation may be used to replace the default implementation.
This is an interface for processing the core requestor logic. This includes sending commands to the OTA Provider cluster as well as handling the responses for those commands. This component also maintains the server attributes for the OTA Requestor cluster.
DefaultOTARequestor class is the default implementation of this interface. Any
custom implementation should reside under examples/platform/<platform-name>.
This is an interface for using/driving the OTARequestorInterface. This
component determines the next action to take based on the current status
returned by OTARequestorInterface. For instance, after OTARequestorInterface
receives a QueryImageResponse that an update is available, it informs
OTARequestorDriver which then decides whether it is ready to immediately start
the download or to wait on some conditions.
DefaultOTARequestorDriver class is the default implementation of this
interface. Any custom implementation should reside under
examples/platform/<platform-name>.
Please note the following implementation choices in the default implementation:
OTAImageProcessorInterfaceOTARequestorInterface is in the
idle stateThis is a platform-agnostic interface for processing downloaded chunks of OTA
image data. The data could be raw image data meant for flash or metadata. This
component should interact with the OTADownloader to drive the download
process.
Each platform should provide an implementation of this interface which should
reside under src/platform/<platform-name>.
This is an interface for image download functionality over a particular
protocol. Each DownloadProtocolEnum supported should provide an implementation
of this interface.
BDXDownloader class is an implementation of this interface for the BDX
protocol.
This is an interface for storing/loading persistent data related to OTA.
DefaultOTARequestorStorage class is the default implementation of this
interface. Any custom implementation should reside under
examples/platform/<platform-name>.
Server for the OTA Software Update Requestor cluster in the
application zap fileClient for the OTA Software Update Provider cluster in the
application zap fileDefaultOTARequestor class or implement a class derived from
OTARequestorInterfaceDefaultOTARequestorDriver class or implement a class derived
from OTARequestorDriverBDXDownloader class or implement a class derived from
OTADownloaderOTAImageProcessorInterfaceDefaultOTARequestorStorage class or implement a class derived
from OTARequestorStoragesrc/app/clusters/ota-requestor in
the application make/build file. For example: src/app/chip_data_model.gni.
Otherwise, list the source files where the component implementation reside.src/platform. For
example: src/platform/Linux/BUILD.gnDefaultOTARequestor classDefaultOTARequestorDriver classOTAImageProcessorImpl class from
src/platform/Linux/OTAImageProcessorImpl.hBDXDownloader classDefaultOTARequestorStorage classDefaultOTARequestor through
SetRequestorInstance()DefaultOTARequestorStorage through
DefaultOTARequestorStorage::InitDefaultOTARequestorStorage,
DefaultOTARequestorDriver, and BDXDownloader with the instance of
DefaultOTARequestor through DefaultOTARequestor::Init()DefaultOTARequestor and
OTAImageProcessorImpl with the instance of DefaultOTARequestorDriver
through DefaultOTARequestorDriver::Init(). It is important that this
is performed after DefaultOTARequestor::Init as there are dependencies
that DefaultOTARequestor already has access to
DefaultOTARequestorDriver by the time this initialization occurs.BDXDownloader with the instance of
OTAImageProcessorImpl through
OTAImageProcessorImpl::SetOTADownloaderOTAImageProcessorImpl with the instance of
BDXDownloader through OTADownloader::SetImageProcessorDelegateexamples/ota-requestor-app/linux/main.cpp for an example of the
initialization code above