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

Interface: ReceiveMsg

TinyOS AM packet reception interface.
Author: Jason Hill
  David Gay
  Philip Levis
Modified: 6/25/02

Components providing this interface:
apps.Bombilla.AMFilter
apps.Bombilla.AMPromiscuous
apps.Bombilla.GenericComm
apps.Bombilla.GenericCommPromiscuous
tos.lib.TinySec.AMStandardTinySec
tos.lib.TinySec.SecureGenericComm
tos.platform.avrmote.InjectMsg
tos.platform.mica.MicaHighSpeedRadioM
tos.platform.mica.MicaHighSpeedRadioTinySecM
tos.platform.mica.RadioCRCPacket
tos.platform.mica.RadioPacketTinySec
tos.platform.mica.RadioPacketTinySecM
tos.system.AMPromiscuous
tos.system.AMStandard
tos.system.CrcFilter
tos.system.FramerAckM
tos.system.FramerM
tos.system.GenericComm
tos.system.GenericCommPromiscuous
tos.system.NoCRCPacket
tos.system.PacketSink
tos.system.UARTComm
tos.system.UARTFramedPacket
tos.system.UARTNoCRCPacket

Components requiring this interface:
apps.Bombilla.AMFilter
apps.Bombilla.AMPromiscuous
apps.GenericBase.GenericBaseM
apps.HighFrequencySampling.HFSM
apps.HighFrequencySampling.HFSRead
apps.Ident.AppM
apps.Ident.IdentC
apps.MicaHWVerify.MicaHWVerifyM
apps.Oscilloscope.OscilloscopeM
apps.OscilloscopeRF.OscilloscopeM
apps.SecureTOSBase.SecureTOSBaseM
apps.SenseLightToLog.SimpleCmdM
apps.SimpleCmd.SimpleCmdM
apps.TASKApp.Field
apps.TOSBase.TOSBaseM
apps.TestEEPROM.ByteSpeed.ETimingM
apps.TestEEPROM.EEPROM.TestEEPROMM
apps.TestEEPROM.Page.TestEEPROMM
apps.TestEEPROM.PageSpeed.ETimingM
apps.TestMatchbox.Timing.TimingM
apps.TestTinySec.TestTinySecM
apps.TestTinyViz.TestTinyVizM
apps.TransparentBase.TOSBaseM
tos.lib.Broadcast.Bcast
tos.lib.Broadcast.BcastM
tos.lib.Counters.RfmToIntM
tos.lib.FS.Remote
tos.lib.Route.MultiHopEngineM
tos.lib.Route.MultiHopLEPSM
tos.lib.Route.MultiHopRouter
tos.lib.TinyDB.NetworkMultiHopM
tos.lib.TinySec.AMStandardTinySec
tos.lib.VM.components.BVirus
tos.lib.VM.contexts.RecvContextM
tos.platform.mica.RadioPacketTinySecM
tos.system.AMPromiscuous
tos.system.AMStandard
tos.system.CrcFilter
tos.system.FramerAckM

Events

Events - Details

receive

TOS_MsgPtr receive(TOS_MsgPtr m)

A packet has been received. The packet received is passed as a pointer parameter. The event handler should return a pointer to a packet buffer for the reception layer to use for the next reception. This allows an application to swap buffers back and forth with the messaging layer, preventing the need for copying. The signaled component should not maintain a reference to the buffer that it returns. It may return the buffer it was passed. For example:
 event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) {
    return m;
 }
 
A more common example:
 TOS_MsgPtr buffer;
 event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr m) {
    TOS_MsgPtr tmp;
    tmp = buffer;
    buffer = m;
	post receiveTask();
	return tmp;
 }
 
Returns: A buffer for the provider to use for the next packet.