mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 01:19:51 +00:00
Initialize all member variables in constructors. (#1026)
This commit is contained in:
@@ -133,12 +133,14 @@ const struct Command Interpreter::sCommands[] =
|
||||
};
|
||||
|
||||
Interpreter::Interpreter(otInstance *aInstance):
|
||||
sServer(NULL),
|
||||
sLength(8),
|
||||
sCount(1),
|
||||
sInterval(1000),
|
||||
sPingTimer(aInstance->mIp6.mTimerScheduler, &Interpreter::s_HandlePingTimer, this),
|
||||
mInstance(aInstance)
|
||||
{
|
||||
memset(mSlaacAddresses, 0, sizeof(mSlaacAddresses));
|
||||
mInstance->mIp6.mIcmp.SetEchoReplyHandler(&s_HandleEchoResponse, this);
|
||||
otSetStateChangedCallback(mInstance, &Interpreter::s_HandleNetifStateChanged, this);
|
||||
}
|
||||
|
||||
@@ -59,9 +59,10 @@ extern "C" void otCliConsoleInputLine(char *aBuf, uint16_t aBufLength)
|
||||
sServer->ReceiveTask(aBuf, aBufLength);
|
||||
}
|
||||
|
||||
Console::Console(otInstance *aInstance)
|
||||
: mCallback(NULL),
|
||||
mInterpreter(aInstance)
|
||||
Console::Console(otInstance *aInstance):
|
||||
mCallback(NULL),
|
||||
mContext(NULL),
|
||||
mInterpreter(aInstance)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ Udp::Udp(otInstance *aInstance, Interpreter *aInterpreter):
|
||||
mInstance(aInstance),
|
||||
mInterpreter(aInterpreter)
|
||||
{
|
||||
memset(&mSocket, 0, sizeof(mSocket));
|
||||
memset(&mPeer, 0, sizeof(mPeer));
|
||||
}
|
||||
|
||||
ThreadError Udp::Start(void)
|
||||
|
||||
Reference in New Issue
Block a user