* Amir: >Can anyone explain to me the difference between these two declarations >Comm.SendMsg[AM_MSG]; >Comm.ReceiveMsg[AM_MSG]; > >and > >Comm.SendMsg; >Comm.ReceiveMsg; > >I cannot comprehend why the former declaration is needed.
TinyOS uses the "Active Message" abstraction. Which just means that every message carries with it an 8 bit value used to identify its type (sort of like a protocol number on ethernet or a port number in TCP). When you use Comm.SendMsg[AM_MSG], the messages you send will be marked as type AM_MSG. Similarly, Comm.ReceiveMsg[AM_MSG] will only pass messages of type AM_MSG. AM_MSG should be an enum constant or a macro of an 8 bit value. Regards, Alexander _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
