PebbleOS
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
put_bytes_storage.h File Reference
#include <stdbool.h>
#include <pbl/services/put_bytes/put_bytes.h>

Data Structures

struct  PutBytesStorage
 Storage of an object being received. More...
 
struct  PutBytesStorageInfo
 Object information passed to pb_storage_init(). More...
 

Enumerations

enum  PutBytesCrcType { PutBytesCrcType_Legacy = 0 , PutBytesCrcType_CRC32 }
 CRC algorithms. More...
 

Functions

void pb_storage_write (PutBytesStorage *storage, uint32_t offset, const uint8_t *buffer, uint32_t length)
 Write data at an offset, without moving PutBytesStorage::current_offset.
 
void pb_storage_append (PutBytesStorage *storage, const uint8_t *buffer, uint32_t length)
 Append data at PutBytesStorage::current_offset and advance it.
 
uint32_t pb_storage_calculate_crc (PutBytesStorage *storage, PutBytesCrcType crc_type)
 Compute the CRC of the data written so far.
 
bool pb_storage_init (PutBytesStorage *storage, PutBytesObjectType object_type, uint32_t total_size, PutBytesStorageInfo *info, uint32_t append_offset)
 Initialize storage for a new transfer.
 
void pb_storage_deinit (PutBytesStorage *storage, bool is_success)
 Release storage after a transfer.
 
bool pb_storage_get_status (PutBytesObjectType obj_type, PbInstallStatus *status)
 Recover the progress of a partially written object.