[Tinyos-devel] purpose of the Packet.clear() function

Miklos Maroti mmaroti at math.u-szeged.hu
Mon Oct 8 01:48:25 PDT 2007

> In the meta data of the packet, there is no other way. I just change the
>  ack field to WAS_(NOT_)ACKED when I pass the packet up. The PacketAck
> interface changes this to (NO_)ACK_REQUESTED. The Mac can now detect
> when a user forgot to set the ack field and assumes ACK_REQUESTED.

Then if the user uses a packet that came from the serial interface
whose metadata layout is completely different from yours, then what do
you do? You cannot trust the metadata when the AMSend.send() is
called, so you get unpredicted results! Forexample the user does not
know about acks, never needed to set them because you smart MAC is
always doing it for him, then he will be suprised if somehow he gets
to own a message buffer that is ill formated, i.e. it appears that
acks were not requested. See my point? People should call Packet.clear
every time they send a message!


More information about the Tinyos-devel mailing list