|
PebbleOS
|
Backend writing firmware, recovery and system resources to flash. More...
Functions | |
| bool | pb_storage_raw_init (PutBytesStorage *storage, PutBytesObjectType object_type, uint32_t total_size, PutBytesStorageInfo *info, uint32_t append_offset) |
| Initialize storage, see pb_storage_init(). | |
| uint32_t | pb_storage_raw_get_max_size (PutBytesObjectType object_type) |
| Get the largest object size supported. | |
| void | pb_storage_raw_write (PutBytesStorage *storage, uint32_t offset, const uint8_t *buffer, uint32_t length) |
| Write data, see pb_storage_write(). | |
| uint32_t | pb_storage_raw_calculate_crc (PutBytesStorage *storage, PutBytesCrcType crc_type) |
| Compute the CRC of the data written, see pb_storage_calculate_crc(). | |
| void | pb_storage_raw_deinit (PutBytesStorage *storage, bool is_success) |
| Release storage, see pb_storage_deinit(). | |
| bool | pb_storage_raw_get_status (PutBytesObjectType obj_type, PbInstallStatus *status) |
| Recover the progress of a partially written object, see pb_storage_get_status(). | |
Backend writing firmware, recovery and system resources to flash.
| uint32_t pb_storage_raw_calculate_crc | ( | PutBytesStorage * | storage, |
| PutBytesCrcType | crc_type | ||
| ) |
Compute the CRC of the data written, see pb_storage_calculate_crc().
Covers the data written, excluding the firmware description header.
| storage | Storage. |
| crc_type | CRC algorithm. |
| void pb_storage_raw_deinit | ( | PutBytesStorage * | storage, |
| bool | is_success | ||
| ) |
Release storage, see pb_storage_deinit().
Restores the Bluetooth responsiveness lowered during the erase.
| storage | Storage. |
| is_success | Whether the transfer succeeded. |
| uint32_t pb_storage_raw_get_max_size | ( | PutBytesObjectType | object_type | ) |
Get the largest object size supported.
Size of the destination region.
| object_type | Object type. |
| bool pb_storage_raw_get_status | ( | PutBytesObjectType | obj_type, |
| PbInstallStatus * | status | ||
| ) |
Recover the progress of a partially written object, see pb_storage_get_status().
Scans the region backwards for the last programmed byte. One byte less than written is reported, so a firmware update always sends the last chunk again.
| obj_type | Object type. | |
| [out] | status | Bytes written and their legacy CRC. |
status was filled in. | bool pb_storage_raw_init | ( | PutBytesStorage * | storage, |
| PutBytesObjectType | object_type, | ||
| uint32_t | total_size, | ||
| PutBytesStorageInfo * | info, | ||
| uint32_t | append_offset | ||
| ) |
Initialize storage, see pb_storage_init().
Erases the destination region, unless resuming at append_offset. Firmware images start after a FirmwareDescription header written on commit.
| [out] | storage | Storage. |
| object_type | Object type. | |
| total_size | Object size in bytes. | |
| info | Object information. | |
| append_offset | Offset to resume at, 0 to start over. |
| void pb_storage_raw_write | ( | PutBytesStorage * | storage, |
| uint32_t | offset, | ||
| const uint8_t * | buffer, | ||
| uint32_t | length | ||
| ) |
Write data, see pb_storage_write().
offset is relative to the start of the region.
| storage | Storage. |
| offset | Offset within the storage. |
| buffer | Data. |
| length | Length of buffer in bytes. |