mirror of
https://github.com/espressif/openthread.git
synced 2026-08-18 08:29:52 +00:00
[mle-tlvs] add LeaderDataTlv::Clear() (#4315)
This commit is contained in:
committed by
Jonathan Hui
parent
173d545466
commit
f830a8b1ba
@@ -114,8 +114,8 @@ Mle::Mle(Instance &aInstance)
|
||||
{
|
||||
otMeshLocalPrefix meshLocalPrefix;
|
||||
|
||||
memset(&mLeaderData, 0, sizeof(mLeaderData));
|
||||
memset(&mParentLeaderData, 0, sizeof(mParentLeaderData));
|
||||
mLeaderData.Clear();
|
||||
mParentLeaderData.Clear();
|
||||
mParent.Clear();
|
||||
memset(&mChildIdRequest, 0, sizeof(mChildIdRequest));
|
||||
mParentCandidate.Clear();
|
||||
|
||||
@@ -976,6 +976,12 @@ OT_TOOL_PACKED_BEGIN
|
||||
class LeaderDataTlv : public Tlv
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* This method clears the object (setting all fields to zero).
|
||||
*
|
||||
*/
|
||||
void Clear(void) { memset(this, 0, sizeof(*this)); }
|
||||
|
||||
/**
|
||||
* This method initializes the TLV.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user