[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/4bitle
LinkEstimatorP.nc, 1.2, 1.3
Phil Levis
scipio at users.sourceforge.net
Fri Oct 26 17:07:59 PDT 2007
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/4bitle
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23123
Modified Files:
LinkEstimatorP.nc
Log Message:
Fix bug in link estimator packet payload get. The old version
considered the LE header when calculating a valid payload. THis
is problematic if you receive a packet with a large footer, but
want to send a packet with a large payload: the getPayload() would
incorrectly only let you get a small payload and so return NULL.
This is probably the first instance I've seen where clear() might
have been useful....
Index: LinkEstimatorP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/4bitle/LinkEstimatorP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LinkEstimatorP.nc 25 Sep 2007 13:47:14 -0000 1.2
--- LinkEstimatorP.nc 27 Oct 2007 00:07:56 -0000 1.3
***************
*** 691,697 ****
// application payload pointer is just past the link estimation header
command void* Packet.getPayload(message_t* msg, uint8_t len) {
! linkest_header_t *hdr = getHeader(msg);
! uint8_t footerLen = (hdr->flags & NUM_ENTRIES_FLAG) * sizeof(linkest_header_t);
! void* payload = call SubPacket.getPayload(msg, len + footerLen);
if (payload != NULL) {
payload += sizeof(linkest_header_t);
--- 691,695 ----
// application payload pointer is just past the link estimation header
command void* Packet.getPayload(message_t* msg, uint8_t len) {
! void* payload = call SubPacket.getPayload(msg, len + sizeof(linkest_header_t));
if (payload != NULL) {
payload += sizeof(linkest_header_t);
More information about the Tinyos-2-commits
mailing list