[Tinyos-help] Weird error when transmitting serial data

Hristo Bojkov hbojkov at idxs.eu
Fri Aug 24 03:35:41 PDT 2007


Hi Inderjit,

I think that it works when you have uint8_t* p; because for some reason you
have longer message than the length of TOS_Msg. Then only when you have
defined the pointer, you have enough space.

You have a check for valid length, and you compare with this expression 
MSG.length > TOSH_DATA_LENGTH
But then in the data filed you copy MSG.data and msg.type. 
If in the msg.length you have only length of the msg.data then your check is
not valid and after that with copy you use more space than is allocated by
definition of TOS_Msg tosMsg;

This can be checked easy. Just initialize p with value after lines with
memcopy and just before send. If I am right packets will contain the content
of p.


Cheers,
Hristo
 


More information about the Tinyos-help mailing list