class HeaderIe

Defined at line 61 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

Implements IEEE 802.15.4 IE (Information Element) generation and parsing.

Public Members

static const uint8_t kMaxLength

Public Methods

uint8_t GetId ()

Returns the IE Element ID.

Defined at line 71 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

uint8_t GetLength ()

Returns the IE content length.

Defined at line 78 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

uint8_t GetSize ()

Returns the total size of the Header IE (descriptor header plus content length) in bytes.

Defined at line 87 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

const uint8_t * GetContent ()

Returns a pointer to the IE content bytes.

Defined at line 94 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

uint8_t * GetContent ()

Returns a pointer to the IE content bytes.

Defined at line 101 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

Error StartIe (FrameBuilder & aBuilder, uint8_t aId, Bookmark & aBookmark)

Starts appending a (variable-length) `HeaderIe` in a `FrameBuilder`.

On success, this method appends a `HeaderIe` descriptor (with length initialized to zero) to

and

saves the current byte offset as

The caller can then append the IE content bytes to

and finally call `EndIe()` to update the IE length field automatically.

Parameters

aBuilder [in,out] The `FrameBuilder` instance to append to.
aId [in] The IE Element ID.
aBookmark [out] A reference to a `Bookmark` to save the start offset.
Error EndIe (FrameBuilder & aBuilder, const Bookmark & aBookmark)

Finishes appending a `HeaderIe` in a `FrameBuilder`.

This method updates the length field of the `HeaderIe` previously started using `StartIe()`. It determines the

IE length based on the number of bytes appended to

since `StartIe()` was called.

Parameters

aBuilder [in,out] The `FrameBuilder` instance.
aBookmark [in] The `Bookmark` used when calling `StartIe()`.
template <typename IeType>
bool ValidateAs (const HeaderIe & aIe)

Validates whether a given Header IE matches a specific IE subclass.

This method checks whether

matches the Element ID of

(`IeType::kId`) and also casts

to

to validate its content structure via `IeType::IsValid()`.

Parameters

aIe [in] The Header IE to validate.

Template Parameters

IeType The IE subclass type to validate against.

Defined at line 116 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

Protected Methods

uint8_t * GetBytes ()

Defined at line 158 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

const uint8_t * GetBytes ()

Defined at line 159 of file ../../third_party/openthread/src/core/mac/mac_header_ie.hpp

void Init (uint8_t aId, uint8_t aLen)