Eric, stop being a jerk. 

Lin Hai, your conclusion is correct: you cannot set the AM type above the AM 
layer, because when you call Send it fills in the value. The function is there 
because the AM layer uses it, and more generally, so that one could do 
something like 

call AMPacket.setType(&m, X);

… in another, later piece of code:

call AMSend.send[AMPacket.type(&m)](…)

Phil

-------
Philip Levis
Associate Professor
Computer Science and Electrical Engineering
Stanford University
http://csl.stanford.edu/~pal

On Dec 17, 2013, at 1:32 AM, Eric Decker <cire...@gmail.com> wrote:

> 
> 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 
> 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
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


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

Reply via email to