The message ID, i.e., AM_SIMPLECMDMSG, is completely arbitrary as long
as both ends of the communication agree on the data structure being
sent. If you want to support different messages (using the GenericComm
message vectoring feature) you need different IDs, otherwise its up
to you if you want to maintain version information or something...
However, I'm not clear at which point you are stuck. I get the feeling
that your messages are not getting through. If that is the case are you
packaging your SimpleCmdMsg in a TOSMsg before sending it? e.g.:
SimpleCmdMsg *scm = TosMsg.data;
scm->seqno = NNN;
// set fields, ... etc
/send
SimpleCmdMsg.send( TOS_BCAST_ADDR, sizeof(SimpleCmdMsg), &TOSMsg);
I think the messaging portion of the tutorial describes most of this.
MS
BHAVSAR wrote:
Hi,
I am sending a packet of SimpleCmdMsg using GenericComm component's
SendMsg interface.
Wiring is BaseStationM.SendtoRfm -> GenericComm.SendMsg[AM_SIMPLECMDMSG];
Here, BasestationM is my component.
typedef struct SimpleCmdMsg {
uint16_t seqno;
uint8_t action;
uint16_t source;
uint16_t val[10];
uint16_t parent;
uint16_t volt;
} SimpleCmdMsg;
Do I need to modify AM_SIMPLECMDMSG = 29 in SimpleCmdMsg.h ? If so, every
time I modify my packet structure, I need to change AM_SIMPLECMDMSG.
I am really stuck at this point. Any help or document on this will be
appreciated.
Thanks.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help