+++ /dev/null
-/*\r
- * Copyright (c) 2005-2006 Arch Rock Corporation\r
- * All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * - Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * - Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the\r
- * distribution.\r
- * - Neither the name of the Arch Rock Corporation nor the names of\r
- * its contributors may be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\r
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r
- * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\r
- * OF THE POSSIBILITY OF SUCH DAMAGE\r
- */\r
-\r
-/**\r
- * Basic implementation of a CSMA MAC for the ChipCon CC2420 radio.\r
- *\r
- * @author Jonathan Hui <jhui@archrock.com>\r
- * @version $Revision$ $Date$\r
- */\r
-\r
-#include "CC2420.h"\r
-#include "IEEE802154.h"\r
-\r
-configuration CC2420CsmaC {\r
-\r
- provides interface SplitControl;\r
- provides interface Send;\r
- provides interface Receive;\r
- provides interface CsmaBackoff[am_id_t amId];\r
-\r
- uses interface AMPacket;\r
-\r
-}\r
-\r
-implementation {\r
-\r
- components CC2420CsmaP as CsmaP;\r
-\r
- CsmaBackoff = CsmaP;\r
- SplitControl = CsmaP;\r
- Send = CsmaP;\r
- AMPacket = CsmaP;\r
-\r
- components CC2420ControlC;\r
- AMPacket = CC2420ControlC;\r
- CsmaP.Resource -> CC2420ControlC;\r
- CsmaP.CC2420Power -> CC2420ControlC;\r
-\r
- components CC2420TransmitC;\r
-\r
- CsmaP.SubControl -> CC2420TransmitC;\r
- CsmaP.CC2420Transmit -> CC2420TransmitC;\r
- CsmaP.SubBackoff -> CC2420TransmitC;\r
-\r
- components CC2420ReceiveC;\r
- Receive = CC2420ReceiveC;\r
- CsmaP.SubControl -> CC2420ReceiveC;\r
-\r
- components RandomC;\r
- CsmaP.Random -> RandomC;\r
-\r
- components LedsC as Leds;\r
- CsmaP.Leds -> Leds;\r
-\r
- components MainC;\r
- MainC.SoftwareInit -> CsmaP;\r
- MainC.SoftwareInit -> CC2420ControlC;\r
- MainC.SoftwareInit -> CC2420TransmitC;\r
- MainC.SoftwareInit -> CC2420ReceiveC;\r
-}\r