Fix an incorrect Tlv append operation and Dump output JOIN_FIN.req (#978)

* Fix an incorrect Tlv append operation in Joiner::SendJoinerFinalize()

* Dump output JOIN_FIN.req for certification test
This commit is contained in:
Shu Chen
2016-11-16 17:41:41 +08:00
committed by Jonathan Hui
parent 5431f22e31
commit fc73bc35ef
4 changed files with 18 additions and 5 deletions
-1
View File
@@ -37,7 +37,6 @@
#include <common/debug.hpp>
#include <common/logging.hpp>
#include <common/message.hpp>
#include <common/logging.hpp>
#include <net/ip6.hpp>
namespace Thread {
+8 -1
View File
@@ -799,7 +799,14 @@ void Commissioner::HandleJoinerFinalize(Coap::Header &aHeader, Message &aMessage
}
}
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.req");
#if OPENTHREAD_ENABLE_CERT_LOG
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
VerifyOrExit(aMessage.GetLength() <= sizeof(buf), ;);
aMessage.Read(aHeader.GetLength(), aMessage.GetLength() - aHeader.GetLength(), buf);
otDumpCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.req |", buf, aMessage.GetLength() - aHeader.GetLength());
exit:
#endif
SendJoinFinalizeResponse(aHeader, state);
+9 -2
View File
@@ -207,13 +207,20 @@ void Joiner::SendJoinerFinalize(void)
if (length > 0)
{
SuccessOrExit(error = message->Append(&stateTlv, length + sizeof(Tlv)));
SuccessOrExit(error = message->Append(&mSecureCoapClient.GetDtls().mProvisioningUrl, length + sizeof(Tlv)));
}
#if OPENTHREAD_ENABLE_CERT_LOG
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
VerifyOrExit(message->GetLength() <= sizeof(buf), ;);
message->Read(header.GetLength(), message->GetLength() - header.GetLength(), buf);
otDumpCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.req |", buf, message->GetLength() - header.GetLength());
#endif
mSecureCoapClient.SendMessage(*message, Joiner::HandleJoinerFinalizeResponse, this);
otLogInfoMeshCoP("Sent joiner finalize");
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.req");
exit:
if (error != kThreadError_None && message != NULL)
+1 -1
View File
@@ -419,7 +419,7 @@ ThreadError JoinerRouter::SendJoinerEntrust(const Ip6::MessageInfo &aMessageInfo
SuccessOrExit(error = mCoapClient.SendMessage(*message, messageInfo));
otLogInfoMeshCoP("Sent joiner entrust length = %d", message->GetLength());
otLogCertMeshCoP("[THCI] direction=send | msg_type=JOIN_ENT.ntf");
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_ENT.ntf");
exit: