class FrameWritePointer

Defined at line 61 of file ../../third_party/openthread/src/lib/spinel/multi_frame_buffer.hpp

Defines a frame write pointer.

Defines the minimum set of APIs used by `Encoder/Decoder` for writing an encoded/decoded frame. It is

simply a wrapper over a pointer into a buffer indicating where next byte should be written. Along with a write

pointer, this class stores a remaining length variable indicating number of remaining bytes that can be written into

the buffer.

Two template sub-class `FrameBuffer` and `MultiFrameBuffer` are defined which respectively allow storing a single

frame or multiple frames (FIFO queue of frame) in a buffer of a given size.

Protected Members

uint8_t * mWritePointer
uint16_t mRemainingLength

Public Methods

bool CanWrite (uint16_t aWriteLength)

Indicates whether there is buffer space available to write

bytes.

param[in] aWriteLength Number of bytes to write.

Defined at line 72 of file ../../third_party/openthread/src/lib/spinel/multi_frame_buffer.hpp

otError WriteByte (uint8_t aByte)

Writes a byte into the buffer and updates the write pointer (if space is available).

Parameters

aByte [in] A byte to be written to the buffer.

Defined at line 82 of file ../../third_party/openthread/src/lib/spinel/multi_frame_buffer.hpp

void UndoLastWrites (uint16_t aUndoLength)

Undoes the last

writes, removing them from frame.

Parameters

aUndoLength [in] Number of bytes to remove (number of last `WriteByte()` calls to undo).

Defined at line 97 of file ../../third_party/openthread/src/lib/spinel/multi_frame_buffer.hpp

Protected Methods

void FrameWritePointer ()

Defined at line 104 of file ../../third_party/openthread/src/lib/spinel/multi_frame_buffer.hpp