Finally I find a method to solve the problem.
I consult AM.h and watch TOS_Msg struct.
I see addr is the first field.
So I declare a variable uint16_t moteID.
and add these code:
moteID = msg->addr; /* msg is argument TOS_MsgPtr */
if(moteID == TOS_LOCAL_ADDRESS)
{
/* do something */
}
I dont know whether this method is correct or not.
But now only mote 10 will do something I want.
thx, all. You are so kind.
Chen, Chien Mao
> Date: Thu, 2 Aug 2007 10:51:32 -0600> From: [EMAIL PROTECTED]> To: [EMAIL
> PROTECTED]> CC: [EMAIL PROTECTED]; [email protected]>
> Subject: Re: [Tinyos-help] AM_INTMSG or TOS_BCAST_ADDR> > On the issue of not
> filtering by moteID...> T1 GenericComm on micas does, and your mod of send is
> correct.> However I've heard tales of that not happening on this list,> but I
> don't remember what combination of modules and platforms> were at issue. You
> could try a search and see if anything turns up.> MS> > > Urs Hunkeler
> wrote:> > Hi,> > > > Think of AM_INTMSG as something like a port number. It
> does not identify> > a mote. TOS_BCAST_ADDR is a broadcast address. All nodes
> that physically> > receive the message will forward it to the application
> layer. You can> > find more information in this paper:
> http://www.tinyos.net/papers/ammote.pdf> > > > Cheers,> > Urs> > > > > > Chen
> Bleed schrieb:> >> > >> Hello, all> >> > >> Now I am studying for Lesson 4
> of TinyOS 1.x tutorial.I!
have two tmote sky(s) and I also have a problem.> >> > >> The file
IntToRfm.nc has the line "IntToRfmM.Send -> Comm.SendMsg[AM_INTMSG];"I consult
IntMsg.h and find out the value of AM_INTMSG is 4(by default, you can change).>
>> > >> The id of One of my tmote is 3. I upload CntToLedsAndRfm program.The
other tmote whose id is 4. I upload RfmToLeds program.It works fine.> >> > >>
When I change the code in IntToRfmM.nc/* code - start */if (call
Send.send(TOS_BCAST_ADDR, sizeof(IntMsg), &data)) return SUCCESS;/* code - end
*/> >> > >> to code/* code - start */if (call Send.send(0x000a,
sizeof(IntMsg), &data)) return SUCCESS;/* code - end */> >> > >> I want to
transmit message to mote 10 but mote 4 still receives messages.(I know
TOS_BCAST_ADDR is 0xffff).Then I run CntToLedsAndRfm on TinyViz and create 30
motes.I see all motes has shot radio purple line to mote 10(use radio plugin).I
am confused!!!> >> > >> So, I cannot change this result(mote 4 receives
messages) !
even if I modify the destination address??Indeed, I dont know the rela
tion between AM_INTMSG and TOS_BCAST_ADDR.Does anyone explain it??> >> thx all,
and sorry for my bad English.Chen, Chien Mao> >
_______________________________________________> > Tinyos-help mailing list> >
[email protected]> >
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_________________________________________________________________
下載最新版本的 Windows Live Messenger 8.1,分享音樂、共用搜尋,和即時傳訊好友線上同樂!— 立即下載
http://get.live.com/messenger/overview
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help