Skip to content

Commit

Permalink
coap-server.c: fixed resource check time calculation
Browse files Browse the repository at this point in the history
This change is a fix for issue #72 [1].

[1] #72
  • Loading branch information
obgm committed Apr 12, 2017
1 parent ac94964 commit 771f013
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/coap-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ main(int argc, char **argv) {
nextpdu = coap_peek_next( ctx );
}

if ( nextpdu && nextpdu->t <= COAP_RESOURCE_CHECK_TIME ) {
if (nextpdu && nextpdu->t <= (COAP_RESOURCE_CHECK_TIME * COAP_TICKS_PER_SECOND)) {
/* set timeout if there is a pdu to send before our automatic timeout occurs */
tv.tv_usec = ((nextpdu->t) % COAP_TICKS_PER_SECOND) * 1000000 / COAP_TICKS_PER_SECOND;
tv.tv_sec = (nextpdu->t) / COAP_TICKS_PER_SECOND;
Expand Down

0 comments on commit 771f013

Please sign in to comment.