[mle-tlvs] add LeaderDataTlv::Clear() (#4315)

This commit is contained in:
Abtin Keshavarzian
2019-12-04 12:42:33 -08:00
committed by Jonathan Hui
parent 173d545466
commit f830a8b1ba
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -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();
+6
View File
@@ -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.
*