[Tinyos-devel] Re: time synch reference implementation
Miklos Maroti
mmaroti at math.u-szeged.hu
Wed Mar 12 12:56:17 PDT 2008
Sorry, I sent it prematurely.
I have updated a "reference implementation" of the time sync support
(for the IRIS platform). Plase take a look at the important files are,
as other platforms are expected to implement these components and
interfaces:
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tos/chips/rf230/TimeSyncMessageC.nc?view=markup
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tos/chips/rf230/TimeSyncSend.nc?view=markup
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tos/chips/rf230/TimeSyncPacket.nc?view=markup
This component provides two pairs of TimeSyncSend / TimeSyncPacket
interfaces, one for TMicro and one for TMilli. We can argue what
should the standard be. The over-the air format is always a 32-bit
tmicro time offset in the footer. Since two TimeSyncSend interfaces
are implemented, the sendDone event is claled on both interfaces (is
this a problem?)
This component is implemented in
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tos/chips/rf230/TimeSyncMessageP.nc?view=markup
which is communicating with the MAC layer via the following two interfaces:
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tos/chips/rf230/PacketTimeStamp.nc?view=markup
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x/tos/chips/rf230/PacketLastTouch.nc?view=markup
The PacketTimeStamp is called to query when the packet was actually
sent or received, and the PacketLastTouch is called just before the
packet is stransmitted over the air (after the SFD before the data).
The PacketLastTouch is a private interface, other platfors do not need
to implement it, they can do something else.
Please see the details in the code (how the time offsets are
calculated / transformed).
Best,
Miklos
More information about the Tinyos-devel
mailing list