Can I ask why you are trying to dynamically change the value of the AM type at runtime via this interface? The traditional way to "change" the AM type is to include multiple instances of SerialAMSenderC() in your configuration, each instantiated with a different AM type. When you want to send a message with a particular AM type, you choose the proper instance of the AMSend interface provided by one of these components.
I'm not sure exactly why what you were trying to do originally wouldn't work in theory, but I suspect it has something to do with not using the proper components in your configuration. Kevin On Jan 15, 2008 1:53 AM, Andreas Reinhardt <[EMAIL PROTECTED]> wrote: > Hi, > Using tmotes on tinyos-2.x, I am looking for a solution to manually > set the AMtype field of an AMPacket that I send out over the serial > port. When I set it using the AMPacket.setType(..) method prior to > calling AMSend.send(), it seems it is always reset by > SerialActiveMessageP.nc. But even if I uncomment line 63 in the > AMSend.send() method of that file, things don't change: > > // [... ]header->group = TOS_AM_GROUP; > //header->type = id; // Commented out > header->length = len; [...] > > However, if I enter any arbitrary number here (such as: header->type = > 4;), it appears correctly in the data stream over the serial port. How > can that be - browsing the source code doesn't show up any other > methods handling the packet in the meantime. > > Any other solutions are appreciated. > > Thanks, > Andreas > > _______________________________________________ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- ~Kevin _______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help