Hossam El-Din Hassanein wrote:
Hello all ,
I have some questions in this module please help me with ASAP ....
In oscilloscopeRF( in dataTask ) what does this mean ?
pack->channel = 1;
There was some vague idea that you could send data from multiple
input "channels" (different ADCs, etal), so this specifies that
the samples are from "channel 1".
and this :
atomic {
currentMsg ^= 0x1;
}
I think, without looking, that currentMsg indicates which of two
data buffers to use, such that one is being sent on the radio
while the other is getting filled with samples. The ^= 1 thing
is an exclusive-OR operation that inverts the low order bit to
toggle between 0 and 1.
when is the send being called in oscilloscopeRF ? does this happen in
the dataTask() ... I'm alittle bit confused because the send command is
inside the if statement in order to toggle the yellow led ...
and correct me if I'm wrong :
this pack->sourceMoteID = TOS_LOCAL_ADDRESS; means that the
mote ID of THIS mote is set to local address of the mote ... but what
is exactly the TOS_LOCAL_ADDRESS.
That is correct. TLA is a "global" variable def that gets set by a tricky
little script just before downloading the program, so when you do
make install.X, X is stuffed into the TLA for that mote.
and I dont actually understand this part :
async event result_t ADC.dataReady(uint16_t data) {
struct OscopeMsg *pack;
atomic {
pack = (struct OscopeMsg *)msg[currentMsg].data;
pack->data[packetReadingNumber++] = data;
readingNumber++;
dbg(DBG_USR1, "data_event\n");
if (packetReadingNumber == BUFFER_SIZE) {
post dataTask();
}
}
if (data > 0x0300)
call Leds.redOn();
else
call Leds.redOff();
return SUCCESS;
}
and specially this part :
struct OscopeMsg *pack;
atomic {
pack = (struct OscopeMsg *)msg[currentMsg].data;
pack->data[packetReadingNumber++] = data;
It's basically a bunch of munging around to stick a data sample into the
right place in the right message buffer packet. Then it flashes the red
LED if the data is above a certain value, just to show that it's doing
something...The specific piece of code you point out extracts the "data"
packet area of the right msg buffer (indicated by that 0-or-1-currentMsg),
and then puts the current sample data in the next (packetReadingNumber)
location in that packet. When PRN reaches some fixed BUFFER_SIZE it
posts a new dataTask() to send the message.
in the end I would like to thank u for reading but please reply ASAP and
please be clear and specific .... thanks
About as clear as Adobe mud, right?
MS
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help