Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.Receive.nc

Interface: Receive

Author: Philip Levis

Components providing this interface:
tos.lib.Broadcast.Bcast
tos.lib.Broadcast.BcastM
tos.lib.Route.MultiHopEngineM
tos.lib.Route.MultiHopRouter

Components requiring this interface:
apps.Surge.SurgeM
tos.lib.VM.contexts.RecvContextM

Events

Events - Details

receive

TOS_MsgPtr receive(TOS_MsgPtr msg, void *payload, uint16_t payloadLen)

Received a message buffer addressed to us.

Parameters:

msg - The complete buffer received.

payload - The payload portion of the packet for this protocol layer. If this layer has layers above it, it should signal receive() with payload incremented by the size of its header. Payload is a pointer into the msg structure.

payloadLen - The length of the payload buffer. If this layer has layers above it, it should signal receive() with payloadLen decreased by the size of its headers and footers.

Returns: The buffer to use for the next receive event.