It is my understanding that BaseStation is acting as a bridge so
that is why it copies the source address.

eric


2009/2/7 wkq5325 <[email protected]>

> Hi all,
> I am sorry to trouble you,Can you  please explain the following  question
> to me?
>
> The following code is from tinyos-2.x/apps/BaseStation/BaseStationP.nc
> task void uartSendTask() {
>     ........
>     atomic
>       if (uartIn == uartOut && !uartFull)
>     {
>       uartBusy = FALSE;
>       return;
>     }
>     msg = uartQueue[uartOut];
>     tmpLen = len = call RadioPacket.payloadLength(msg);
>     id = call RadioAMPacket.type(msg);
>     addr = call RadioAMPacket.destination(msg);
>     src = call RadioAMPacket.source(msg);
>     call UartPacket.clear(msg);
>     call UartAMPacket.setSource(msg, src);
>
>     if (call UartSend.send[id](addr, uartQueue[uartOut], len) == SUCCESS)
>       call Leds.led1Toggle();
>     else
>       {
>     failBlink();
>     post uartSendTask();
>       }
>   }
> /*Is it planning to acess radio message header,and deciding to  send radio
> message to serial?? If so, call UartSend.send it means to   send radio
> message to serial.Then why use call UartAMPacket.setSource(msg, src) ? What
> is its role? Why no use  call UartAMPacket.setDestination(msg, src) */
>
> Thanks for  kind help!
> Sincerely
> wkq
>
>
> ------------------------------
> 免费送你钻戒作情人节礼物 <http://love.mail.163.com/valentine/main.do>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to