Hi everyone,

My packet has the following format:
lower-layer header | my header | payload

There exists a nx_union filed in the header, thus the header length is not
fixed and the typical implementation of Packet.getPayload() may not work:

command void* Packet.getPayload(message_t* msg, uint8_t len) {
uint8_t* payload = call SubPacket.getPayload(msg, len +
sizeof(data_header_t));
if (payload != NULL) {
  payload += sizeof(data_header_t);
}
return payload;
}

Can anyone give me some suggestion on how Packet.getPayload() can be
implemented on variable length header? Thanks.

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

Reply via email to