> Hi,
>
> I have trouble sending msg from laptop (using c++) code to tmote.  All the
> code is at the bottom. I have no problem reading the data from the serial
> but sending it back dooesn't seam to work. Anyone knows why? Thanks.
>
> Indy
[...]
>     memcpy(output_buffer, &msgOUT, sizeof(msgOUT));

Out of the dozens of things that could be wrong, it might be worth pointing
out that C does not guarantee that structures can be serialized by copying
bytewise out of memory like that. It can work, but you never know. The most
usual reason why that would fail is if the compiler tries to align the
members of the structure and inserts padding (which it almost always does
with odd-sized byte fields). At any rate, it would be a good idea to make
sure that the code really generates the byte stream that you think it's
generating.

Ben B.



_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to