/**
* The Active Message layer for the CC2420 radio. This configuration
* just layers the AM dispatch (CC2420ActiveMessageM) on top of the
- * underlying CC2420 radio packet (CC2420CsmaRadioC), which is
+ * underlying CC2420 radio packet (CC2420CsmaCsmaCC), which is
* inherently an AM packet (acknowledgements based on AM destination
* addr and group). Note that snooping may not work, due to CC2420
* early packet rejection if acknowledgements are enabled.
*
* @author Philip Levis
+ * @author David Moss
* @version $Revision$ $Date$
*/
#include "CC2420.h"
+#include "AM.h"
configuration CC2420ActiveMessageC {
provides {
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 {
components CC2420ActiveMessageP as AM;
- components CC2420CsmaC as Radio;
- components ActiveMessageAddressC as Address;
+ components CC2420CsmaC as CsmaC;
+ components ActiveMessageAddressC;
+ components UniqueSendC;
+ components UniqueReceiveC;
+ components CC2420TinyosNetworkC;
+ components CC2420PacketC;
+ components CC2420ControlC;
- SplitControl = Radio;
- Packet = AM;
+#if defined(LOW_POWER_LISTENING) || defined(ACK_LOW_POWER_LISTENING)
+ components DefaultLplC as LplC;
+#else
+ components DummyLplC as LplC;
+#endif
- AMSend = AM;
- Receive = AM.Receive;
- Snoop = AM.Snoop;
- AMPacket = AM;
-
- AM.SubSend -> Radio.Send;
- AM.SubReceive -> Radio.Receive;
- AM.amAddress -> Address;
- Radio.AMPacket -> AM;
+#if defined(PACKET_LINK)
+ components PacketLinkC as LinkC;
+#else
+ components PacketLinkDummyC as LinkC;
+#endif
- components CC2420PacketC;
+
+ RadioBackoff = AM;
+ Packet = AM;
+ AMSend = AM;
+ SendNotifier = AM;
+ Receive = AM.Receive;
+ Snoop = AM.Snoop;
+ AMPacket = AM;
+ PacketLink = LinkC;
+ LowPowerListening = LplC;
CC2420Packet = CC2420PacketC;
PacketAcknowledgements = CC2420PacketC;
+ LinkPacketMetadata = CC2420PacketC;
+
+ // 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;
-
+ AM.ActiveMessageAddress -> ActiveMessageAddressC;
+ AM.CC2420Packet -> CC2420PacketC;
+ AM.CC2420PacketBody -> CC2420PacketC;
+ AM.CC2420Config -> CC2420ControlC;
+
+ AM.SubBackoff -> CsmaC;
+
}