1. According to CORBAs "Time Service Specification, V1.1, May 2002" a TimeT value is fractioned in 100 nanoseconds. But Micos TimeService related implementations return a value fractioned in microseconds.
2. As I've reported earlier 'TimeService_impl::universal_time()' returns an uninitialized variable to calculate its return value.
Index: TimeService_help.cc
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_help.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_help.cc
--- TimeService_help.cc 20 Feb 2008 15:22:26 -0000 1.1.1.1
+++ TimeService_help.cc 8 Jan 2009 21:17:40 -0000
<at> <at> -50,7 +50,7 <at> <at>
tmp *= DAYLENGTH;
timeV += tmp;
//in 100 nano second steps
- timeV *= 1000000;
+ timeV *= NANO100;
return timeV;
}
<at> <at> -58,7 +58,7 <at> <at>
//resolution is in miliseconds
TimeBase::TimeT getInaccuracy()
{
- TimeBase::TimeT retval =1000000*INACCURACY;
+ TimeBase::TimeT retval = NANO100 * INACCURACY;
return retval;
}
<at> <at> -90,7 +90,7 <at> <at>
time_t etime;
//in 100 nano second steps
- timeV /= 1000000;
+ timeV /= NANO100;
//Offset from Unix Epoch to 15 October 1582
TimeBase::TimeT tmp = EPOCH2GREGOR;
tmp *= DAYLENGTH;
Index: TimeService_help.h
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_help.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_help.h
--- TimeService_help.h 20 Feb 2008 15:22:26 -0000 1.1.1.1
+++ TimeService_help.h 8 Jan 2009 21:17:40 -0000
<at> <at> -12,6 +12,9 <at> <at>
//inaccuracy of the internal clock in seconds
#define INACCURACY 1
+//Time units according to CORBAs "Time Service Specification, V1.1, May 2002"
+#define NANO100 10000000
+
//use the secure time? Only if your system clock is very accurate!
//#define USESECURE
Index: TimeService_impl.cc
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_impl.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_impl.cc
--- TimeService_impl.cc 20 Feb 2008 15:22:26 -0000 1.1.1.1
+++ TimeService_impl.cc 8 Jan 2009 21:17:40 -0000
<at> <at> -29,9 +29,8 <at> <at>
CosTime::UTO_ptr
TimeService_impl::universal_time()
{
-
- TimeBase::TimeT timeV = timeV + TimeBase::TimeT(getTime());
- TimeBase::TimeT inaccuracyV = 10000000;
+ TimeBase::TimeT timeV = TimeBase::TimeT(getTime());
+ TimeBase::TimeT inaccuracyV = NANO100;
inaccuracyV *= INACCURACY;
TimeBase::TdfT tdfV = getTimezone();
<at> <at> -60,7 +59,8 <at> <at>
#else
mico_throw(CosTime::TimeUnavailable());
-
+ retval = (CosTime::UTO_ptr) NULL; // Avoid compiler warnings
+
#endif
return retval;
Index: TimeService_uto.cc
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_uto.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_uto.cc
--- TimeService_uto.cc 20 Feb 2008 15:22:27 -0000 1.1.1.1
+++ TimeService_uto.cc 8 Jan 2009 21:17:40 -0000
<at> <at> -73,7 +73,7 <at> <at>
TimeBase::TimeT atimeV = timeV + TimeBase::TimeT(getTime());
TimeBase::TdfT atdfV = getTimezone();
- TimeBase::TimeT ainaccurV = 10000000;
+ TimeBase::TimeT ainaccurV = NANO100;
ainaccurV *= INACCURACY;
UTO_impl * utoAbs = new UTO_impl(atimeV, ainaccurV , atdfV);
My development environment: Apple Macintosh, PPC, MacOSX 10.4.11, GNU gcc 4.0.1, MICO 2.3.13