Interface: tos.interfaces.Packet
interface Packet
The basic message data type accessors. Protocols may use
additional packet interfaces for their protocol specific
data/metadata.
- Author:
-
Philip Levis
- Date:
-
January 5 2005
- See:
-
TEP 116: Packet Protocols
Commands
command void clear(message_t *msg)
command void *getPayload(message_t *msg, uint8_t len)
command uint8_t maxPayloadLength()
command uint8_t payloadLength(message_t *msg)
command void setPayloadLength(message_t *msg, uint8_t len)
Commands - Details
clear
command void clear(message_t *msg)
- Parameters:
-
'message_t* ONE msg' the packet to clear
getPayload
command void *getPayload(message_t *msg, uint8_t len)
- Parameters:
-
'message_t* ONE msg' the packet
-
len - the length of payload required
- Returns:
-
'void* COUNT_NOK(len)' a pointer to the packet's data payload for this layer
or NULL if len is too big
maxPayloadLength
command uint8_t maxPayloadLength()
- Returns:
-
the maximum size payload allowed by this layer
payloadLength
command uint8_t payloadLength(message_t *msg)
- Parameters:
-
'message_t* ONE msg' the packet to examine
- Returns:
-
the length of its current payload
setPayloadLength
command void setPayloadLength(message_t *msg, uint8_t len)
- Parameters:
-
'message_t* ONE msg' the packet
-
len - the value to set its length field to