Revert "use time comparion functions"

This reverts commit 2d0ae6b82b.

Possibly not use this for relative timestamps.
This commit is contained in:
Olaf Bergmann committed 2013-11-08 17:00:08 +01:00
1 parent 2d0ae6b82b
commit c4cb5ce770
3 files changed
+6 -7

No files matched your search

+2 -2
View File
@@ -398,12 +398,12 @@ main(int argc, char **argv) {
nextpdu = coap_peek_next( ctx );
coap_ticks(&now);
while (nextpdu && coap_time_le(nextpdu->t, now - ctx->sendqueue_basetime)) {
while (nextpdu && nextpdu->t <= now - ctx->sendqueue_basetime) {
coap_retransmit( ctx, coap_pop_next( ctx ) );
nextpdu = coap_peek_next( ctx );
}
if (nextpdu && coap_time_le(nextpdu->t, COAP_RESOURCE_CHECK_TIME)) {
if ( nextpdu && nextpdu->t <= COAP_RESOURCE_CHECK_TIME ) {
/* 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;