[Tinyos-help] Synchronous Sensor Reading

Antonio antonio.guerrieri at email.it
Thu Aug 7 03:12:07 PDT 2008


I need to do the Synchronous Sensor Reading since I have to simulate the
behavior of sensor nodes without split-phase. 
I think I need something like a java wait() or a Thread.sleep() method. So I
can manage split-phase in a component with a read() method like this:

uint16_t newTemperature;
bool temperatureTaken = FALSE;

uint16_t readSensor(){
		call Sensor.acquireData();
		while(!temperatureTaken){
			call Thread.sleep(10)
		}
		temperatureTaken = FALSE;
		return newTemperature;
}

And a readDone method like this:

event void Sensor.readDone(){
		newTemperature = call Sensor.getValue();
		temperatureTaken = TRUE;
}


In this example Thread.sleep(10) should be preemptable. I tried with
BusyWaitMicroC, but it is not preemptable.

Please, help me!

Thanks a lot

Antonio Guerrieri



Date: Wed, 6 Aug 2008 22:24:26 -0700
From: "Paul Stickney" <pstickne at gmail.com>
Subject: Re: [Tinyos-help] Synchronous Sensor Reading
To: tinyos-help at millennium.berkeley.edu

....why?



Date: Thu, 7 Aug 2008 04:17:06 +0200
From: "Antonio" <antonio.guerrieri at email.it>
Subject: [Tinyos-help] Synchronous Sensor Reading
To: <tinyos-help at millennium.berkeley.edu>

Hi All,
I need to do a Synchronous Sensor Reading in tinyOS.
To be more clear:
I'm using a Telosb node and I'm reading from the Temperature Sensor. Is it
possible to do this reading without split-phase? I need to not implementing
the .readDone event.

Please, Help me! Thanks.

Regards,

Antonio Guerrieri

 
 




 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Vasco è tornato! Sul tuo cellulare Il mondo che vorrei
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7749&d=7-8


More information about the Tinyos-help mailing list