Interface: moteiv.tos.lib.sp.SPReceive

interface SPReceive

Standard receiving interface for receiving messages from link protocols. SPReceive will signal messages on a particular active message type from all available underlying links.

Author:
Joe Polastre, Moteiv Corporation <info@moteiv.com>

Events
event void receive(sp_message_t *spmsg, TOS_MsgPtr tosmsg, sp_error_t result) Notification that a packet (TOSMsg) has been received.

Events - Details

receive

event void receive(sp_message_t *spmsg, TOS_MsgPtr tosmsg, sp_error_t result)

Notification that a packet (TOSMsg) has been received. The pointers passed into the receive function are only valid within the context of the function. Once the callee returns control to the caller, the pointers are no longer valid. Users of this interface must copy data or perform actions before returning from the receive handler.

To access the device on which the message was received, call the SPMessage.getDev(sp_message_t*) and then query the device using the SPInterface interface.

Parameters:
spmsg - An sp_message_t structure containing metadata about the received message. Access sp_message_t fields only through the SPMessage interface.
tosmsg - The packet received.
result - Indication of an error, if any, during message reception.