]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/CC2420ActiveMessageC.nc
Merge devel code into the trunk.
[tinyos-2.x.git] / tos / chips / cc2420 / CC2420ActiveMessageC.nc
diff --git a/tos/chips/cc2420/CC2420ActiveMessageC.nc b/tos/chips/cc2420/CC2420ActiveMessageC.nc
new file mode 100644 (file)
index 0000000..ef78e86
--- /dev/null
@@ -0,0 +1,74 @@
+/*                                                                     tab:4
+ * "Copyright (c) 2005 Stanford University. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose, without fee, and without written
+ * agreement is hereby granted, provided that the above copyright
+ * notice, the following two paragraphs and the author appear in all
+ * copies of this software.
+ * 
+ * IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ * 
+ * STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
+ * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
+ * HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ * ENHANCEMENTS, OR MODIFICATIONS."
+ */
+
+/**
+ * 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
+ * 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
+ * @version $Revision$ $Date$
+ */
+
+#include "CC2420.h"
+
+configuration CC2420ActiveMessageC {
+  provides {
+    interface SplitControl;
+    interface AMSend[am_id_t id];
+    interface Receive[am_id_t id];
+    interface Receive as Snoop[am_id_t id];
+    interface AMPacket;
+    interface Packet;
+    interface CC2420Packet;
+    interface PacketAcknowledgements;
+  }
+}
+implementation {
+
+  components CC2420ActiveMessageP as AM;
+  components CC2420CsmaC as Radio;
+  components ActiveMessageAddressC as Address;
+  
+  SplitControl = Radio;
+  Packet       = AM;
+
+  AMSend   = AM;
+  Receive  = AM.Receive;
+  Snoop    = AM.Snoop;
+  AMPacket = AM;
+  
+  AM.SubSend    -> Radio.Send;
+  AM.SubReceive -> Radio.Receive;
+  AM.amAddress -> Address;
+  Radio.AMPacket -> AM;
+
+  components CC2420PacketC;
+  CC2420Packet = CC2420PacketC;
+  PacketAcknowledgements = CC2420PacketC;
+
+
+}