Update otLog*() to not require line separators. (#854)

This commit is contained in:
Jonathan Hui
2016-10-20 19:55:12 -07:00
committed by GitHub
parent 5346d81669
commit 35e7fbf733
25 changed files with 194 additions and 199 deletions
+1 -1
View File
@@ -138,6 +138,6 @@ void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat
VerifyOrExit(charsWritten >= 0, logString[offset] = 0);
exit:
fprintf(stderr, "%s\r", logString);
fprintf(stderr, "%s\r\n", logString);
}
+1
View File
@@ -312,6 +312,7 @@ void otCliLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat,
}
Uart::sUartServer->OutputFormatV(aFormat, aAp);
Uart::sUartServer->OutputFormat("\r\n");
}
#ifdef __cplusplus
} // extern "C"
+3 -7
View File
@@ -105,7 +105,7 @@ static void DumpLine(otLogLevel aLogLevel, otLogRegion aLogRegion, const void *a
}
}
otLogDump("%s\n", buf);
otLogDump("%s", buf);
}
void otDump(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aId, const void *aBuf, const size_t aLength)
@@ -115,10 +115,6 @@ void otDump(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aId, const
char buf[80];
char *cur = buf;
#ifndef WINDOWS_LOGGING
otLogDump("\n");
#endif
for (size_t i = 0; i < (width - idlen) / 2 - 5; i++)
{
snprintf(cur, sizeof(buf) - static_cast<size_t>(cur - buf), "=");
@@ -134,7 +130,7 @@ void otDump(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aId, const
cur += strlen(cur);
}
otLogDump("%s\n", buf);
otLogDump("%s", buf);
for (size_t i = 0; i < aLength; i += 16)
{
@@ -149,7 +145,7 @@ void otDump(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aId, const
cur += strlen(cur);
}
otLogDump("%s\n", buf);
otLogDump("%s", buf);
}
#ifdef __cplusplus
+1 -1
View File
@@ -93,7 +93,7 @@ Buffer *MessagePool::NewBuffer(void)
if (mFreeBuffers == NULL)
{
otLogInfoMac("No available message buffer\n");
otLogInfoMac("No available message buffer");
ExitNow();
}
+15 -15
View File
@@ -588,7 +588,7 @@ void Mac::SendBeaconRequest(Frame &aFrame)
aFrame.SetDstAddr(kShortAddrBroadcast);
aFrame.SetCommandId(Frame::kMacCmdBeaconRequest);
otLogInfoMac("Sent Beacon Request\n");
otLogInfoMac("Sent Beacon Request");
}
void Mac::SendBeacon(Frame &aFrame)
@@ -624,7 +624,7 @@ void Mac::SendBeacon(Frame &aFrame)
aFrame.SetPayloadLength(sizeof(*beacon));
otLogInfoMac("Sent Beacon\n");
otLogInfoMac("Sent Beacon");
}
void Mac::HandleBeginTransmit(void *aContext)
@@ -749,7 +749,7 @@ void Mac::HandleBeginTransmit(void)
if (sendFrame.GetAckRequest() && !(otPlatRadioGetCaps(mNetif.GetInstance()) & kRadioCapsAckTimeout))
{
mMacTimer.Start(kAckTimeout);
otLogDebgMac("ack timer start\n");
otLogDebgMac("ack timer start");
}
if (mPcapCallback)
@@ -851,7 +851,7 @@ void Mac::HandleMacTimer(void)
break;
case kStateTransmitData:
otLogDebgMac("ack timer fired\n");
otLogDebgMac("ack timer fired");
mCounters.mTxTotal++;
SentFrame(kThreadError_NoAck);
break;
@@ -872,7 +872,7 @@ void Mac::HandleReceiveTimer(void *aContext)
void Mac::HandleReceiveTimer(void)
{
otLogInfoMac("data poll timeout!\n");
otLogInfoMac("data poll timeout!");
if (mState == kStateIdle)
{
@@ -999,7 +999,7 @@ ThreadError Mac::ProcessReceiveSecurity(Frame &aFrame, const Address &aSrcAddr,
aFrame.GetSecurityLevel(securityLevel);
aFrame.GetFrameCounter(frameCounter);
otLogDebgMac("Frame counter %u\n", frameCounter);
otLogDebgMac("Frame counter %u", frameCounter);
aFrame.GetKeyIdMode(keyIdMode);
@@ -1140,11 +1140,11 @@ void Mac::ReceiveDoneTask(Frame *aFrame, ThreadError aError)
break;
case sizeof(ShortAddress):
otLogDebgMac("Received from short address %x\n", srcaddr.mShortAddress);
otLogDebgMac("Received from short address %x", srcaddr.mShortAddress);
if (neighbor == NULL)
{
otLogDebgMac("drop not neighbor\n");
otLogDebgMac("drop not neighbor");
ExitNow(error = kThreadError_UnknownNeighbor);
}
@@ -1162,7 +1162,7 @@ void Mac::ReceiveDoneTask(Frame *aFrame, ThreadError aError)
// Duplicate Address Protection
if (memcmp(&srcaddr.mExtAddress, &mExtAddress, sizeof(srcaddr.mExtAddress)) == 0)
{
otLogDebgMac("duplicate address received\n");
otLogDebgMac("duplicate address received");
ExitNow(error = kThreadError_InvalidSourceAddress);
}
@@ -1320,7 +1320,7 @@ ThreadError Mac::HandleMacCommand(Frame &aFrame)
{
case Frame::kMacCmdBeaconRequest:
mCounters.mRxBeaconRequest++;
otLogInfoMac("Received Beacon Request\n");
otLogInfoMac("Received Beacon Request");
mTransmitBeacon = true;
@@ -1385,7 +1385,7 @@ otMacCounters &Mac::GetCounters(void)
void Mac::EnableSrcMatch(bool aEnable)
{
otPlatRadioEnableSrcMatch(mNetif.GetInstance(), aEnable);
otLogDebgMac("Enable SrcMatch -- %d(0:Dis, 1:En)\n", aEnable);
otLogDebgMac("Enable SrcMatch -- %d(0:Dis, 1:En)", aEnable);
}
ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
@@ -1395,7 +1395,7 @@ ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
if (aAddr.mLength == 2)
{
error = otPlatRadioAddSrcMatchShortEntry(mNetif.GetInstance(), aAddr.mShortAddress);
otLogDebgMac("Adding short address: 0x%x -- %d (0:Ok, 3:NoBufs)\n", aAddr.mShortAddress, error);
otLogDebgMac("Adding short address: 0x%x -- %d (0:Ok, 3:NoBufs)", aAddr.mShortAddress, error);
}
else
{
@@ -1407,7 +1407,7 @@ ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
}
error = otPlatRadioAddSrcMatchExtEntry(mNetif.GetInstance(), buf);
otLogDebgMac("Adding extended address: 0x%02x%02x%02x%02x%02x%02x%02x%02x -- %d (0:OK, 3:NoBufs)\n",
otLogDebgMac("Adding extended address: 0x%02x%02x%02x%02x%02x%02x%02x%02x -- %d (0:OK, 3:NoBufs)",
buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0], error);
}
@@ -1421,7 +1421,7 @@ ThreadError Mac::ClearSrcMatchEntry(Address &aAddr)
if (aAddr.mLength == 2)
{
error = otPlatRadioClearSrcMatchShortEntry(mNetif.GetInstance(), aAddr.mShortAddress);
otLogDebgMac("Clearing short address: 0x%x -- %d (0:OK, 10:NoAddress)\n", aAddr.mShortAddress, error);
otLogDebgMac("Clearing short address: 0x%x -- %d (0:OK, 10:NoAddress)", aAddr.mShortAddress, error);
}
else
{
@@ -1433,7 +1433,7 @@ ThreadError Mac::ClearSrcMatchEntry(Address &aAddr)
}
error = otPlatRadioClearSrcMatchExtEntry(mNetif.GetInstance(), buf);
otLogDebgMac("Clearing extended address: 0x%02x%02x%02x%02x%02x%02x%02x%02x -- %d (0:OK, 10:NoAddress)\n",
otLogDebgMac("Clearing extended address: 0x%02x%02x%02x%02x%02x%02x%02x%02x -- %d (0:OK, 10:NoAddress)",
buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0], error);
}
+17 -17
View File
@@ -340,7 +340,7 @@ ThreadError Commissioner::SendMgmtCommissionerGetRequest(const uint8_t *aTlvs,
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent MGMT_COMMISSIONER_GET.req to leader\n");
otLogInfoMeshCoP("sent MGMT_COMMISSIONER_GET.req to leader");
exit:
@@ -424,7 +424,7 @@ ThreadError Commissioner::SendMgmtCommissionerSetRequest(const otCommissioningDa
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent MGMT_COMMISSIONER_SET.req to leader\n");
otLogInfoMeshCoP("sent MGMT_COMMISSIONER_SET.req to leader");
exit:
@@ -483,7 +483,7 @@ ThreadError Commissioner::SendPetition(void)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent petition\n");
otLogInfoMeshCoP("sent petition");
exit:
@@ -545,7 +545,7 @@ ThreadError Commissioner::SendKeepAlive(void)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent keep alive\n");
otLogInfoMeshCoP("sent keep alive");
exit:
@@ -593,7 +593,7 @@ void Commissioner::HandleRelayReceive(Coap::Header &aHeader, Message &aMessage,
mJoinerPort = joinerPort.GetUdpPort();
mJoinerRloc = joinerRloc.GetJoinerRouterLocator();
otLogInfoMeshCoP("Received relay receive for %llX, rloc:%x\n", HostSwap64(mJoinerIid64), mJoinerRloc);
otLogInfoMeshCoP("Received relay receive for %llX, rloc:%x", HostSwap64(mJoinerIid64), mJoinerRloc);
if (!mNetif.GetDtls().IsStarted())
{
@@ -611,7 +611,7 @@ void Commissioner::HandleRelayReceive(Coap::Header &aHeader, Message &aMessage,
SuccessOrExit(error = mNetif.GetDtls().SetPsk(reinterpret_cast<const uint8_t *>(mJoiners[i].mPsk),
static_cast<uint8_t>(strlen(mJoiners[i].mPsk))));
SuccessOrExit(error = mNetif.GetDtls().Start(false, HandleDtlsReceive, HandleDtlsSend, this));
otLogInfoMeshCoP("found joiner, starting new session\n");
otLogInfoMeshCoP("found joiner, starting new session");
break;
}
}
@@ -641,7 +641,7 @@ void Commissioner::HandleDatasetChanged(Coap::Header &aHeader, Message &aMessage
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, ;);
otLogInfoMeshCoP("received dataset changed\n");
otLogInfoMeshCoP("received dataset changed");
(void)aMessage;
SendDatasetChangedResponse(aHeader, aMessageInfo);
@@ -667,7 +667,7 @@ void Commissioner::SendDatasetChangedResponse(const Coap::Header &aRequestHeader
SuccessOrExit(error = message->Append(responseHeader.GetBytes(), responseHeader.GetLength()));
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("Sent dataset changed acknowledgment\n");
otLogInfoMeshCoP("Sent dataset changed acknowledgment");
exit:
@@ -704,7 +704,7 @@ void Commissioner::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
{
mIsSendMgmtCommRequest = false;
otLogInfoMeshCoP("received MGMT_COMMISSIONER_SET and MGMT_COMMISSIONER_GET response\n");
otLogInfoMeshCoP("received MGMT_COMMISSIONER_SET and MGMT_COMMISSIONER_GET response");
ExitNow();
}
@@ -724,7 +724,7 @@ void Commissioner::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
VerifyOrExit(sessionId.IsValid(), ;);
mSessionId = sessionId.GetCommissionerSessionId();
otLogInfoMeshCoP("received petition response\n");
otLogInfoMeshCoP("received petition response");
mState = kStateActive;
mTransmitAttempts = 0;
@@ -732,7 +732,7 @@ void Commissioner::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
break;
case kStateActive:
otLogInfoMeshCoP("received keep alive response\n");
otLogInfoMeshCoP("received keep alive response");
mTransmitAttempts = 0;
mTimer.Start(Timer::SecToMsec(kKeepAliveTimeout) / 2);
break;
@@ -745,7 +745,7 @@ exit:
ThreadError Commissioner::HandleDtlsSend(void *aContext, const uint8_t *aBuf, uint16_t aLength)
{
otLogInfoMeshCoP("Commissioner::HandleDtlsTransmit\n");
otLogInfoMeshCoP("Commissioner::HandleDtlsTransmit");
return static_cast<Commissioner *>(aContext)->HandleDtlsSend(aBuf, aLength);
}
@@ -818,7 +818,7 @@ exit:
void Commissioner::HandleDtlsReceive(void *aContext, uint8_t *aBuf, uint16_t aLength)
{
otLogInfoMeshCoP("Commissioner::HandleDtlsReceive\n");
otLogInfoMeshCoP("Commissioner::HandleDtlsReceive");
static_cast<Commissioner *>(aContext)->HandleDtlsReceive(aBuf, aLength);
}
@@ -831,7 +831,7 @@ void Commissioner::HandleDtlsReceive(uint8_t *aBuf, uint16_t aLength)
void Commissioner::HandleUdpTransmit(void *aContext)
{
otLogInfoMeshCoP("Commissioner::HandleUdpTransmit\n");
otLogInfoMeshCoP("Commissioner::HandleUdpTransmit");
static_cast<Commissioner *>(aContext)->HandleUdpTransmit();
}
@@ -879,7 +879,7 @@ void Commissioner::ReceiveJoinerFinalize(uint8_t *buf, uint16_t length)
ProvisioningUrlTlv provisioningUrl;
otLogFuncEntry();
otLogInfoMeshCoP("receive joiner finalize 1\n");
otLogInfoMeshCoP("receive joiner finalize");
VerifyOrExit((message = mNetif.GetIp6().mMessagePool.New(Message::kTypeIp6, 0)) != NULL, ;);
SuccessOrExit(message->Append(buf, length));
@@ -967,8 +967,8 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Header &aRequestHeader,
mNetif.GetDtls().Send(buf, static_cast<uint16_t>(cur - buf));
mSendKek = false;
otLogInfoMeshCoP("sent joiner finalize response\n");
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.rsp\n");
otLogInfoMeshCoP("sent joiner finalize response");
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.rsp");
otLogFuncExit();
}
+10 -10
View File
@@ -121,7 +121,7 @@ ThreadError Dtls::Start(bool aClient, ReceiveHandler aReceiveHandler, SendHandle
mStarted = true;
Process();
otLogInfoMeshCoP("DTLS started\n");
otLogInfoMeshCoP("DTLS started");
exit:
return MapError(rval);
@@ -200,7 +200,7 @@ int Dtls::HandleMbedtlsTransmit(const unsigned char *aBuf, size_t aLength)
ThreadError error;
int rval = 0;
otLogInfoMeshCoP("Dtls::HandleMbedtlsTransmit\n");
otLogInfoMeshCoP("Dtls::HandleMbedtlsTransmit");
error = mSendHandler(mContext, aBuf, (uint16_t)aLength);
@@ -231,7 +231,7 @@ int Dtls::HandleMbedtlsReceive(unsigned char *aBuf, size_t aLength)
{
int rval;
otLogInfoMeshCoP("Dtls::HandleMbedtlsReceive\n");
otLogInfoMeshCoP("Dtls::HandleMbedtlsReceive");
VerifyOrExit(mReceiveMessage != NULL && mReceiveLength != 0, rval = MBEDTLS_ERR_SSL_WANT_READ);
@@ -257,7 +257,7 @@ int Dtls::HandleMbedtlsGetTimer(void)
{
int rval;
otLogInfoMeshCoP("Dtls::HandleMbedtlsGetTimer\n");
otLogInfoMeshCoP("Dtls::HandleMbedtlsGetTimer");
if (!mTimerSet)
{
@@ -286,7 +286,7 @@ void Dtls::HandleMbedtlsSetTimer(void *aContext, uint32_t aIntermediate, uint32_
void Dtls::HandleMbedtlsSetTimer(uint32_t aIntermediate, uint32_t aFinish)
{
otLogInfoMeshCoP("Dtls::SetTimer\n");
otLogInfoMeshCoP("Dtls::SetTimer");
if (aFinish == 0)
{
@@ -320,7 +320,7 @@ int Dtls::HandleMbedtlsExportKeys(const unsigned char *aMasterSecret, const unsi
mNetif.GetKeyManager().SetKek(kek);
otLogInfoMeshCoP("Generated KEK\n");
otLogInfoMeshCoP("Generated KEK");
(void)aMasterSecret;
return 0;
@@ -439,20 +439,20 @@ void Dtls::HandleMbedtlsDebug(void *, int level, const char *, int , const char
switch (level)
{
case 1:
otLogCritMbedTls("%s\n", str);
otLogCritMbedTls("%s", str);
break;
case 2:
otLogWarnMbedTls("%s\n", str);
otLogWarnMbedTls("%s", str);
break;
case 3:
otLogInfoMbedTls("%s\n", str);
otLogInfoMbedTls("%s", str);
break;
case 4:
default:
otLogDebgMbedTls("%s\n", str);
otLogDebgMbedTls("%s", str);
break;
}
}
+3 -3
View File
@@ -132,7 +132,7 @@ ThreadError EnergyScanClient::SendQuery(uint32_t aChannelMask, uint8_t aCount, u
messageInfo.mInterfaceId = mNetif.GetInterfaceId();
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent energy scan query\n");
otLogInfoMeshCoP("sent energy scan query");
mCallback = aCallback;
mContext = aContext;
@@ -173,7 +173,7 @@ void EnergyScanClient::HandleReport(Coap::Header &aHeader, Message &aMessage, co
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, ;);
otLogInfoMeshCoP("received energy scan report\n");
otLogInfoMeshCoP("received energy scan report");
SuccessOrExit(MeshCoP::Tlv::GetTlv(aMessage, MeshCoP::Tlv::kChannelMask, sizeof(channelMask), channelMask.tlv));
VerifyOrExit(channelMask.tlv.IsValid() &&
@@ -227,7 +227,7 @@ exit:
void EnergyScanClient::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
{
otLogInfoMeshCoP("received energy scan query response\n");
otLogInfoMeshCoP("received energy scan query response");
(void)aContext;
(void)aMessage;
(void)aMessageInfo;
+12 -12
View File
@@ -140,7 +140,7 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult)
}
else
{
otLogDebgMeshCoP("Steering data not set\n");
otLogDebgMeshCoP("Steering data not set");
}
}
else if (mJoinerRouterPanId != Mac::kPanIdBroadcast)
@@ -165,7 +165,7 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult)
ThreadError Joiner::HandleDtlsSend(void *aContext, const uint8_t *aBuf, uint16_t aLength)
{
otLogInfoMeshCoP("Joiner::HandleDtlsTransmit\n");
otLogInfoMeshCoP("Joiner::HandleDtlsTransmit");
return static_cast<Joiner *>(aContext)->HandleDtlsSend(aBuf, aLength);
}
@@ -198,7 +198,7 @@ exit:
void Joiner::HandleDtlsReceive(void *aContext, uint8_t *aBuf, uint16_t aLength)
{
otLogInfoMeshCoP("Joiner::HandleDtlsReceive\n");
otLogInfoMeshCoP("Joiner::HandleDtlsReceive");
static_cast<Joiner *>(aContext)->HandleDtlsReceive(aBuf, aLength);
}
@@ -209,7 +209,7 @@ void Joiner::HandleDtlsReceive(uint8_t *aBuf, uint16_t aLength)
void Joiner::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
{
otLogInfoMeshCoP("Joiner::HandleUdpReceive\n");
otLogInfoMeshCoP("Joiner::HandleUdpReceive");
static_cast<Joiner *>(aContext)->HandleUdpReceive(*static_cast<Message *>(aMessage),
*static_cast<const Ip6::MessageInfo *>(aMessageInfo));
}
@@ -231,7 +231,7 @@ void Joiner::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessag
void Joiner::HandleUdpTransmit(void *aContext)
{
otLogInfoMeshCoP("Joiner::HandleUdpTransmit\n");
otLogInfoMeshCoP("Joiner::HandleUdpTransmit");
static_cast<Joiner *>(aContext)->HandleUdpTransmit();
}
@@ -244,7 +244,7 @@ void Joiner::HandleUdpTransmit(void)
VerifyOrExit(mTransmitMessage != NULL, error = kThreadError_NoBufs);
otLogInfoMeshCoP("transmit %d (to %llX)\n", mTransmitMessage->GetLength(),
otLogInfoMeshCoP("transmit %d (to %llX)", mTransmitMessage->GetLength(),
HostSwap64(*reinterpret_cast<uint64_t *>(&mJoinerRouter)));
memset(&messageInfo, 0, sizeof(messageInfo));
@@ -302,7 +302,7 @@ void Joiner::SendJoinerFinalize(void)
mNetif.GetDtls().Send(buf, static_cast<uint16_t>(cur - buf));
otLogInfoMeshCoP("Sent joiner finalize\n");
otLogInfoMeshCoP("Sent joiner finalize");
otDumpCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.req |", buf + header.GetLength(),
cur - buf - header.GetLength());
otLogFuncExit();
@@ -329,8 +329,8 @@ void Joiner::ReceiveJoinerFinalizeResponse(uint8_t *buf, uint16_t length)
SuccessOrExit(Tlv::GetTlv(*message, Tlv::kState, sizeof(state), state));
VerifyOrExit(state.IsValid(), ;);
otLogInfoMeshCoP("received joiner finalize response %d\n", static_cast<uint8_t>(state.GetState()));
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.rsp\n");
otLogInfoMeshCoP("received joiner finalize response %d", static_cast<uint8_t>(state.GetState()));
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.rsp");
Close();
@@ -365,8 +365,8 @@ void Joiner::HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, error = kThreadError_Drop);
otLogInfoMeshCoP("Received joiner entrust\n");
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_ENT.ntf\n");
otLogInfoMeshCoP("Received joiner entrust");
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_ENT.ntf");
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kNetworkMasterKey, sizeof(masterKey), masterKey));
VerifyOrExit(masterKey.IsValid(), error = kThreadError_Parse);
@@ -388,7 +388,7 @@ void Joiner::HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const
mNetif.GetMac().SetExtendedPanId(extendedPanId.GetExtendedPanId());
mNetif.GetMac().SetNetworkName(networkName.GetNetworkName());
otLogInfoMeshCoP("join success!\n");
otLogInfoMeshCoP("join success!");
// Delay extended address configuration to allow DTLS wrap up.
mTimer.Start(kConfigExtAddressDelay);
+7 -7
View File
@@ -91,7 +91,7 @@ void JoinerRouter::HandleNetifStateChanged(uint32_t aFlags)
mSocket.Open(&JoinerRouter::HandleUdpReceive, this);
mSocket.Bind(sockaddr);
mNetif.GetIp6Filter().AddUnsecurePort(sockaddr.mPort);
otLogInfoMeshCoP("Joiner Router: start\n");
otLogInfoMeshCoP("Joiner Router: start");
}
else
{
@@ -188,7 +188,7 @@ void JoinerRouter::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
otLogFuncEntryMsg("from peer: %llX",
HostSwap64(*reinterpret_cast<const uint64_t *>(aMessageInfo.GetPeerAddr().mFields.m8 + 8)));
otLogInfoMeshCoP("JoinerRouter::HandleUdpReceive\n");
otLogInfoMeshCoP("JoinerRouter::HandleUdpReceive");
SuccessOrExit(error = GetBorderAgentRloc(borderAgentRloc));
@@ -244,7 +244,7 @@ void JoinerRouter::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("Sent relay rx\n");
otLogInfoMeshCoP("Sent relay rx");
exit:
@@ -277,7 +277,7 @@ void JoinerRouter::HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage,
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeNonConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, error = kThreadError_Drop);
otLogInfoMeshCoP("Received relay transmit\n");
otLogInfoMeshCoP("Received relay transmit");
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kJoinerUdpPort, sizeof(joinerPort), joinerPort));
VerifyOrExit(joinerPort.IsValid(), error = kThreadError_Parse);
@@ -319,7 +319,7 @@ void JoinerRouter::HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage,
if (Tlv::GetTlv(aMessage, Tlv::kJoinerRouterKek, sizeof(kek), kek) == kThreadError_None)
{
otLogInfoMeshCoP("Received kek\n");
otLogInfoMeshCoP("Received kek");
mNetif.GetKeyManager().SetKek(kek.GetKek());
SendJoinerEntrust(messageInfo);
}
@@ -425,8 +425,8 @@ ThreadError JoinerRouter::SendJoinerEntrust(const Ip6::MessageInfo &aMessageInfo
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("Sent joiner entrust length = %d\n", message->GetLength());
otLogCertMeshCoP("[THCI] direction=send | msg_type=JOIN_ENT.ntf\n");
otLogInfoMeshCoP("Sent joiner entrust length = %d", message->GetLength());
otLogCertMeshCoP("[THCI] direction=send | msg_type=JOIN_ENT.ntf");
exit:
+8 -8
View File
@@ -75,7 +75,7 @@ void Leader::HandlePetition(Coap::Header &aHeader, Message &aMessage, const Ip6:
CommissionerIdTlv commissionerId;
StateTlv::State state = StateTlv::kReject;
otLogInfoMeshCoP("received petition\n");
otLogInfoMeshCoP("received petition");
SuccessOrExit(Tlv::GetTlv(aMessage, Tlv::kCommissionerId, sizeof(commissionerId), commissionerId));
VerifyOrExit(commissionerId.IsValid(), ;);
@@ -140,7 +140,7 @@ ThreadError Leader::SendPetitionResponse(const Coap::Header &aRequestHeader, con
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("sent petition response\n");
otLogInfoMeshCoP("sent petition response");
exit:
@@ -164,7 +164,7 @@ void Leader::HandleKeepAlive(Coap::Header &aHeader, Message &aMessage, const Ip6
CommissionerSessionIdTlv sessionId;
StateTlv::State responseState;
otLogInfoMeshCoP("received keep alive\n");
otLogInfoMeshCoP("received keep alive");
SuccessOrExit(Tlv::GetTlv(aMessage, Tlv::kState, sizeof(state), state));
VerifyOrExit(state.IsValid(),);
@@ -181,7 +181,7 @@ void Leader::HandleKeepAlive(Coap::Header &aHeader, Message &aMessage, const Ip6
responseState = StateTlv::kReject;
mTimer.Stop();
mNetworkData.SetCommissioningData(NULL, 0);
otLogInfoMeshCoP("commissioner inactive\n");
otLogInfoMeshCoP("commissioner inactive");
}
else
{
@@ -218,7 +218,7 @@ ThreadError Leader::SendKeepAliveResponse(const Coap::Header &aRequestHeader, co
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("sent keep alive response\n");
otLogInfoMeshCoP("sent keep alive response");
exit:
@@ -232,7 +232,7 @@ exit:
void Leader::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
{
otLogInfoMeshCoP("received dataset changed response\n");
otLogInfoMeshCoP("received dataset changed response");
(void)aContext;
(void)aMessage;
(void)aMessageInfo;
@@ -266,7 +266,7 @@ ThreadError Leader::SendDatasetChanged(const Ip6::Address &aAddress)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent dataset changed\n");
otLogInfoMeshCoP("sent dataset changed");
exit:
@@ -287,7 +287,7 @@ void Leader::HandleTimer(void)
{
VerifyOrExit(mNetif.GetMle().GetDeviceState() == Mle::kDeviceStateLeader, ;);
otLogInfoMeshCoP("commissioner inactive\n");
otLogInfoMeshCoP("commissioner inactive");
mNetworkData.SetCommissioningData(NULL, 0);
exit:
+3 -3
View File
@@ -117,7 +117,7 @@ ThreadError PanIdQueryClient::SendQuery(uint16_t aPanId, uint32_t aChannelMask,
messageInfo.mInterfaceId = mNetif.GetInterfaceId();
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent panid query\n");
otLogInfoMeshCoP("sent panid query");
mCallback = aCallback;
mContext = aContext;
@@ -153,7 +153,7 @@ void PanIdQueryClient::HandleConflict(Coap::Header &aHeader, Message &aMessage,
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, ;);
otLogInfoMeshCoP("received panid conflict\n");
otLogInfoMeshCoP("received panid conflict");
SuccessOrExit(MeshCoP::Tlv::GetTlv(aMessage, MeshCoP::Tlv::kPanId, sizeof(panId), panId));
VerifyOrExit(panId.IsValid(), ;);
@@ -214,7 +214,7 @@ exit:
void PanIdQueryClient::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
{
otLogInfoMeshCoP("received panid query response\n");
otLogInfoMeshCoP("received panid query response");
(void)aContext;
(void)aMessage;
(void)aMessageInfo;
+5 -5
View File
@@ -104,7 +104,7 @@ ThreadError Icmp::SendEchoRequest(Message &aMessage, const MessageInfo &aMessage
aMessage.SetOffset(0);
SuccessOrExit(error = mIp6.SendDatagram(aMessage, messageInfoLocal, kProtoIcmp6));
otLogInfoIcmp("Sent echo request: (seq = %d)\n", icmpHeader.GetSequence());
otLogInfoIcmp("Sent echo request: (seq = %d)", icmpHeader.GetSequence());
exit:
return error;
@@ -133,7 +133,7 @@ ThreadError Icmp::SendError(const Address &aDestination, IcmpHeader::Type aType,
SuccessOrExit(error = mIp6.SendDatagram(*message, messageInfo, kProtoIcmp6));
otLogInfoIcmp("Sent ICMPv6 Error\n");
otLogInfoIcmp("Sent ICMPv6 Error");
exit:
@@ -203,14 +203,14 @@ ThreadError Icmp::HandleEchoRequest(Message &aRequestMessage, const MessageInfo
VerifyOrExit(mIsEchoEnabled, ;);
otLogInfoIcmp("Received Echo Request\n");
otLogInfoIcmp("Received Echo Request");
icmp6Header.Init();
icmp6Header.SetType(IcmpHeader::kTypeEchoReply);
if ((replyMessage = mIp6.NewMessage(0)) == NULL)
{
otLogDebgIcmp("icmp fail\n");
otLogDebgIcmp("icmp fail");
ExitNow();
}
@@ -234,7 +234,7 @@ ThreadError Icmp::HandleEchoRequest(Message &aRequestMessage, const MessageInfo
SuccessOrExit(error = mIp6.SendDatagram(*replyMessage, replyMessageInfo, kProtoIcmp6));
replyMessage->Read(replyMessage->GetOffset(), sizeof(icmp6Header), &icmp6Header);
otLogInfoIcmp("Sent Echo Reply (seq = %d)\n", icmp6Header.GetSequence());
otLogInfoIcmp("Sent Echo Reply (seq = %d)", icmp6Header.GetSequence());
exit:
+2 -2
View File
@@ -1007,7 +1007,7 @@ otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize)
otInstance *aInstance = NULL;
otLogFuncEntry();
otLogInfoApi("otInstanceInit\n");
otLogInfoApi("otInstanceInit");
VerifyOrExit(aInstanceBufferSize != NULL, ;);
@@ -1031,7 +1031,7 @@ otInstance *otInstanceInit()
{
otLogFuncEntry();
otLogInfoApi("otInstanceInit\n");
otLogInfoApi("otInstanceInit");
VerifyOrExit(sInstance == NULL, ;);
+9 -9
View File
@@ -193,7 +193,7 @@ ThreadError AddressResolver::SendAddressQuery(const Ip6::Address &aEid)
SuccessOrExit(error = mCoapClient.SendMessage(*message, messageInfo, NULL, NULL));
otLogInfoArp("Sent address query\n");
otLogInfoArp("Sent address query");
exit:
@@ -228,7 +228,7 @@ void AddressResolver::HandleAddressNotification(Coap::Header &aHeader, Message &
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, ;);
otLogInfoArp("Received address notification from %04x\n", HostSwap16(aMessageInfo.GetPeerAddr().mFields.m16[7]));
otLogInfoArp("Received address notification from %04x", HostSwap16(aMessageInfo.GetPeerAddr().mFields.m16[7]));
SuccessOrExit(ThreadTlv::GetTlv(aMessage, ThreadTlv::kTarget, sizeof(targetTlv), targetTlv));
VerifyOrExit(targetTlv.IsValid(), ;);
@@ -309,7 +309,7 @@ void AddressResolver::SendAddressNotificationResponse(const Coap::Header &aReque
memset(&responseInfo.mSockAddr, 0, sizeof(responseInfo.mSockAddr));
SuccessOrExit(error = mCoapServer.SendMessage(*message, responseInfo));
otLogInfoArp("Sent address notification acknowledgment\n");
otLogInfoArp("Sent address notification acknowledgment");
exit:
@@ -355,7 +355,7 @@ ThreadError AddressResolver::SendAddressError(const ThreadTargetTlv &aTarget, co
SuccessOrExit(error = mCoapClient.SendMessage(*message, messageInfo, NULL, NULL));
otLogInfoArp("Sent address error\n");
otLogInfoArp("Sent address error");
exit:
@@ -385,7 +385,7 @@ void AddressResolver::SendAddressErrorResponse(const Coap::Header &aRequestHeade
memset(&responseInfo.mSockAddr, 0, sizeof(responseInfo.mSockAddr));
SuccessOrExit(error = mCoapServer.SendMessage(*message, responseInfo));
otLogInfoArp("Sent address error notification acknowledgment\n");
otLogInfoArp("Sent address error notification acknowledgment");
exit:
@@ -415,7 +415,7 @@ void AddressResolver::HandleAddressError(Coap::Header &aHeader, Message &aMessag
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, error = kThreadError_Drop);
otLogInfoArp("Received address error notification\n");
otLogInfoArp("Received address error notification");
if (!aMessageInfo.GetSockAddr().IsMulticast())
{
@@ -491,7 +491,7 @@ void AddressResolver::HandleAddressQuery(Coap::Header &aHeader, Message &aMessag
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeNonConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, ;);
otLogInfoArp("Received address query from %04x\n", HostSwap16(aMessageInfo.GetPeerAddr().mFields.m16[7]));
otLogInfoArp("Received address query from %04x", HostSwap16(aMessageInfo.GetPeerAddr().mFields.m16[7]));
SuccessOrExit(ThreadTlv::GetTlv(aMessage, ThreadTlv::kTarget, sizeof(targetTlv), targetTlv));
VerifyOrExit(targetTlv.IsValid(), ;);
@@ -576,7 +576,7 @@ void AddressResolver::SendAddressQueryResponse(const ThreadTargetTlv &aTargetTlv
SuccessOrExit(error = mCoapClient.SendMessage(*message, messageInfo, NULL, NULL));
otLogInfoArp("Sent address notification\n");
otLogInfoArp("Sent address notification");
exit:
@@ -659,7 +659,7 @@ void AddressResolver::HandleDstUnreach(Message &aMessage, const Ip6::MessageInfo
memcmp(&mCache[i].mTarget, &ip6Header.GetDestination(), sizeof(mCache[i].mTarget)) == 0)
{
mCache[i].mState = Cache::kStateInvalid;
otLogInfoArp("cache entry removed!\n");
otLogInfoArp("cache entry removed!");
break;
}
}
+1 -1
View File
@@ -151,7 +151,7 @@ ThreadError AnnounceBeginServer::SendResponse(const Coap::Header &aRequestHeader
memset(&responseInfo.mSockAddr, 0, sizeof(responseInfo.mSockAddr));
SuccessOrExit(error = mCoapServer.SendMessage(*message, responseInfo));
otLogInfoMeshCoP("sent announce begin response\n");
otLogInfoMeshCoP("sent announce begin response");
exit:
+3 -4
View File
@@ -141,7 +141,7 @@ ThreadError EnergyScanServer::SendResponse(const Coap::Header &aRequestHeader, c
memset(&responseInfo.mSockAddr, 0, sizeof(responseInfo.mSockAddr));
SuccessOrExit(error = mCoapServer.SendMessage(*message, responseInfo));
otLogInfoMeshCoP("sent energy scan query response\n");
otLogInfoMeshCoP("sent energy scan query response");
exit:
@@ -166,7 +166,6 @@ void EnergyScanServer::HandleTimer(void)
{
// grab the lowest channel to scan
uint32_t channelMask = mChannelMaskCurrent & ~(mChannelMaskCurrent - 1);
otLogInfoMeshCoP("%x\n", channelMask);
mNetif.GetMac().EnergyScan(channelMask, mScanDuration, HandleScanResult, this);
}
else
@@ -261,7 +260,7 @@ ThreadError EnergyScanServer::SendReport(void)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent scan results\n");
otLogInfoMeshCoP("sent scan results");
exit:
@@ -277,7 +276,7 @@ exit:
void EnergyScanServer::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
{
otLogInfoMeshCoP("received scan report response\n");
otLogInfoMeshCoP("received scan report response");
(void)aContext;
(void)aMessage;
(void)aMessageInfo;
+5 -5
View File
@@ -251,8 +251,8 @@ ThreadError MeshForwarder::AddSrcMatchEntry(Child &aChild)
ThreadError error = kThreadError_NoBufs;
Mac::Address macAddr;
otLogDebgMac("Queuing for child (0x%x)\n", aChild.mValid.mRloc16);
otLogDebgMac("SrcMatch %d (0:Dis, 1:En))\n", mSrcMatchEnabled);
otLogDebgMac("Queuing for child (0x%x)", aChild.mValid.mRloc16);
otLogDebgMac("SrcMatch %d (0:Dis, 1:En))", mSrcMatchEnabled);
// first queued message, to be added into source match table
if (aChild.mQueuedIndirectMessageCnt == 1)
@@ -294,7 +294,7 @@ exit:
void MeshForwarder::ClearSrcMatchEntry(Child &aChild)
{
Mac::Address macAddr;
otLogDebgMac("SrcMatch %d (0:Dis, 1:En))\n", mSrcMatchEnabled);
otLogDebgMac("SrcMatch %d (0:Dis, 1:En))", mSrcMatchEnabled);
if (aChild.mAddSrcMatchEntryShort)
{
@@ -781,7 +781,7 @@ void MeshForwarder::HandlePollTimer()
if ((message = mNetif.GetIp6().mMessagePool.New(Message::kTypeMacDataPoll, 0)) != NULL)
{
SendMessage(*message);
otLogInfoMac("Sent poll\n");
otLogInfoMac("Sent poll");
}
mPollTimer.Start(mPollPeriod);
@@ -1239,7 +1239,7 @@ void MeshForwarder::HandleSentFrame(Mac::Frame &aFrame, ThreadError aError)
if ((child->mMode & Mle::ModeTlv::kModeRxOnWhenIdle) == 0)
{
child->mQueuedIndirectMessageCnt--;
otLogDebgMac("Sent to child (0x%x), still queued message (%d)\n",
otLogDebgMac("Sent to child (0x%x), still queued message (%d)",
child->mValid.mRloc16, child->mQueuedIndirectMessageCnt);
if (child->mQueuedIndirectMessageCnt == 0)
+8 -8
View File
@@ -201,7 +201,7 @@ ThreadError DatasetManager::Register(void)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent dataset to leader\n");
otLogInfoMeshCoP("sent dataset to leader");
exit:
@@ -231,7 +231,7 @@ void DatasetManager::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo
header.GetTokenLength() == sizeof(mCoapToken) &&
memcmp(mCoapToken, header.GetToken(), sizeof(mCoapToken)) == 0, ;);
otLogInfoMeshCoP("received response from leader\n");
otLogInfoMeshCoP("received response from leader");
exit:
return;
@@ -556,7 +556,7 @@ ThreadError DatasetManager::SendSetRequest(const otOperationalDataset &aDataset,
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent dataset set request to leader\n");
otLogInfoMeshCoP("sent dataset set request to leader");
exit:
@@ -607,7 +607,7 @@ ThreadError DatasetManager::SendGetRequest(const uint8_t *aTlvTypes, const uint8
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent dataset get request to leader\n");
otLogInfoMeshCoP("sent dataset get request to leader");
exit:
@@ -642,7 +642,7 @@ void DatasetManager::SendSetResponse(const Coap::Header &aRequestHeader, const I
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("sent dataset set response\n");
otLogInfoMeshCoP("sent dataset set response");
exit:
@@ -687,7 +687,7 @@ void DatasetManager::SendGetResponse(const Coap::Header &aRequestHeader, const I
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("sent dataset get response\n");
otLogInfoMeshCoP("sent dataset get response");
exit:
@@ -974,7 +974,7 @@ void PendingDataset::ResetDelayTimer(uint8_t aFlags)
else
{
mTimer.Start(delayTimer->GetDelayTimer());
otLogInfoMeshCoP("delay timer started\n");
otLogInfoMeshCoP("delay timer started");
}
}
}
@@ -1025,7 +1025,7 @@ void PendingDataset::HandleTimer(void)
{
DelayTimerTlv *delayTimer;
otLogInfoMeshCoP("pending delay timer expired\n");
otLogInfoMeshCoP("pending delay timer expired");
UpdateDelayTimer();
delayTimer = static_cast<DelayTimerTlv *>(mNetwork.Get(Tlv::kDelayTimer));
+21 -21
View File
@@ -294,7 +294,7 @@ ThreadError Mle::Discover(uint32_t aScanChannels, uint16_t aScanDuration, uint16
mIsDiscoverInProgress = true;
otLogInfoMle("Sent discovery request\n");
otLogInfoMle("Sent discovery request");
exit:
@@ -391,7 +391,7 @@ ThreadError Mle::SetStateDetached(void)
mMleRouter.HandleDetachStart();
mNetif.GetIp6().SetForwardingEnabled(false);
otLogInfoMle("Mode -> Detached\n");
otLogInfoMle("Mode -> Detached");
return kThreadError_None;
}
@@ -430,7 +430,7 @@ ThreadError Mle::SetStateChild(uint16_t aRloc16)
mNetif.GetAnnounceBeginServer().SendAnnounce(1 << mPreviousChannel);
}
otLogInfoMle("Mode -> Child\n");
otLogInfoMle("Mode -> Child");
return kThreadError_None;
}
@@ -1253,11 +1253,11 @@ ThreadError Mle::SendParentRequest(void)
switch (mParentRequestState)
{
case kParentRequestRouter:
otLogInfoMle("Sent parent request to routers\n");
otLogInfoMle("Sent parent request to routers");
break;
case kParentRequestChild:
otLogInfoMle("Sent parent request to all devices\n");
otLogInfoMle("Sent parent request to all devices");
break;
default:
@@ -1305,7 +1305,7 @@ ThreadError Mle::SendChildIdRequest(void)
destination.mFields.m16[0] = HostSwap16(0xfe80);
destination.SetIid(mParent.mMacAddr);
SuccessOrExit(error = SendMessage(*message, destination));
otLogInfoMle("Sent Child ID Request\n");
otLogInfoMle("Sent Child ID Request");
if ((mDeviceMode & ModeTlv::kModeRxOnWhenIdle) == 0)
{
@@ -1337,7 +1337,7 @@ ThreadError Mle::SendDataRequest(const Ip6::Address &aDestination, const uint8_t
SuccessOrExit(error = SendMessage(*message, aDestination));
otLogInfoMle("Sent Data Request\n");
otLogInfoMle("Sent Data Request");
exit:
@@ -1414,7 +1414,7 @@ ThreadError Mle::SendChildUpdateRequest(void)
destination.SetIid(mParent.mMacAddr);
SuccessOrExit(error = SendMessage(*message, destination));
otLogInfoMle("Sent Child Update Request\n");
otLogInfoMle("Sent Child Update Request");
if ((mDeviceMode & ModeTlv::kModeRxOnWhenIdle) == 0)
{
@@ -1461,7 +1461,7 @@ ThreadError Mle::SendAnnounce(uint8_t aChannel)
destination.mFields.m16[7] = HostSwap16(0x0001);
SuccessOrExit(error = SendMessage(*message, destination));
otLogInfoMle("sent announce on channel %d\n", aChannel);
otLogInfoMle("sent announce on channel %d", aChannel);
exit:
@@ -1714,7 +1714,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
{
if (frameCounter < neighbor->mValid.mMleFrameCounter)
{
otLogDebgMle("mle frame reject 1\n");
otLogDebgMle("mle frame reject 1");
ExitNow();
}
}
@@ -1722,7 +1722,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
{
if (keySequence <= neighbor->mKeySequence)
{
otLogDebgMle("mle frame reject 2\n");
otLogDebgMle("mle frame reject 2");
ExitNow();
}
@@ -1744,7 +1744,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
command == Header::kCommandChildUpdateRequest ||
command == Header::kCommandAnnounce))
{
otLogDebgMle("mle sequence unknown! %d\n", command);
otLogDebgMle("mle sequence unknown! %d", command);
ExitNow();
}
}
@@ -1830,7 +1830,7 @@ ThreadError Mle::HandleAdvertisement(const Message &aMessage, const Ip6::Message
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kLeaderData, sizeof(leaderData), leaderData));
VerifyOrExit(leaderData.IsValid(), error = kThreadError_Parse);
otLogInfoMle("Received advertisement from %04x\n", sourceAddress.GetRloc16());
otLogInfoMle("Received advertisement from %04x", sourceAddress.GetRloc16());
if (mDeviceState != kDeviceStateDetached)
{
@@ -1907,7 +1907,7 @@ ThreadError Mle::HandleDataResponse(const Message &aMessage, const Ip6::MessageI
bool dataRequest = false;
Tlv tlv;
otLogInfoMle("Received Data Response\n");
otLogInfoMle("Received Data Response");
// Leader Data
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kLeaderData, sizeof(leaderData), leaderData));
@@ -2093,7 +2093,7 @@ ThreadError Mle::HandleParentResponse(const Message &aMessage, const Ip6::Messag
ChallengeTlv challenge;
int8_t diff;
otLogInfoMle("Received Parent Response\n");
otLogInfoMle("Received Parent Response");
// Response
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kResponse, sizeof(response), response));
@@ -2232,7 +2232,7 @@ ThreadError Mle::HandleChildIdResponse(const Message &aMessage, const Ip6::Messa
uint16_t offset;
uint8_t numRouters = 0;
otLogInfoMle("Received Child ID Response\n");
otLogInfoMle("Received Child ID Response");
VerifyOrExit(mParentRequestState == kChildIdRequest, ;);
@@ -2346,7 +2346,7 @@ ThreadError Mle::HandleChildUpdateResponse(const Message &aMessage, const Ip6::M
NetworkDataTlv networkData;
uint8_t tlvs[] = {Tlv::kNetworkData};
otLogInfoMle("Received Child Update Response\n");
otLogInfoMle("Received Child Update Response");
// Status
if (Tlv::GetTlv(aMessage, Tlv::kStatus, sizeof(status), status) == kThreadError_None)
@@ -2457,7 +2457,7 @@ ThreadError Mle::HandleAnnounce(const Message &aMessage, const Ip6::MessageInfo
const MeshCoP::Timestamp *localTimestamp;
PanIdTlv panid;
otLogInfoMle("Received announce\n");
otLogInfoMle("Received announce");
SuccessOrExit(Tlv::GetTlv(aMessage, Tlv::kChannel, sizeof(channel), channel));
VerifyOrExit(channel.IsValid(),);
@@ -2504,7 +2504,7 @@ ThreadError Mle::HandleDiscoveryRequest(const Message &aMessage, const Ip6::Mess
uint16_t offset;
uint16_t end;
otLogInfoMle("Received discovery request\n");
otLogInfoMle("Received discovery request");
// only Routers and REEDs respond
VerifyOrExit((mDeviceMode & ModeTlv::kModeFFD) != 0, ;);
@@ -2636,7 +2636,7 @@ ThreadError Mle::SendDiscoveryResponse(const Ip6::Address &aDestination, uint16_
SuccessOrExit(error = SendMessage(*message, aDestination));
otLogInfoMle("Sent discovery response\n");
otLogInfoMle("Sent discovery response");
exit:
@@ -2663,7 +2663,7 @@ ThreadError Mle::HandleDiscoveryResponse(const Message &aMessage, const Ip6::Mes
uint16_t offset;
uint16_t end;
otLogInfoMle("Handle discovery response\n");
otLogInfoMle("Handle discovery response");
VerifyOrExit(mIsDiscoverInProgress, error = kThreadError_Drop);
+35 -35
View File
@@ -156,7 +156,7 @@ uint8_t MleRouter::AllocateRouterId(uint8_t aRouterId)
mRouterIdSequenceLastUpdated = Timer::GetNow();
rval = aRouterId;
otLogInfoMle("add router id %d\n", aRouterId);
otLogInfoMle("add router id %d", aRouterId);
exit:
return rval;
@@ -164,7 +164,7 @@ exit:
ThreadError MleRouter::ReleaseRouterId(uint8_t aRouterId)
{
otLogInfoMle("delete router id %d\n", aRouterId);
otLogInfoMle("delete router id %d", aRouterId);
mRouters[aRouterId].mAllocated = false;
mRouters[aRouterId].mReclaimDelay = true;
mRouters[aRouterId].mState = Neighbor::kStateInvalid;
@@ -360,7 +360,7 @@ ThreadError MleRouter::SetStateRouter(uint16_t aRloc16)
mStateUpdateTimer.Start(kStateUpdatePeriod);
mNetif.GetIp6().SetForwardingEnabled(true);
otLogInfoMle("Mode -> Router\n");
otLogInfoMle("Mode -> Router");
return kThreadError_None;
}
@@ -387,7 +387,7 @@ ThreadError MleRouter::SetStateLeader(uint16_t aRloc16)
mCoapServer.AddResource(mAddressRelease);
mNetif.GetIp6().SetForwardingEnabled(true);
otLogInfoMle("Mode -> Leader %d\n", mLeaderData.GetPartitionId());
otLogInfoMle("Mode -> Leader %d", mLeaderData.GetPartitionId());
return kThreadError_None;
}
@@ -488,7 +488,7 @@ ThreadError MleRouter::SendAdvertisement(void)
destination.mFields.m16[7] = HostSwap16(0x0001);
SuccessOrExit(error = SendMessage(*message, destination));
otLogInfoMle("Sent advertisement\n");
otLogInfoMle("Sent advertisement");
exit:
@@ -567,7 +567,7 @@ ThreadError MleRouter::SendLinkRequest(Neighbor *aNeighbor)
SuccessOrExit(error = SendMessage(*message, destination));
otLogInfoMle("Sent link request\n");
otLogInfoMle("Sent link request");
exit:
@@ -591,7 +591,7 @@ ThreadError MleRouter::HandleLinkRequest(const Message &aMessage, const Ip6::Mes
TlvRequestTlv tlvRequest;
uint16_t rloc16;
otLogInfoMle("Received link request\n");
otLogInfoMle("Received link request");
VerifyOrExit(GetDeviceState() == kDeviceStateRouter ||
GetDeviceState() == kDeviceStateLeader, ;);
@@ -751,13 +751,13 @@ ThreadError MleRouter::SendLinkAccept(const Ip6::MessageInfo &aMessageInfo, Neig
SuccessOrExit(error = AddDelayedResponse(*message, aMessageInfo.GetPeerAddr(),
(otPlatRandomGet() % kMaxResponseDelay) + 1));
otLogInfoMle("Delayed link accept\n");
otLogInfoMle("Delayed link accept");
}
else
{
SuccessOrExit(error = SendMessage(*message, aMessageInfo.GetPeerAddr()));
otLogInfoMle("Sent link accept\n");
otLogInfoMle("Sent link accept");
}
exit:
@@ -773,14 +773,14 @@ exit:
ThreadError MleRouter::HandleLinkAccept(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
uint32_t aKeySequence)
{
otLogInfoMle("Received link accept\n");
otLogInfoMle("Received link accept");
return HandleLinkAccept(aMessage, aMessageInfo, aKeySequence, false);
}
ThreadError MleRouter::HandleLinkAcceptAndRequest(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo,
uint32_t aKeySequence)
{
otLogInfoMle("Received link accept and request\n");
otLogInfoMle("Received link accept and request");
return HandleLinkAccept(aMessage, aMessageInfo, aKeySequence, true);
}
@@ -985,7 +985,7 @@ ThreadError MleRouter::SendLinkReject(const Ip6::Address &aDestination)
SuccessOrExit(error = SendMessage(*message, aDestination));
otLogInfoMle("Sent link reject\n");
otLogInfoMle("Sent link reject");
exit:
@@ -1003,7 +1003,7 @@ ThreadError MleRouter::HandleLinkReject(const Message &aMessage, const Ip6::Mess
(void)aMessage;
otLogInfoMle("Received link reject\n");
otLogInfoMle("Received link reject");
macAddr.Set(aMessageInfo.GetPeerAddr());
@@ -1260,7 +1260,7 @@ ThreadError MleRouter::HandleAdvertisement(const Message &aMessage, const Ip6::M
if (partitionId != mLeaderData.GetPartitionId())
{
otLogDebgMle("different partition! %d %d %d %d\n",
otLogDebgMle("different partition! %d %d %d %d",
leaderData.GetWeighting(), partitionId,
mLeaderData.GetWeighting(), mLeaderData.GetPartitionId());
@@ -1282,7 +1282,7 @@ ThreadError MleRouter::HandleAdvertisement(const Message &aMessage, const Ip6::M
if (ComparePartitions(routerCount <= 1, leaderData, IsSingleton(), mLeaderData) > 0)
{
otLogDebgMle("trying to migrate\n");
otLogDebgMle("trying to migrate");
BecomeChild(kMleAttachBetterPartition);
}
@@ -1579,7 +1579,7 @@ void MleRouter::UpdateRoutes(const RouteTlv &aRoute, uint8_t aRouterId)
continue;
}
otLogDebgMle("%x: %x %d %d %d %d\n", GetRloc16(i), GetRloc16(mRouters[i].mNextHop),
otLogDebgMle("%x: %x %d %d %d %d", GetRloc16(i), GetRloc16(mRouters[i].mNextHop),
mRouters[i].mCost, GetLinkCost(i), mRouters[i].mLinkInfo.GetLinkQuality(mMac.GetNoiseFloor()),
mRouters[i].mLinkQualityOut);
}
@@ -1597,7 +1597,7 @@ ThreadError MleRouter::HandleParentRequest(const Message &aMessage, const Ip6::M
ChallengeTlv challenge;
Child *child;
otLogInfoMle("Received parent request\n");
otLogInfoMle("Received parent request");
// A Router MUST NOT send an MLE Parent Response if:
@@ -1706,7 +1706,7 @@ void MleRouter::HandleStateUpdateTimer(void)
case kDeviceStateRouter:
// verify path to leader
otLogDebgMle("network id timeout = %d\n", GetLeaderAge());
otLogDebgMle("network id timeout = %d", GetLeaderAge());
if (GetLeaderAge() >= mNetworkIdTimeout)
{
@@ -1825,7 +1825,7 @@ void MleRouter::HandleDelayedResponseTimer(void)
// Send the message.
if (SendMessage(*message, delayedResponse.GetDestination()) == kThreadError_None)
{
otLogInfoMle("Sent delayed response\n");
otLogInfoMle("Sent delayed response");
}
else
{
@@ -1925,7 +1925,7 @@ ThreadError MleRouter::SendParentResponse(Child *aChild, const ChallengeTlv &cha
SuccessOrExit(error = AddDelayedResponse(*message, destination, delay));
otLogInfoMle("Delayed Parent Response\n");
otLogInfoMle("Delayed Parent Response");
exit:
@@ -1985,7 +1985,7 @@ ThreadError MleRouter::HandleChildIdRequest(const Message &aMessage, const Ip6::
Child *child;
uint8_t numTlvs;
otLogInfoMle("Received Child ID Request\n");
otLogInfoMle("Received Child ID Request");
// Find Child
macAddr.Set(aMessageInfo.GetPeerAddr());
@@ -2138,7 +2138,7 @@ ThreadError MleRouter::HandleChildUpdateRequest(const Message &aMessage, const I
uint8_t tlvs[kMaxResponseTlvs];
uint8_t tlvslength = 0;
otLogInfoMle("Received Child Update Request\n");
otLogInfoMle("Received Child Update Request");
// Find Child
macAddr.Set(aMessageInfo.GetPeerAddr());
@@ -2233,7 +2233,7 @@ ThreadError MleRouter::HandleDataRequest(const Message &aMessage, const Ip6::Mes
uint8_t tlvs[4];
uint8_t numTlvs;
otLogInfoMle("Received Data Request\n");
otLogInfoMle("Received Data Request");
// TLV Request
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kTlvRequest, sizeof(tlvRequest), tlvRequest));
@@ -2368,7 +2368,7 @@ ThreadError MleRouter::SendChildIdResponse(Child *aChild)
destination.SetIid(aChild->mMacAddr);
SuccessOrExit(error = SendMessage(*message, destination));
otLogInfoMle("Sent Child ID Response\n");
otLogInfoMle("Sent Child ID Response");
exit:
@@ -2431,7 +2431,7 @@ ThreadError MleRouter::SendChildUpdateResponse(Child *aChild, const Ip6::Message
SuccessOrExit(error = SendMessage(*message, aMessageInfo.GetPeerAddr()));
otLogInfoMle("Sent Child Update Response\n");
otLogInfoMle("Sent Child Update Response");
exit:
@@ -2480,7 +2480,7 @@ ThreadError MleRouter::SendDataResponse(const Ip6::Address &aDestination, const
SuccessOrExit(error = SendMessage(*message, aDestination));
otLogInfoMle("Sent Data Response\n");
otLogInfoMle("Sent Data Response");
exit:
@@ -3145,7 +3145,7 @@ ThreadError MleRouter::SendAddressSolicit(ThreadStatusTlv::Status aStatus)
SuccessOrExit(error = mCoapClient.SendMessage(*message, messageInfo,
&MleRouter::HandleAddressSolicitResponse, this));
otLogInfoMle("Sent address solicit to %04x\n", HostSwap16(messageInfo.GetPeerAddr().mFields.m16[7]));
otLogInfoMle("Sent address solicit to %04x", HostSwap16(messageInfo.GetPeerAddr().mFields.m16[7]));
exit:
@@ -3188,7 +3188,7 @@ ThreadError MleRouter::SendAddressRelease(void)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mCoapClient.SendMessage(*message, messageInfo, NULL, NULL));
otLogInfoMle("Sent address release\n");
otLogInfoMle("Sent address release");
exit:
@@ -3221,7 +3221,7 @@ void MleRouter::HandleAddressSolicitResponse(Coap::Header *aHeader, Message *aMe
VerifyOrExit(aHeader->GetCode() == Coap::Header::kCodeChanged, ;);
otLogInfoMle("Received address reply\n");
otLogInfoMle("Received address reply");
SuccessOrExit(ThreadTlv::GetTlv(*aMessage, ThreadTlv::kStatus, sizeof(statusTlv), statusTlv));
VerifyOrExit(statusTlv.IsValid() && statusTlv.GetStatus() == statusTlv.kSuccess, ;);
@@ -3306,7 +3306,7 @@ void MleRouter::HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, c
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable && aHeader.GetCode() == Coap::Header::kCodePost,
error = kThreadError_Parse);
otLogInfoMle("Received address solicit\n");
otLogInfoMle("Received address solicit");
SuccessOrExit(error = ThreadTlv::GetTlv(aMessage, ThreadTlv::kExtMacAddress, sizeof(macAddr64Tlv), macAddr64Tlv));
VerifyOrExit(macAddr64Tlv.IsValid(), error = kThreadError_Parse);
@@ -3375,7 +3375,7 @@ void MleRouter::HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, c
}
else
{
otLogInfoMle("router id requested and provided!\n");
otLogInfoMle("router id requested and provided!");
}
if (IsRouterIdValid(routerId))
@@ -3384,7 +3384,7 @@ void MleRouter::HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, c
}
else
{
otLogInfoMle("router address unavailable!\n");
otLogInfoMle("router address unavailable!");
}
exit:
@@ -3436,7 +3436,7 @@ void MleRouter::SendAddressSolicitResponse(const Coap::Header &aRequestHeader, u
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMle("Sent address reply\n");
otLogInfoMle("Sent address reply");
exit:
@@ -3464,7 +3464,7 @@ void MleRouter::HandleAddressRelease(Coap::Header &aHeader, Message &aMessage,
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, ;);
otLogInfoMle("Received address release\n");
otLogInfoMle("Received address release");
SuccessOrExit(ThreadTlv::GetTlv(aMessage, ThreadTlv::kRloc16, sizeof(rlocTlv), rlocTlv));
VerifyOrExit(rlocTlv.IsValid(), ;);
@@ -3497,7 +3497,7 @@ void MleRouter::SendAddressReleaseResponse(const Coap::Header &aRequestHeader, c
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMle("Sent address release response\n");
otLogInfoMle("Sent address release response");
exit:
+2 -2
View File
@@ -647,7 +647,7 @@ ThreadError NetworkData::SendServerDataNotification(uint16_t aRloc16)
mLastAttemptWait = true;
}
otLogInfoNetData("Sent server data notification\n");
otLogInfoNetData("Sent server data notification");
exit:
@@ -681,7 +681,7 @@ void NetworkData::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aM
header.GetTokenLength() == sizeof(mCoapToken) &&
memcmp(mCoapToken, header.GetToken(), sizeof(mCoapToken)) == 0, ;);
otLogInfoNetData("Server data notification acknowledged\n");
otLogInfoNetData("Server data notification acknowledged");
exit:
(void)aMessageInfo;
+6 -6
View File
@@ -543,7 +543,7 @@ void Leader::HandleServerData(Coap::Header &aHeader, Message &aMessage,
ThreadNetworkDataTlv networkData;
ThreadRloc16Tlv rloc16;
otLogInfoNetData("Received network data registration\n");
otLogInfoNetData("Received network data registration");
if (ThreadTlv::GetTlv(aMessage, ThreadTlv::kRloc16, sizeof(rloc16), rloc16) == kThreadError_None)
{
@@ -683,7 +683,7 @@ void Leader::SendServerDataResponse(const Coap::Header &aRequestHeader, const Ip
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoNetData("Sent network data registration acknowledgment\n");
otLogInfoNetData("Sent network data registration acknowledgment");
exit:
@@ -749,7 +749,7 @@ void Leader::SendCommissioningGetResponse(const Coap::Header &aRequestHeader, co
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("sent commissioning dataset get response\n");
otLogInfoMeshCoP("sent commissioning dataset get response");
exit:
@@ -782,7 +782,7 @@ void Leader::SendCommissioningSetResponse(const Coap::Header &aRequestHeader, co
SuccessOrExit(error = mCoapServer.SendMessage(*message, aMessageInfo));
otLogInfoMeshCoP("sent commissioning dataset set response\n");
otLogInfoMeshCoP("sent commissioning dataset set response");
exit:
@@ -1136,7 +1136,7 @@ int Leader::AllocateContext(void)
{
mContextUsed |= 1 << i;
rval = i;
otLogInfoNetData("Allocated Context ID = %d\n", rval);
otLogInfoNetData("Allocated Context ID = %d", rval);
ExitNow();
}
}
@@ -1147,7 +1147,7 @@ exit:
ThreadError Leader::FreeContext(uint8_t aContextId)
{
otLogInfoNetData("Free Context Id = %d\n", aContextId);
otLogInfoNetData("Free Context Id = %d", aContextId);
RemoveContext(aContextId);
mContextUsed &= ~(1 << aContextId);
mVersion++;
+13 -13
View File
@@ -108,7 +108,7 @@ ThreadError NetworkDiagnostic::SendDiagnosticGet(const Ip6::Address &aDestinatio
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoNetDiag("Sent diagnostic get\n");
otLogInfoNetDiag("Sent diagnostic get");
exit:
@@ -137,7 +137,7 @@ void NetworkDiagnostic::HandleUdpReceive(Message &aMessage, const Ip6::MessageIn
header.GetTokenLength() == sizeof(mCoapToken) &&
memcmp(mCoapToken, header.GetToken(), sizeof(mCoapToken)) == 0, ;);
otLogInfoNetDiag("Network Diagnostic message acknowledged\n");
otLogInfoNetDiag("Network Diagnostic message acknowledged");
exit:
(void)aMessageInfo;
@@ -183,7 +183,7 @@ ThreadError NetworkDiagnostic::SendDiagnosticReset(const Ip6::Address &aDestinat
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoNetDiag("Sent network diagnostic reset\n");
otLogInfoNetDiag("Sent network diagnostic reset");
exit:
@@ -292,7 +292,7 @@ void NetworkDiagnostic::HandleDiagnosticGet(Coap::Header &aHeader, Message &aMes
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodeGet, error = kThreadError_Drop);
otLogInfoNetDiag("Received diagnostic get request\n");
otLogInfoNetDiag("Received diagnostic get request");
header.Init();
header.SetType(Coap::Header::kTypeAcknowledgment);
@@ -308,7 +308,7 @@ void NetworkDiagnostic::HandleDiagnosticGet(Coap::Header &aHeader, Message &aMes
for (uint8_t i = 0; i < numTlvTypes; i++)
{
otLogInfoNetDiag("Received diagnostic get type %d\n", tlvTypeSet[i]);
otLogInfoNetDiag("Received diagnostic get type %d", tlvTypeSet[i]);
switch (tlvTypeSet[i])
{
@@ -446,10 +446,10 @@ void NetworkDiagnostic::HandleDiagnosticGet(Coap::Header &aHeader, Message &aMes
memcpy(&messageInfo, &aMessageInfo, sizeof(messageInfo));
memset(&messageInfo.mSockAddr, 0, sizeof(messageInfo.mSockAddr));
otLogInfoNetDiag("Sending diagnostic get acknowledgment\n");
otLogInfoNetDiag("Sending diagnostic get acknowledgment");
SuccessOrExit(error = mCoapServer.SendMessage(*message, messageInfo));
otLogInfoNetDiag("Sent diagnostic get acknowledgment\n");
otLogInfoNetDiag("Sent diagnostic get acknowledgment");
exit:
@@ -475,15 +475,15 @@ void NetworkDiagnostic::HandleDiagnosticReset(Coap::Header &aHeader, Message &aM
Message *message = NULL;
Coap::Header header;
Ip6::MessageInfo messageInfo;
otLogInfoNetDiag("Received diagnostic reset request\n");
otLogInfoNetDiag("Received diagnostic reset request");
VerifyOrExit(aHeader.GetType() == Coap::Header::kTypeConfirmable &&
aHeader.GetCode() == Coap::Header::kCodePost, error = kThreadError_Drop);
otLogInfoNetDiag("Received diagnostic reset request\n");
otLogInfoNetDiag("Received diagnostic reset request");
numTlvTypes = aMessage.Read(aMessage.GetOffset(), kNumResetTlvTypes, tlvTypeSet);
otLogInfoNetDiag("Received diagnostic reset request\n");
otLogInfoNetDiag("Received diagnostic reset request");
for (uint8_t i = 0; i < numTlvTypes; i++)
{
@@ -497,10 +497,10 @@ void NetworkDiagnostic::HandleDiagnosticReset(Coap::Header &aHeader, Message &aM
}
}
otLogInfoNetDiag("Received diagnostic reset request\n");
otLogInfoNetDiag("Received diagnostic reset request");
VerifyOrExit((message = mSocket.NewMessage(0)) != NULL, error = kThreadError_NoBufs);
otLogInfoNetDiag("Received diagnostic reset request\n");
otLogInfoNetDiag("Received diagnostic reset request");
header.Init();
header.SetType(Coap::Header::kTypeAcknowledgment);
header.SetCode(Coap::Header::kCodeChanged);
@@ -514,7 +514,7 @@ void NetworkDiagnostic::HandleDiagnosticReset(Coap::Header &aHeader, Message &aM
SuccessOrExit(error = mCoapServer.SendMessage(*message, messageInfo));
otLogInfoNetDiag("Sent diagnostic reset acknowledgment\n");
otLogInfoNetDiag("Sent diagnostic reset acknowledgment");
exit:
+3 -4
View File
@@ -125,7 +125,7 @@ ThreadError PanIdQueryServer::SendQueryResponse(const Coap::Header &aRequestHead
memset(&responseInfo.mSockAddr, 0, sizeof(responseInfo.mSockAddr));
SuccessOrExit(error = mCoapServer.SendMessage(*message, responseInfo));
otLogInfoMeshCoP("sent panid query response\n");
otLogInfoMeshCoP("sent panid query response");
exit:
@@ -214,7 +214,7 @@ ThreadError PanIdQueryServer::SendConflict(void)
messageInfo.mPeerPort = kCoapUdpPort;
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
otLogInfoMeshCoP("sent panid conflict\n");
otLogInfoMeshCoP("sent panid conflict");
exit:
@@ -233,14 +233,13 @@ void PanIdQueryServer::HandleTimer(void *aContext)
void PanIdQueryServer::HandleTimer(void)
{
otLogInfoMeshCoP("%x\n", mChannelMask);
mNetif.GetMac().ActiveScan(mChannelMask, 0, HandleScanResult, this);
mChannelMask = 0;
}
void PanIdQueryServer::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo)
{
otLogInfoMeshCoP("received panid conflict response\n");
otLogInfoMeshCoP("received panid conflict response");
(void)aContext;
(void)aMessage;
(void)aMessageInfo;