ota
27 items · generated by scribe fromstdlib/ota.fd· synced 2026-11-15
Contents
- OTA_STATE_IDLE: (const)
- ota_state_name (function)
- OTAManifest (struct)
- ota_manifest_new (function)
- ota_manifest_set_version (function)
- ota_manifest_set_signature (function)
- ota_manifest_set_description (function)
- ota_verify_payload (function)
- ota_verify_manifest (function)
- ota_check_compatibility (function)
- OTASession (struct)
- ota_session_new (function)
- ota_session_start_download (function)
- ota_session_download_progress (function)
- ota_session_download_percent (function)
- ota_session_verify (function)
- ota_session_apply (function)
- ota_session_commit (function)
- ota_session_rollback (function)
- ota_session_fail (function)
- ota_session_can_retry (function)
- ota_session_retry (function)
- ota_session_state_name (function)
- DiffEntry (struct)
- ota_binary_diff (function)
- ota_diff_size (function)
- ota_diff_region_count (function)
OTA_STATE_IDLE:
pub const OTA_STATE_IDLE: i64 = 0; pub const OTA_STATE_DOWNLOADING: i64 = 1; pub const OTA_STATE_VERIFYING: i64 = 2; pub const OTA_STATE_APPLYING: i64 = 3; pub const OTA_STATE_COMMITTED: i64 = 4; pub const OTA_STATE_ROLLBACK: i64 = 5; pub const OTA_STATE_FAILED: i64 = 6;Defined at line 51
ota_state_name
Get OTA state name.
pub fn ota_state_name(state: i64) -> str {Parameters:
state:i64
Returns: str
Defined at line 53
OTAManifest
An OTA update manifest.
pub struct OTAManifest {Fields:
| Name | Type |
|---|---|
version | str |
filename | str |
size | i64 |
checksum | str |
signature | str |
min_version | str |
max_version | str |
timestamp | i64 |
description | str |
Defined at line 85
ota_manifest_new
Create a new OTA manifest.
pub fn ota_manifest_new(filename: str, size: i64, checksum: str) -> OTAManifest {Parameters:
filename:strsize:i64checksum:str
Returns: OTAManifest
Defined at line 104
ota_manifest_set_version
Set version information.
pub fn ota_manifest_set_version(manifest: & mut OTAManifest, version: str, min_ver: str, max_ver: str) -> void {Parameters:
manifest:& mut OTAManifestversion:strmin_ver:strmax_ver:str
Returns: void
Defined at line 111
ota_manifest_set_signature
Set signature.
pub fn ota_manifest_set_signature(manifest: & mut OTAManifest, signature: str) -> void {Parameters:
manifest:& mut OTAManifestsignature:str
Returns: void
Defined at line 118
ota_manifest_set_description
Set description.
pub fn ota_manifest_set_description(manifest: & mut OTAManifest, desc: str) -> void {Parameters:
manifest:& mut OTAManifestdesc:str
Returns: void
Defined at line 123
ota_verify_payload
Does the update match its manifest: the size, and the SHA-256 of its bytes? This is integrity only: a manifest proves who made it only if it is signed.
pub fn ota_verify_payload(manifest: OTAManifest, payload: str) -> bool {Parameters:
manifest:OTAManifestpayload:str
Returns: bool
Defined at line 129
ota_verify_manifest
Are the manifest’s fields well formed? This only looks at the manifest: it says nothing about the update itself, which is ota_verify_payload’s work.
pub fn ota_verify_manifest(manifest: OTAManifest) -> bool {Parameters:
manifest:OTAManifest
Returns: bool
Defined at line 138
ota_check_compatibility
Check if the current version is compatible with the manifest.
pub fn ota_check_compatibility(manifest: OTAManifest, current_version: str) -> bool {Parameters:
manifest:OTAManifestcurrent_version:str
Returns: bool
Defined at line 160
OTASession
An OTA update session tracking the update process.
pub struct OTASession {Fields:
| Name | Type |
|---|---|
manifest | OTAManifest |
state | i64 |
bytes_downloaded | i64 |
bytes_verified | i64 |
error_msg | str |
retry_count | i64 |
max_retries | i64 |
Defined at line 179
ota_session_new
Create a new OTA session from a manifest.
pub fn ota_session_new(manifest: OTAManifest) -> OTASession {Parameters:
manifest:OTAManifest
Returns: OTASession
Defined at line 190
ota_session_start_download
Start downloading the update.
pub fn ota_session_start_download(session: & mut OTASession) -> void {Parameters:
session:& mut OTASession
Returns: void
Defined at line 197
ota_session_download_progress
Update download progress.
pub fn ota_session_download_progress(session: & mut OTASession, bytes: i64) -> void {Parameters:
session:& mut OTASessionbytes:i64
Returns: void
Defined at line 203
ota_session_download_percent
Get download progress as percentage (0-100).
pub fn ota_session_download_percent(session: OTASession) -> i64 {Parameters:
session:OTASession
Returns: i64
Defined at line 211
ota_session_verify
Verify the downloaded binary against the manifest checksum. binary_data: the downloaded bytes. Returns true if verification succeeds.
pub fn ota_session_verify(session: & mut OTASession, binary_data: Vec<i64>) -> bool {Parameters:
session:& mut OTASessionbinary_data:Vec<i64>
Returns: bool
Defined at line 221
ota_session_apply
Apply the update (transition to applying state).
pub fn ota_session_apply(session: & mut OTASession) -> void {Parameters:
session:& mut OTASession
Returns: void
Defined at line 242
ota_session_commit
Commit the update (mark as committed, can’t rollback).
pub fn ota_session_commit(session: & mut OTASession) -> void {Parameters:
session:& mut OTASession
Returns: void
Defined at line 247
ota_session_rollback
Rollback the update (revert to previous version).
pub fn ota_session_rollback(session: & mut OTASession) -> void {Parameters:
session:& mut OTASession
Returns: void
Defined at line 252
ota_session_fail
Mark the session as failed.
pub fn ota_session_fail(session: & mut OTASession, error_msg: str) -> void {Parameters:
session:& mut OTASessionerror_msg:str
Returns: void
Defined at line 257
ota_session_can_retry
Check if the session can be retried.
pub fn ota_session_can_retry(session: OTASession) -> bool {Parameters:
session:OTASession
Returns: bool
Defined at line 263
ota_session_retry
Retry the download.
pub fn ota_session_retry(session: & mut OTASession) -> void {Parameters:
session:& mut OTASession
Returns: void
Defined at line 268
ota_session_state_name
Get the session state name.
pub fn ota_session_state_name(session: OTASession) -> str {Parameters:
session:OTASession
Returns: str
Defined at line 277
DiffEntry
A binary diff entry.
pub struct DiffEntry {Fields:
| Name | Type |
|---|---|
offset | i64 |
length | i64 |
data | Vec<i64> |
Defined at line 288
ota_binary_diff
Create a binary diff between old and new data. Returns a Vec of DiffEntry (flattened as alternating offset/length/data).
pub fn ota_binary_diff(old_data: Vec<i64>, new_data: Vec<i64>) -> Vec<i64> {Parameters:
old_data:Vec<i64>new_data:Vec<i64>
Returns: Vec<i64>
Defined at line 296
ota_diff_size
Compute the size of a binary diff (number of changed bytes).
pub fn ota_diff_size(diff: Vec<i64>) -> i64 {Parameters:
diff:Vec<i64>
Returns: i64
Defined at line 335
ota_diff_region_count
Get the number of changed regions in a diff.
pub fn ota_diff_region_count(diff: Vec<i64>) -> i64 {Parameters:
diff:Vec<i64>
Returns: i64
Defined at line 346
Generated by scribe, the Fides documentation generator