OTA Upgrade Stream classes
typedef OtaUpgrade::BasicStream OtaUpgradeStream
Application code should use this alias to avoid source code modifications when changing OTA upgrade security settings.
class BasicStream : public ReadWriteStream
A write-only stream to parse and apply firmware unencrypted upgrade files generated by otatool.py.
The class fully automates the firmware upgrade process without any manual configuration. At construction time, the rBoot configuration is read to determine the unused ROM slot which should receive the upgrade. Just feed the upgrade file content into the
write()method in arbitrarily sized chunks. The relevant portion(s) of the Flash memory (currently only the application rom) are updated on the fly as data arrives. When the file is complete and signature validation (if enabled) was successful, the updated slot is activated in the rBoot configuration. Call
hasError()and/or check the public
errorCodemember to determine if everything went smoothly.
For further information on configuration options and the file format, refer to the library’s documentation.
EncryptedStreamfor encryption support.
Subclassed by OtaUpgrade::EncryptedStream
class EncryptedStream : public OtaUpgrade::BasicStream
Encryption wrapper for BasicStream.
The class processes encrypted firmware upgrade files created by otatool.py. A buffer is allocated dynamically to fit the largest chunk of the encryption container (2kB unless otatool.py was modified). The actual processing of the decrypted data is defered to BasicStream.