[Tinyos-help] Components new AMSenderC(TOS_NODE_ID)?

Philip Levis pal at cs.stanford.edu
Thu Jun 11 13:51:24 PDT 2009


On Jun 11, 2009, at 1:27 PM, Gary Lee wrote:

> hi,
>
> What is wrong with the following statement?
>
> Components new AMSenderC(TOS_NODE_ID)?
>
> That is, can I used TOS_NODE_ID as the AM? When I compile it, I got  
> error saying that "TOS_NODE_ID" is not a constant...
>

TOS_NODE_ID is a variable (it has a location in memory). You can't  
pass a variable to a generic component initializer. Furthermore, why  
do you pass the node ID to AMSenderC? That generic takes an AM type  
(message type identifier) as a parameter, not an AM address (node  
identifier). The former is 8 bits, the latter is 16...

Phil


More information about the Tinyos-help mailing list