Renee Azhen wrote:
> hi, John, thanks for your replying.
>
> In the tinyos programming pdf, it writes:
> A task post is an async operation, while a task running is sync.
> A task post is an async operation??
[jg] It's complicated. Read tinyos programming pdf more.
>
> if (!radioBusy)
> {
> radioBusy = TRUE;
> post radioSendTask();
> }
>
> // some code here
> return ret;
> }
>
> if I set the PC send rates 100 messages/sec, actually the
application can only receive messages 1 times/sec, but if I comment the code
> //post radioSendTask();
> the data can be received about 100 messages/sec
So, the problem is in radioSendTask(). Break it up into smaller chunks.
Definitely smaller chunks sized to match the serial port words.
A way to do that is set up a struct for the message payload. put one
word into it as a task the done and waiting for interrupt --> another
word from serial port. Keep track of how many words, and when enough for
a message, then do a task that checks a busy state that is set when message send
starts and cleared when message send.done fires.
This is all similar to my code I just wrote ReadMoistureSensors in
tinyos-2.x-contrib/ecosensory/apps/ReadMoistureSensors. I have not commited it
yet,
but I will soon.
Tasks need to be short, since they are made of blocking code,
(called synchronous in tinyos 2).
John Griessen
--
Ecosensory Austin TX
tinyOS devel on: ubuntu Linux; tinyOS v2.0.2; telosb ecosens1
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help