Thanks Eric and Philip. I found where the code overwrites the type. Now, I
am trying Philip's solution

Neil Lin 

发件人:  Eric Decker <cire...@gmail.com>
日期:  Tue, 17 Dec 2013 12:04:13 -0800
至:  lin lin <lin....@whu.edu.cn>
抄送:  Tinyos-Help <tinyos-help@millennium.berkeley.edu>
主题:  Re: [Tinyos-help] AMPacket.setType()


first, sorry for being a bit crusty.   old age.   :-)

On Tue, Dec 17, 2013 at 4:53 AM, Lin Hai <lin....@whu.edu.cn> wrote:
> Thanks Eric, I will try to learn how to fish and I will take time for gihub

my point is it is very difficult to figure out what is going on from little
snipets.
 
> 
> But since new to the tinyos, I already tried my best to explain my problem.

I understand.   you did well.   if one can take the time to think what
others would need to help, it would make it easier for us to help you.
 
> While I think you are right, it is probably lower codes over write it.

yes.
 
>  So I will try to find these lower codes, but seriously, I have no idea how to
> locate these codes.

that is why i suggested getting a JTAG and then you can single step the
code.   That is how I learned how things work.

Another way, is to build using "verbose", ie.

make verbose telosb

It will tell you explicitly what files are being used to build the system.

You can also generate a document that will show you graphically what the
wiring looks like but I don't remember how to do that.
 
> 
> Thanks again
> 
> Neil Lin 
> 
> 
> 
> 发件人:  Eric Decker <cire...@gmail.com>
> 日期:  Tue, 17 Dec 2013 01:32:53 -0800
> 至:  lin lin <lin....@whu.edu.cn>
> 抄送:  Tinyos-Help <tinyos-help@millennium.berkeley.edu>
> 主题:  Re: [Tinyos-help] AMPacket.setType()
> 
> 
> first, get a jtag and learn to single step the code.
> 
> I suspect that you have wired a hard coded am_type at a higher level.   You
> can call AMPacket.type but it will get over written later.
> 
> However, that is just a guess.   It is impossible to determine what is going
> on from the little bit of information you've provide.
> 
> Seriously, what do you want from us?   How about you think to your self what
> would help us help you.
> 
> What code base are you working on?
> 
> Better would be if you are based on github://github.com/tinyos/tinyos-main
> <http://github.com/tinyos/tinyos-main>  and fork so you have your own
> published copy.  Then
> you could push your modifications up to your public tree.   Then you could
> point us at the tree along with what particular application
> you were building and for what platform.
> 
> Seriously, what did you expect us to do with the little bit of information you
> gave us above.
> 
> Most folks would simply ignore you.   Hopefully I'm teaching you how to fish.
> 
> 
> 
> On Tue, Dec 17, 2013 at 12:45 AM, Lin Hai <lin....@whu.edu.cn> wrote:
>> 
>> Hi Guys,
>> 
>> I am new to Tinyos. I am using AMSend.send(am_addr_t addr, message_t* msg,
>> uint8_t len) to send packet to the destination. Before sending, I use l
>> AMPacket.setType() to set type as follows:
>> 
>>  uint8_t  AMID=3;
>> call AMPacket.setType(&m_msg, AMID);
>> 
>> 
>> But it seems the type of the packet fails to be set to 3. on the destination:
>> 
>> call AMPacket.type(msg)
>> 
>> The results is 123 (using %d to print it)
>> 
>> I checked the AMPacket component. It indicates that
>> 
>> "As the AM type is set as part
>>    * of sending with the AMSend interface, this command is not used
>>    * for sending packets."
>> 
>> Does this mean that AMPacket.setType() function can not be used? So if I want
>> to define different types of packet, how should I do?
>> 
>> Thanks in advance
>> 
>> Neil Lin
>> 
>> _______________________________________________
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
> 
> 
> -- 
> Eric B. Decker
> Senior (over 50 :-) Researcher
> 



-- 
Eric B. Decker
Senior (over 50 :-) Researcher



_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to