Interface: tos.interfaces.PacketAcknowledgements

interface PacketAcknowledgements

This interface allows a component to enable or disable acknowledgments on a per-packet basis.

Author:
Jonathan Hui
Philip Levis
Joe Polastre
Date:
June 21 2006

Commands
command error_t noAck(message_t *msg) Tell a protocol that when it sends this packet, it should not use synchronous acknowledgments.
command error_t requestAck(message_t *msg) Tell a protocol that when it sends this packet, it should use synchronous acknowledgments.
command bool wasAcked(message_t *msg) Tell a caller whether or not a transmitted packet was acknowledged.

Commands - Details

noAck

command error_t noAck(message_t *msg)

Tell a protocol that when it sends this packet, it should not use synchronous acknowledgments.

Parameters:
msg - - A message which should not be acknowledged when transmitted.
Returns:
SUCCESS if acknowledgements are disabled, EBUSY if the communication layer cannot disable them at this time, FAIL if it cannot support unacknowledged communication.

requestAck

command error_t requestAck(message_t *msg)

Tell a protocol that when it sends this packet, it should use synchronous acknowledgments. The acknowledgment is synchronous as the caller can check whether the ack was received through the wasAcked() command as soon as a send operation completes.

Parameters:
msg - - A message which should be acknowledged when transmitted.
Returns:
SUCCESS if acknowledgements are enabled, EBUSY if the communication layer cannot enable them at this time, FAIL if it does not support them.

wasAcked

command bool wasAcked(message_t *msg)

Tell a caller whether or not a transmitted packet was acknowledged. If acknowledgments on the packet had been disabled through noAck(), then the return value is undefined. If a packet layer does not support acknowledgements, this command must return always return FALSE.

Parameters:
msg - - A transmitted message.
Returns:
Whether the packet was acknowledged.