[Tinyos-help] bug in PrintDiagMsgs
Thomas J Stevens
tjstevens at raytheon.com
Wed Aug 16 10:52:17 PDT 2006
Dear Users et. al,
There seems to be a bug in PrintDiagMsgs.java with respect to the
-timestamp option.
Using -timestamp with the base PrintDiagMsgs.java looks like the following:
09:36:28.0742
09:36:28.0792
09:36:31.0966
09:36:32.0016
09:36:35.0251
09:36:35.0261
09:36:38.0516
09:36:48.0230
09:36:51.0524
...notice that in the HH:mm:ss.SSSS format the first S is always zero,
e.g., . xx:xx:xx.09xx goes to xx:xx:xx.00xx instead of xx:xx:xx.10xx
Line 63 of PrintDiagMsgs.java is:
timestamp = new java.text.SimpleDateFormat("HH:mm:ss.SSSS");
which creates the timestamp as a SimpleDateFormat. I believe that
SimpleDateFormat is only valid to millisecond accuracy. Therefore,
changing line 63 to:
timestamp = new java.text.SimpleDateFormat("HH:mm:ss.SSS");
gives what look to be accurate results as shown below:
10:29:09.244
10:29:12.468
10:29:12.508
10:29:15.732
10:29:15.772
10:29:18.976
10:29:18.986
10:29:18.996
10:29:22.239
I have attached both the original and the modified PrintDiagMsgs.java for
review and request that this modification be included in the TinyOS
distribution.
That the (apparently) invalid format is accepted by javac and that the time
is NOT zero padded in the LEAST significant digit is a larger issue for the
Java community to work out (or not :).
Best Regards,
Thom Stevens
(See attached file: PrintDiagMsgs.java)(See attached file:
PrintDiagMsgs.orig.java)
Sr. Systems Engineer
Advanced Programs
Raytheon Missiles
520.906.9706 (mobile)
------------------------------------------------------------------------
There are 10 kinds of people in this world: Those who understand binary,
and those who don't.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PrintDiagMsgs.java
Type: application/octet-stream
Size: 11010 bytes
Desc: not available
Url : http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060816/40765cd9/PrintDiagMsgs-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PrintDiagMsgs.orig.java
Type: application/octet-stream
Size: 11023 bytes
Desc: not available
Url : http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060816/40765cd9/PrintDiagMsgs.orig-0001.obj
More information about the Tinyos-help
mailing list