You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original author: mortenthansen (November 24, 2010 00:41:45)
When receiving a packet from the serial in TOSSIM the current code assumes that the incoming serial packet is aligned with the message_t structure. As the message_header_t structure is a union of the tossim_header_t and serial_header_t this is not the case when sizeof(tossim_header_t)>sizeof(serial_header_t).
Thus when the tossim/sf/sim/SerialActiveMessageC receives a packet from the serial it needs to be copied into the message_t at the correct offset. The diff of the tossim/sf/sim/SerialActiveMessageC below fixes this issue:
From mortenthansen on December 17, 2010 01:44:33
I doubt your version will work.
The incomming packet (message_t* msg) is always from a serial forwarder which have no idea about the header alignment of TOSSIM messages and will then be aligned with msg->header. The new packet (message_t* newMsg) should have the prober alignment so on this message_t we should use getHeader(newMsg).
From philip.l...@gmail.com on December 18, 2010 01:42:30
It does. Sorry, it's been a long time since I saw this code; I forgot that the message coming in will be aligned at the beginning of the struct, not the proper header position. This actually suggests the typing of the functions is wrong, as technically it's not a message_t being passed in. But oh well.
I'll test your fix on Monday and check it in if it works for me.
Original author: mortenthansen (November 24, 2010 00:41:45)
When receiving a packet from the serial in TOSSIM the current code assumes that the incoming serial packet is aligned with the message_t structure. As the message_header_t structure is a union of the tossim_header_t and serial_header_t this is not the case when sizeof(tossim_header_t)>sizeof(serial_header_t).
Thus when the tossim/sf/sim/SerialActiveMessageC receives a packet from the serial it needs to be copied into the message_t at the correct offset. The diff of the tossim/sf/sim/SerialActiveMessageC below fixes this issue:
@@ -276,8 +276,9 @@ implementation {
Original issue: http://code.google.com/p/tinyos-main/issues/detail?id=9
The text was updated successfully, but these errors were encountered: