Commit 229c2652 authored by Yann Garcia's avatar Yann Garcia
Browse files

Review date/time

parent 717f6fa7
#include "LibItsGeoNetworking_Functions.hh"
#include <time.h>
#include <math.h>
#include "base_time.hh"
#include "loggers.hh"
namespace LibItsGeoNetworking__Functions
{
......@@ -8,17 +9,11 @@ namespace LibItsGeoNetworking__Functions
* @return Unix-Epoch-Time mod 2^32
fx_computeGnTimestamp() return UInt32;
*/
INTEGER fx__computeGnTimestamp(
) {
struct timeval tv;
gettimeofday(&tv, NULL);
// unsigned long long timestampNow = tv.tv_sec*1000 + tv.tv_usec/1000;
long long timestampNow = tv.tv_sec*1000 + tv.tv_usec/1000;
INTEGER i = INTEGER();
i.set_long_long_val(timestampNow % 4294967296);
// return INTEGER(timestampNow % 4294967296);
return i;
INTEGER fx__computeGnTimestamp() {
INTEGER i;
i.set_long_long_val(base_time::get_instance().get_its_current_time_ms() % 4294967296); // Expresses the time in milliseconds at which the latitude and longitude of the ITS-S were acquired by the GeoAdhoc router. The time is encoded as: TST =TST(TAI)mod232 where TST(TAI) is the number of elapsed TAI milliseconds since 2004-01-01 00:00:00.000 UTC
loggers::get_instance().log_msg("<<< fx__computeGnTimestamp: ", i);
return i;
}
} //end namespace
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment