Re: Re: [Tinyos-help]:Is the "Task" asynchronous??
Renee Azhen
azhen_renee at yahoo.com.cn
Sun Jan 13 07:33:57 PST 2008
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??
Could you tell me how to transmit data from a PC to another PC via the WSN with high speed?? Any demo code or Web link would be better.
In fact, What I want to do is transmitting video from a pc to another pc over the WSN, then play the video on the latter PC with real time.
my Video rates is 40Kbps, So it needs to keep a high transmitting rate for real time playing. My telosb baud rate is 115200 and the WSN transmit data rate is 250Kbps which can meet my needs in theory.
I made a little modification to the apps\BaseStation application to accommodate my need, but found it can't transit data with a high speed, the core code that get data from the serial and transmit to the radio is the following function:
event message_t *UartReceive.receive[am_id_t id](message_t *msg,
void *payload,
uint8_t len) {
// some code here
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 I suppose the key blocking issue is that the serial will reject to receive new message until the post radioSendTask() is ended.
So here I really lost and don't know how to resolve this problem, how to write the code to make it can send and transfer message more quickly with high speed.
Can you give me some instructions?
really thanks for your help
Sam
John Griessen <john at ecosensory.com> 写道:
Renee Azhen wrote:
> dear all,
> I am really lost in my work, I want to know whether the task is
asynchronous with the Thread which post it.
This word in tinyOS means "handled by short codes that start
interrupt triggering actions in platform hardware, or wait
for receive triggered interrupts."
Synchronous equates to inline, blocking code executed immediately.
So those meanings can get confused with natural language,
(english dictionary) meanings. There's no automatic synchronizing of anything going on...
> For instance, here is demo event which is used to get process message when
having received from the serial:
>
> event message_t *UartReceive.receive(message_t *msg, void *payload,
> 1. uint8_t len) {
> 2. code 1 do sth here;
> 3. code 2 do sth here;
> 4. code 3 do sth here;
> 5. post radioSendMessage();
> 6. getSensorData();
[jg]There are rules for what you can put in an async event -- see TinyOS Programming pdf doc in tinyos-2.x/doc/pdf.
If the contents of task radioSendMessage() are brief, then getSensorData() will be started soon,
if not, all bets are off.
John Griessen
--
Ecosensory Austin TX
tinyOS devel on: ubuntu Linux; tinyOS v2.0.2; telosb ecosens1
_______________________________________________
Tinyos-help mailing list
Tinyos-help at millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
---------------------------------
雅虎1G免费邮箱百分百防垃圾信
雅虎助手-搜索、杀毒、防骚扰
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080113/3c2131c6/attachment.htm
More information about the Tinyos-help
mailing list