On Jan 10, 2005, at 3:45 AM, Yogesh Iyer wrote:
Hello,
For the Surge application which uses the MultiHopEngineM and MultiHopLEPSM modules, we have defined 3 structs viz. SurgeMsg, TOS_MHopMsg, TOS_Msg.
All the structs have different variables declared in them. Can someone please explain the usage of each structure.
I tried to follow whats going on. I think the actual message that is being sent is the TOS_Msg. The addr is set in selectRoute(), either as a Broadcast address or by Msg->addr = gpCurrentParent->id. Then, what is the need of the parentaddr in SuregeMsg?
Also, what is TOS_MHopMsg used for? Is it only to maintain some values like sourceaddr, originaddr, hopcount, etc. in the node.
In SurgeM.nc, we have defined TOS_Msg gMsgBuffer. We pass &gMsgBuffer when we call the Send.getBuffer() and Send.send() functions. What is stored in this gMsgBuffer and where do we initialized it?
My questions may be trivial but am totally confused here. I'll really thankful if so! meone can explain the use of the three structures and how are they related to each other.
I'd suggest reading three things to make your life easier. The first is Tutorial 4. The second is the ad-hoc architecture document in tinyos-1.x/doc. It's a bit outdated (I think one of the interfaces has changed slightly), but the basics are still there. The third, if you want to know the algorithms used in the collection routing -- and understand that it's just collection routing, not any-to-any, is Alec Woo's paper in SenSys 2003.
The three structures are just protocol layers. TOS_Msg is the AM packet format; TOS_MHopMsg is the routing packet format; SurgeMsg is the application packet format. Since TinyOS has a buffer swap communication interface (to remove the need for copying), components that want to send a packet need to allocate a packet buffer (a TOS_Msg). This is discussed in Tutorial 4.
Phil
-------
"We shall not cease from exploration And the end of all our exploring Will be to arrive where we started And know the place for the first time."
- T. S. Eliot, 'Little Gidding'
_______________________________________________ Tinyos-users mailing list [email protected] http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users
