[Tinyos-help] BaseStationP.nc--I need your help
Eric Decker
cire831 at gmail.com
Sat Feb 7 21:58:30 PST 2009
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 <wkq5325 at 163.com>
> 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
> Tinyos-help at millennium.berkeley.edu
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090207/3928ae7b/attachment.htm
More information about the Tinyos-help
mailing list