I am no longer working on this please unsubscribe my email id from your data list
On Wed, 4 Oct 2017 at 20:00, <tinyos-help-requ...@millennium.berkeley.edu> wrote: > Send Tinyos-help mailing list submissions to > tinyos-help@millennium.berkeley.edu > > To subscribe or unsubscribe via the World Wide Web, visit > > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > or, via email, send a message with subject or body 'help' to > tinyos-help-requ...@millennium.berkeley.edu > > You can reach the person managing the list at > tinyos-help-ow...@millennium.berkeley.edu > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tinyos-help digest..." > > > Today's Topics: > > 1. Re: Doubt in FTSP (Eric Decker) > 2. Re: Doubt in FTSP (Vlado Handziski) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 3 Oct 2017 15:10:37 -0700 > From: Eric Decker <cire...@gmail.com> > Subject: Re: [Tinyos-help] Doubt in FTSP > To: Jobish John <jobishjohn.m...@gmail.com> > Cc: tinyos-help <tinyos-help@millennium.berkeley.edu> > Message-ID: > <CAMdX_2CuhAvUVrCWaMUfHGSQxmHERbVNaTSdrvL4ZV=- > tbj...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > I think you are right just looking at the math. > > However, you will have to test it and watch how the algorithm behaves to > make sure it is functioning correctly. > > I'm not familar enough with the algorithm nor the underlying principles to > eye ball it and get it right. > > If you do figure it out please document it better. > > thanks, > > eric > > > On Mon, Oct 2, 2017 at 12:55 AM, Jobish John <jobishjohn.m...@gmail.com> > wrote: > > > Dear all, > > > > While trying to understand the TinyOS implementation of FTSP, in one of > > the function, ?calculateConversion()? from (TimeSyncP.nc), I have a small > > doubt in the below part, > > > > ---------------------------------------------------------- > > while( ++i < MAX_ENTRIES ) > > if( table[i].state == ENTRY_FULL ) > > { /* > > This only works because C ISO 1999 defines the signe for > > modulo the same as for the Dividend! > > */ > > localSum += (int32_t)(table[i].localTime - > newLocalAverage) > > / tableEntries; > > localAverageRest += (table[i].localTime - newLocalAverage) > > % tableEntries; > > offsetSum += (int32_t)(table[i].timeOffset - > > newOffsetAverage) / tableEntries; > > offsetAverageRest += (table[i].timeOffset - > > newOffsetAverage) % tableEntries; > > } > > ----------------------------------- > > I think we need to add a typecast (int32_t) for the localAverageRest > > calculation line also, That is, something like > > localAverageRest += (int32_t) (table[i].localTime - newLocalAverage) % > > tableEntries; > > > > Kindly suggest.. > > > > Thanks for your valuable time > > > > Regards > > Jobish John > > IIT Bombay > > > > > > > > > > > > _______________________________________________ > > Tinyos-help mailing list > > Tinyos-help@millennium.berkeley.edu > > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > > > > > -- > Eric B. Decker > Senior (over 50 :-) Researcher > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20171003/455522c2/attachment-0001.htm > > ------------------------------ > > Message: 2 > Date: Wed, 04 Oct 2017 15:35:33 +0000 > From: Vlado Handziski <handzi...@tkn.tu-berlin.de> > Subject: Re: [Tinyos-help] Doubt in FTSP > To: Eric Decker <cire...@gmail.com>, Jobish John > <jobishjohn.m...@gmail.com> > Cc: tinyos-help <tinyos-help@millennium.berkeley.edu> > Message-ID: > < > cakf13tnr_t3slfxv5unmkk7-7qzvb82qnq65nnhpdyh0hru...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > It will not hurt, but I don't see why it is strictly necessary. The first > operand of the % (more a rest than a modulo) operation is already int32_t, > the second operand is a uint_8, the results always has the same sign as the > dividend, as mentioned in the comments. > > --Vlado > > On Wed, Oct 4, 2017 at 12:31 AM Eric Decker <cire...@gmail.com> wrote: > > > > > I think you are right just looking at the math. > > > > However, you will have to test it and watch how the algorithm behaves to > > make sure it is functioning correctly. > > > > I'm not familar enough with the algorithm nor the underlying principles > to > > eye ball it and get it right. > > > > If you do figure it out please document it better. > > > > thanks, > > > > eric > > > > > > On Mon, Oct 2, 2017 at 12:55 AM, Jobish John <jobishjohn.m...@gmail.com> > > wrote: > > > >> Dear all, > >> > >> While trying to understand the TinyOS implementation of FTSP, in one of > >> the function, ?calculateConversion()? from (TimeSyncP.nc), I have a > >> small doubt in the below part, > >> > >> ---------------------------------------------------------- > >> while( ++i < MAX_ENTRIES ) > >> if( table[i].state == ENTRY_FULL ) > >> { /* > >> This only works because C ISO 1999 defines the signe for > >> modulo the same as for the Dividend! > >> */ > >> localSum += (int32_t)(table[i].localTime - > >> newLocalAverage) / tableEntries; > >> localAverageRest += (table[i].localTime - > newLocalAverage) > >> % tableEntries; > >> offsetSum += (int32_t)(table[i].timeOffset - > >> newOffsetAverage) / tableEntries; > >> offsetAverageRest += (table[i].timeOffset - > >> newOffsetAverage) % tableEntries; > >> } > >> ----------------------------------- > >> I think we need to add a typecast (int32_t) for the localAverageRest > >> calculation line also, That is, something like > >> localAverageRest += (int32_t) (table[i].localTime - newLocalAverage) % > >> tableEntries; > >> > >> Kindly suggest.. > >> > >> Thanks for your valuable time > >> > >> Regards > >> Jobish John > >> IIT Bombay > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Tinyos-help mailing list > >> Tinyos-help@millennium.berkeley.edu > >> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > >> > > > > > > > > -- > > Eric B. Decker > > Senior (over 50 :-) Researcher > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20171004/32cf55a3/attachment-0001.htm > > ------------------------------ > > _______________________________________________ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > End of Tinyos-help Digest, Vol 173, Issue 2 > ******************************************* >
_______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help