[cli] add missing initializer in coap/udp examples (#2395)

This commit is contained in:
Jonathan Hui
2017-12-07 18:19:34 +00:00
committed by GitHub
parent 3ddbb4213a
commit a6dcb5fb8c
4 changed files with 14 additions and 2 deletions
+6
View File
@@ -43,6 +43,12 @@
namespace ot {
namespace Cli {
Coap::Coap(Interpreter &aInterpreter):
mInterpreter(aInterpreter)
{
memset(&mResource, 0, sizeof(mResource));
}
void Coap::PrintPayload(otMessage *aMessage) const
{
uint8_t buf[kMaxBufferSize];
+1 -1
View File
@@ -60,7 +60,7 @@ public:
* @param[in] aInterpreter The CLI interpreter.
*
*/
Coap(Interpreter &aInterpreter): mInterpreter(aInterpreter) { }
Coap(Interpreter &aInterpreter);
/**
* This method interprets a list of CLI arguments.
+6
View File
@@ -54,6 +54,12 @@ const struct UdpExample::Command UdpExample::sCommands[] =
{ "send", &UdpExample::ProcessSend }
};
UdpExample::UdpExample(Interpreter &aInterpreter):
mInterpreter(aInterpreter)
{
memset(&mSocket, 0, sizeof(mSocket));
}
otError UdpExample::ProcessHelp(int argc, char *argv[])
{
for (unsigned int i = 0; i < sizeof(sCommands) / sizeof(sCommands[0]); i++)
+1 -1
View File
@@ -57,7 +57,7 @@ public:
* @param[in] aInterpreter The CLI interpreter.
*
*/
UdpExample(Interpreter &aInterpreter): mInterpreter(aInterpreter) { }
UdpExample(Interpreter &aInterpreter);
/**
* This method interprets a list of CLI arguments.