From d867f97edaae5644f93946038de60f09fa1a6e4b Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Thu, 24 Mar 2011 23:10:39 +0100 Subject: [PATCH] [Aggregator] Use owl_timestamp_is_null() Use owl_timestamp_is_null() instead of owl_timestamp_to_ms() to test if a timestamp is empty or not. Note that we cannot remove owl_timestamp_to_ms(), since it it used by owl_time_elapsed_ms(). --- TODO | 4 ---- owlps-aggregator/owlps-aggregatord.c | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 0c19b03..82cceac 100644 --- a/TODO +++ b/TODO @@ -13,10 +13,6 @@ * libowlps -- Remove timestamp_to_ms() - This function is used only by the aggregator to test if a TIMESTAMP - is null. We should create a function to test that, instead of - converting to ms every time. - mac_bytes_to_string(): do not malloc anymore. diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 325180f..92e74cc 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -688,7 +688,7 @@ void got_request(owl_captured_request request) memcpy(tmp_request->mobile_mac_addr_bytes, request.mobile_mac_addr_bytes, 6) ; // Explicit packet: - if (owl_timestamp_to_ms(request.request_time) != 0) + if (! owl_timestamp_is_null(request.request_time)) // Transmission time on the mobile: tmp_request->request_time = request.request_time ; // Implicit packet: @@ -710,7 +710,7 @@ void got_request(owl_captured_request request) else // If the request list exists already { // we search the list for the request // Explicit packet: - if (owl_timestamp_to_ms(request.request_time) != 0) + if (! owl_timestamp_is_null(request.request_time)) { while (tmp_request != NULL) { // Research criterion: MAC and transmission time @@ -745,7 +745,7 @@ void got_request(owl_captured_request request) memcpy(tmp_request->mobile_mac_addr_bytes, request.mobile_mac_addr_bytes, 6) ; // Explicit packet: - if (owl_timestamp_to_ms(request.request_time) != 0) + if (! owl_timestamp_is_null(request.request_time)) // Transmission time on the mobile: tmp_request->request_time = request.request_time ; // Implicit packet: