X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2FCC2420ActiveMessageC.nc;h=752d20a4643c589599b814021fede954a96116ca;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=e2e741711466c4745cbdec82f038318d979d2961;hpb=4e2d4136dbadde243a1f3cafe0a7a7ee95077e89;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/CC2420ActiveMessageC.nc b/tos/chips/cc2420/CC2420ActiveMessageC.nc index e2e74171..752d20a4 100644 --- a/tos/chips/cc2420/CC2420ActiveMessageC.nc +++ b/tos/chips/cc2420/CC2420ActiveMessageC.nc @@ -1,4 +1,4 @@ -/* tab:4 +/* * "Copyright (c) 2005 Stanford University. All rights reserved. * * Permission to use, copy, modify, and distribute this software and @@ -36,6 +36,11 @@ #include "CC2420.h" #include "AM.h" +#include "Ieee154.h" + +#ifdef IEEE154FRAMES_ENABLED +#error "CC2420 AM layer cannot work when IEEE 802.15.4 frames only are used" +#endif configuration CC2420ActiveMessageC { provides { @@ -47,66 +52,51 @@ configuration CC2420ActiveMessageC { interface Packet; interface CC2420Packet; interface PacketAcknowledgements; + interface LinkPacketMetadata; interface RadioBackoff[am_id_t amId]; interface LowPowerListening; interface PacketLink; + interface SendNotifier[am_id_t amId]; } } implementation { + enum { + CC2420_AM_SEND_ID = unique(RADIO_SEND_RESOURCE), + }; + components CC2420RadioC as Radio; components CC2420ActiveMessageP as AM; + components ActiveMessageAddressC; components CC2420CsmaC as CsmaC; - components ActiveMessageAddressC as Address; - components UniqueSendC; - components UniqueReceiveC; - components CC2420TinyosNetworkC; + components CC2420ControlC; components CC2420PacketC; -#if defined(LOW_POWER_LISTENING) || defined(ACK_LOW_POWER_LISTENING) - components CC2420AckLplC as LplC; -#elif defined(NOACK_LOW_POWER_LISTENING) - components CC2420NoAckLplC as LplC; -#else - components CC2420LplDummyC as LplC; -#endif - -#if defined(PACKET_LINK) - components PacketLinkC as LinkC; -#else - components PacketLinkDummyC as LinkC; -#endif - - - RadioBackoff = CsmaC; - Packet = AM; - AMSend = AM; - Receive = AM.Receive; - Snoop = AM.Snoop; + SplitControl = Radio; + RadioBackoff = AM; + Packet = AM; + AMSend = AM; + SendNotifier = AM; + Receive = AM.Receive; + Snoop = AM.Snoop; AMPacket = AM; - PacketLink = LinkC; - LowPowerListening = LplC; - CC2420Packet = CC2420PacketC; - PacketAcknowledgements = CC2420PacketC; - - - // SplitControl Layers - SplitControl = LplC; - LplC.SubControl -> CsmaC; + PacketLink = Radio; + LowPowerListening = Radio; + CC2420Packet = Radio; + PacketAcknowledgements = Radio; + LinkPacketMetadata = Radio; - // Send Layers - AM.SubSend -> UniqueSendC; - UniqueSendC.SubSend -> LinkC; - LinkC.SubSend -> LplC.Send; - LplC.SubSend -> CC2420TinyosNetworkC.Send; - CC2420TinyosNetworkC.SubSend -> CsmaC; - - // Receive Layers - AM.SubReceive -> LplC; - LplC.SubReceive -> UniqueReceiveC.Receive; - UniqueReceiveC.SubReceive -> CC2420TinyosNetworkC.Receive; - CC2420TinyosNetworkC.SubReceive -> CsmaC; + // Radio resource for the AM layer + AM.RadioResource -> Radio.Resource[CC2420_AM_SEND_ID]; + AM.SubSend -> Radio.ActiveSend; + AM.SubReceive -> Radio.ActiveReceive; - AM.amAddress -> Address; + AM.ActiveMessageAddress -> ActiveMessageAddressC; AM.CC2420Packet -> CC2420PacketC; + AM.CC2420PacketBody -> CC2420PacketC; + AM.CC2420Config -> CC2420ControlC; + AM.SubBackoff -> CsmaC; + + components LedsC; + AM.Leds -> LedsC; }