Hi,
Can someone clarify following code for me? It is from the CountSendP component in boomerang:
     CountMsg_t* body = (CountMsg_t*)m_msg.data;
     body->n = m_count;
     body->src = TOS_LOCAL_ADDRESS;

CountMsg_t is a variable of struct CountMsg.
m_msg is a variable of TOS_Msg.
m_msg.data is referring to the data field of TOS_Msg struct.
body is a pointer to the variable CountMsg_t.
I know that m_msg.data = 29 and m_msg.data is being typecast by (CountMsg_t*), but still not sure how to interpret: CountMsg_t* body = (CountMsg_t*)m_msg.data.

Thanks,
Mikael
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to