class FrameData
Defined at line 51 of file ../../third_party/openthread/src/core/common/frame_data.hpp
Represents a frame `Data` which is simply a wrapper over a pointer to a buffer with a given frame length.
It provide helper method to parse the content. As data is parsed and read, the `FrameData` is updated to skip over
the read content.
Public Methods
bool CanRead (uint16_t aLength)
Indicates whether or not there are enough bytes remaining in the `FrameData` to read a given number
of bytes.
Parameters
Defined at line 63 of file ../../third_party/openthread/src/core/common/frame_data.hpp
template <typename ObjectType>
Error Read (ObjectType & aObject)
Reads an object from the `FrameData`.
Parameters
Template Parameters
Defined at line 118 of file ../../third_party/openthread/src/core/common/frame_data.hpp
template <typename ObjectType>
const ObjectType * Read ()
Reads an object from the `FrameData` without copying.
Template Parameters
Defined at line 133 of file ../../third_party/openthread/src/core/common/frame_data.hpp
Error ReadUint8 (uint8_t & aUint8)
Reads an `uint8_t` value from the `FrameData`.
If read successfully, the `FrameData` is updated to skip over the read content.
Parameters
template <Encoding kEncoding, typename UintType>
Error ReadUint (UintType & aUint)
Reads an integer value with a specified encoding from the `FrameData`.
The value is read from the frame data, converted from the specified
byte order to
host byte order, and returned in
If read successfully, the `FrameData` is updated to skip over the read content.
Parameters
Template Parameters
Error ReadBytes (void * aBuffer, uint16_t aLength)
Reads a given number of bytes from the `FrameData`.
If read successfully, the `FrameData` is updated to skip over the read content.
Parameters
void SkipOver (uint16_t aLength)
Skips over a given number of bytes from `FrameData`.
The caller MUST make sure that the
is smaller than current data length. Otherwise the behavior of
this method is undefined.
Parameters
Error RemoveFooter (uint16_t aLength)
Removes a footer of a given length from the end of the `FrameData`.