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" <[EMAIL PROTECTED]>
Subject: Re: [Tinyos-help] Synchronous Sensor Reading
To: [email protected]
....why?
Date: Thu, 7 Aug 2008 04:17:06 +0200
From: "Antonio" <[EMAIL PROTECTED]>
Subject: [Tinyos-help] Synchronous Sensor Reading
To: <[email protected]>
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
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help