[pending-dataset] MGMT_PENDING_GET.rsp must include Delay Timer TLV (#2166)

This commit is contained in:
rongli
2017-09-07 08:41:21 -07:00
committed by Jonathan Hui
parent 2903bfd963
commit 3744c10eec
+19
View File
@@ -373,6 +373,25 @@ void DatasetManager::Get(const Coap::Header &aHeader, const Message &aMessage,
offset += sizeof(tlv) + tlv.GetLength();
}
// MGMT_PENDING_GET.rsp must include Delay Timer TLV (Thread 1.1.1 Section 8.7.5.4)
if (length != 0 && strcmp(mUriGet, OT_URI_PATH_PENDING_GET) == 0)
{
uint16_t i;
for (i = 0; i < length; i++)
{
if (tlvs[i] == Tlv::kDelayTimer)
{
break;
}
}
if (i == length && (i + 1u) <= sizeof(tlvs))
{
tlvs[length++] = Tlv::kDelayTimer;
}
}
SendGetResponse(aHeader, aMessageInfo, tlvs, length);
}