X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2FCC2420ActiveMessageC.nc;h=e80e033d10396b73b876b9fb3ab8524aab61d46b;hb=815ef3b081a7a86619e82be995eddae5c907b46a;hp=509bc6fb869de26da15ef36a8911251248e827e5;hpb=d99e9e4b31b1b6459b3811a5257a0c00821ab314;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/CC2420ActiveMessageC.nc b/tos/chips/cc2420/CC2420ActiveMessageC.nc index 509bc6fb..e80e033d 100644 --- a/tos/chips/cc2420/CC2420ActiveMessageC.nc +++ b/tos/chips/cc2420/CC2420ActiveMessageC.nc @@ -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 { @@ -55,29 +60,18 @@ configuration CC2420ActiveMessageC { } } implementation { + enum { + CC2420_AM_SEND_ID = unique(IEEE154_SEND_CLIENT), + }; + components CC2420RadioC as Radio; components CC2420ActiveMessageP as AM; - components CC2420CsmaC as CsmaC; components ActiveMessageAddressC; - components UniqueSendC; - components UniqueReceiveC; - components CC2420TinyosNetworkC; - components CC2420PacketC; + components CC2420CsmaC as CsmaC; components CC2420ControlC; + components CC2420PacketC; -#if defined(LOW_POWER_LISTENING) || defined(ACK_LOW_POWER_LISTENING) - components DefaultLplC as LplC; -#else - components DummyLplC as LplC; -#endif - -#if defined(PACKET_LINK) - components PacketLinkC as LinkC; -#else - components PacketLinkDummyC as LinkC; -#endif - - + SplitControl = Radio; RadioBackoff = AM; Packet = AM; AMSend = AM; @@ -85,28 +79,16 @@ implementation { Receive = AM.Receive; Snoop = AM.Snoop; AMPacket = AM; - PacketLink = LinkC; - LowPowerListening = LplC; - CC2420Packet = CC2420PacketC; - PacketAcknowledgements = CC2420PacketC; - LinkPacketMetadata = CC2420PacketC; + PacketLink = Radio; + LowPowerListening = Radio; + CC2420Packet = Radio; + PacketAcknowledgements = Radio; + LinkPacketMetadata = Radio; - // SplitControl Layers - SplitControl = LplC; - LplC.SubControl -> CsmaC; - - // 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.ActiveMessageAddress -> ActiveMessageAddressC; AM.CC2420Packet -> CC2420PacketC; @@ -114,4 +96,7 @@ implementation { AM.CC2420Config -> CC2420ControlC; AM.SubBackoff -> CsmaC; + + components LedsC; + AM.Leds -> LedsC; }