|
PebbleOS
|
Backend writing objects to PFS files. More...
Functions | |
| bool | pb_storage_file_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_file_get_max_size (PutBytesObjectType object_type) |
| Get the largest object size supported. | |
| void | pb_storage_file_write (PutBytesStorage *storage, uint32_t offset, const uint8_t *buffer, uint32_t length) |
| Write data, see pb_storage_write(). | |
| uint32_t | pb_storage_file_calculate_crc (PutBytesStorage *storage, PutBytesCrcType crc_type) |
| Compute the CRC of the data written, see pb_storage_calculate_crc(). | |
| void | pb_storage_file_deinit (PutBytesStorage *storage, bool is_success) |
| Release storage, see pb_storage_deinit(). | |
Backend writing objects to PFS files.
| uint32_t pb_storage_file_calculate_crc | ( | PutBytesStorage * | storage, |
| PutBytesCrcType | crc_type | ||
| ) |
Compute the CRC of the data written, see pb_storage_calculate_crc().
Only PutBytesCrcType_Legacy is supported.
| storage | Storage. |
| crc_type | CRC algorithm. |
| void pb_storage_file_deinit | ( | PutBytesStorage * | storage, |
| bool | is_success | ||
| ) |
Release storage, see pb_storage_deinit().
Closes the file, deleting it on failure.
| storage | Storage. |
| is_success | Whether the transfer succeeded. |
| uint32_t pb_storage_file_get_max_size | ( | PutBytesObjectType | object_type | ) |
Get the largest object size supported.
Free PFS space.
| object_type | Object type. |
| bool pb_storage_file_init | ( | PutBytesStorage * | storage, |
| PutBytesObjectType | object_type, | ||
| uint32_t | total_size, | ||
| PutBytesStorageInfo * | info, | ||
| uint32_t | append_offset | ||
| ) |
Initialize storage, see pb_storage_init().
Replaces any existing file with the name in info. A zero-sized object creates no file.
| [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_file_write | ( | PutBytesStorage * | storage, |
| uint32_t | offset, | ||
| const uint8_t * | buffer, | ||
| uint32_t | length | ||
| ) |
Write data, see pb_storage_write().
Only supports writing at PutBytesStorage::current_offset.
| storage | Storage. |
| offset | Offset within the storage. |
| buffer | Data. |
| length | Length of buffer in bytes. |