[Tinyos-help] Need help with LocalTime interface

Kartik Siddhabathula siddhabathulakartik at yahoo.com
Tue Apr 20 08:36:24 PDT 2010


Hi Arik,

Thanks for the response and sorry for the un-commented code. 
Yes, I am looking for the lower order bits when I do time_diff&0ff. So, if the mask is 0xFFFF then my results must also be right, right?

Thanks in advance,
Kartik

--- On Tue, 4/20/10, Arik Sapojnik <sapojnik at gmail.com> wrote:

From: Arik Sapojnik <sapojnik at gmail.com>
Subject: Re: [Tinyos-help] Need help with LocalTime interface
To: "Kartik Siddhabathula" <siddhabathulakartik at yahoo.com>
Cc: "TinyoS help" <tinyos-help at millennium.berkeley.edu>
Date: Tuesday, April 20, 2010, 10:07 AM

Not all the parameters were defined in the file, so I hope no problems there (such as boot_time)The code is a bit cumbersome, so I had no patience to analyze all, BUT:

Why don't you use nx_uint32_t  variables instead of the conversions you do?When you do lower_order_bits=time_diff&0xff - you want to use the 16 lower bits, right? So the mask you need is 0xFFFF.

Arik


On Tue, Apr 20, 2010 at 00:06, Kartik Siddhabathula <siddhabathulakartik at yahoo.com> wrote:


Hi Arik,

Please find attached the code for the local time interface that I had written.

Thanks in advance,


Kartik

--- On Mon, 4/19/10, Arik Sapojnik <sapojnik at gmail.com> wrote:



From: Arik Sapojnik <sapojnik at gmail.com>
Subject: Re: [Tinyos-help] Need help with LocalTime interface
To: "Kartik Siddhabathula" <siddhabathulakartik at yahoo.com>


Cc: "TinyoS help" <tinyos-help at millennium.berkeley.edu>
Date: Monday, April 19, 2010, 3:56 PM

Some code snippets would help




On Mon, Apr 19, 2010 at 19:12, Kartik Siddhabathula <siddhabathulakartik at yahoo.com> wrote:








Hi All,
I am using tinyos-2.x and telosb motes. I am using the LocalTime.get and storing the values in 2 variables and subtracting them. My first value is stored at boot up and 2nd value is on pressing the user button on telosb. Since the time is a 32 bit number am storing it in 32 bit variable. After subtracting the two values am converting the result into 16 bit variable and displaying it. 




The values that am getting are no matter how much time gap I take to press the button from the booting time is:
1. FFFF-F32. FFFF-633. FFFF-19


4. FFFF-27

Can some one please help me understand it ? 
Thanks a lot in advance,
Kartik








      
_______________________________________________

Tinyos-help mailing list

Tinyos-help at millennium.berkeley.edu

https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help







-- 
Best Regards,
Arik Sapojnik





      


-- 
Best Regards,
Arik Sapojnik





      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20100420/cd4dae14/attachment-0001.htm 


More information about the Tinyos-help mailing list