CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::mod_fido2::LargeBlobWriteSession Class Reference

Accumulates an offset-chunked authenticatorLargeBlobs write into a caller-owned buffer. More...

#include <LargeBlobStore.h>

Public Member Functions

void reset ()
 Discards any partial write and returns to the idle state.
LbResult begin (uint8_t *buffer, uint16_t capacity, uint32_t totalLength)
 Begins a write declaring the full serialized length.
LbResult append (uint32_t offset, const uint8_t *data, uint16_t len)
 Appends one fragment at offset.
bool complete () const
 True once the declared length has been fully received.
bool active () const
 True while a write is in progress.
uint16_t nextOffset () const
 Offset the next fragment must start at.
const uint8_t * data () const
 Pointer to the accumulated buffer (valid after begin).
uint16_t length () const
 Declared total length of the current write.

Detailed Description

Accumulates an offset-chunked authenticatorLargeBlobs write into a caller-owned buffer.

Definition at line 41 of file LargeBlobStore.h.

Member Function Documentation

◆ active()

bool cdc::mod_fido2::LargeBlobWriteSession::active ( ) const
inline

True while a write is in progress.

Definition at line 67 of file LargeBlobStore.h.

◆ append()

LbResult cdc::mod_fido2::LargeBlobWriteSession::append ( uint32_t offset,
const uint8_t * data,
uint16_t len )

Appends one fragment at offset.

Parameters
offsetByte offset of this fragment; must equal nextOffset.
dataFragment bytes (may be null when len is 0).
lenFragment length.
Returns
Ok, BadSeq (no session or wrong offset), or BadLength (overrun).

Definition at line 44 of file LargeBlobStore.cpp.

References cdc::mod_fido2::BadLength, cdc::mod_fido2::BadSeq, data(), and cdc::mod_fido2::Ok.

◆ begin()

LbResult cdc::mod_fido2::LargeBlobWriteSession::begin ( uint8_t * buffer,
uint16_t capacity,
uint32_t totalLength )

Begins a write declaring the full serialized length.

Parameters
bufferDestination buffer owned by the caller.
capacityCapacity of buffer in bytes.
totalLengthDeclared array length, valid range 17..min(capacity,1024).
Returns
Ok, StorageFull (too large), or BadLength (< 17).

Definition at line 28 of file LargeBlobStore.cpp.

References cdc::mod_fido2::BadLength, cdc::mod_fido2::kLargeBlobEmptyLen, cdc::mod_fido2::kLargeBlobMaxArray, cdc::mod_fido2::Ok, and cdc::mod_fido2::StorageFull.

◆ complete()

bool cdc::mod_fido2::LargeBlobWriteSession::complete ( ) const
inline

True once the declared length has been fully received.

Definition at line 65 of file LargeBlobStore.h.

◆ data()

const uint8_t * cdc::mod_fido2::LargeBlobWriteSession::data ( ) const
inline

Pointer to the accumulated buffer (valid after begin).

Definition at line 71 of file LargeBlobStore.h.

Referenced by append().

◆ length()

uint16_t cdc::mod_fido2::LargeBlobWriteSession::length ( ) const
inline

Declared total length of the current write.

Definition at line 73 of file LargeBlobStore.h.

◆ nextOffset()

uint16_t cdc::mod_fido2::LargeBlobWriteSession::nextOffset ( ) const
inline

Offset the next fragment must start at.

Definition at line 69 of file LargeBlobStore.h.

◆ reset()

void cdc::mod_fido2::LargeBlobWriteSession::reset ( )

Discards any partial write and returns to the idle state.

Definition at line 20 of file LargeBlobStore.cpp.


The documentation for this class was generated from the following files: