[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().
This commit is contained in:
Matteo Cypriani 2011-03-24 23:10:39 +01:00
parent 7fa5819544
commit d867f97eda
2 changed files with 3 additions and 7 deletions

4
TODO
View File

@ -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.

View File

@ -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: