To compute a meaningful difference, you need the same reference time at both motes. If you just need an approximation, and not something /very/ precise, get the local time at the sender A, let the receiver B send back another packet as soon as it receives the first one, and read a second time the local time at A upon the reception of the reply. If you divide the difference by two, you'll get an approximation of what you want.
On Thu, 2007-10-11 at 10:52 +0200, sara k wrote: > Hi, > I would like to measure the time it takes to receive a packet from one > mote to the next one. > so I done the following: > - I read the time at the first mote by using pkt->stime = call > Timer0.getNow(); and send the packet to the next mote. > - in the second mote again I read the time pkt->rtime = call Timer0.getNow(); > and calculate the difference rtime-stime. > Is that right? or i have fist to synchronise the motes before doing > that ! what do you think? > what is the difference between get() and getNow()? > > Best > Sara _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
