Skip to content

Commit

Permalink
Merge pull request #1 from sbernard31/randommessageid
Browse files Browse the repository at this point in the history
Generate random message id.
  • Loading branch information
dnav committed Jul 23, 2014
2 parents b1691d2 + e17d8ba commit 5955a2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/liblwm2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ lwm2m_context_t * lwm2m_init(char * endpointName,
memset(contextP, 0, sizeof(lwm2m_context_t));
contextP->bufferSendCallback = bufferSendCallback;
contextP->bufferSendUserData = bufferSendUserData;
srand(time(NULL));
contextP->nextMID = rand();
#ifdef LWM2M_CLIENT_MODE
contextP->endpointName = strdup(endpointName);
if (contextP->endpointName == NULL)
Expand Down

0 comments on commit 5955a2b

Please sign in to comment.