From ff7c1d8f12a6247bbd43e42c4f683295c9d13a60 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Sat, 19 May 2007 14:27:08 +0000 Subject: [PATCH] added uIP over uAODV radio driver support for COOJA the radio driver assumes uAODV already has a route to the destination, hence the application is responsible for fetching routes and buffering delayed packet data --- .../sics/cooja/contikimote/ContikiMoteType.java | 17 ++++++++++++++++- .../contikimote/ContikiMoteTypeDialog.java | 13 ++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java index d4210cb46..444435875 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiMoteType.java,v 1.14 2007/05/18 13:46:31 fros4943 Exp $ + * $Id: ContikiMoteType.java,v 1.15 2007/05/19 14:27:08 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -93,19 +93,34 @@ public class ContikiMoteType implements MoteType { */ public enum CommunicationStack { UIP, + UIP_UAODV, RIME; public String toString() { if (this == UIP) return "uIP"; + if (this == UIP_UAODV) + return "uIP over uAODV"; if (this == RIME) return "Rime"; return "[unknown]"; } + public String getSourceFilenamesString() { + if (this == UIP) + return " cooja-radio.c radio-uip.c init-net-uip.c"; + if (this == UIP_UAODV) + return " cooja-radio.c radio-uip-uaodv.c init-net-uip-uaodv.c"; + if (this == RIME) + return " cooja-radio.c radio-rime.c init-net-rime.c"; + return " "; + } + public static CommunicationStack parse(String name) { if (name.equals("uIP") || name.equals("UIP")) return UIP; + if (name.equals("uIP over uAODV") || name.equals("UIP_UAODV")) + return UIP_UAODV; if (name.equals("Rime") || name.equals("RIME")) return RIME; diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java index 3e517ce8b..d57a36f44 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiMoteTypeDialog.java,v 1.30 2007/05/18 15:18:07 fros4943 Exp $ + * $Id: ContikiMoteTypeDialog.java,v 1.31 2007/05/19 14:27:08 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -44,6 +44,7 @@ import org.apache.log4j.Logger; import se.sics.cooja.*; import se.sics.cooja.MoteType.MoteTypeCreationException; +import se.sics.cooja.contikimote.ContikiMoteType.CommunicationStack; import se.sics.cooja.dialogs.MessageList; import se.sics.cooja.dialogs.ProjectDirectoriesDialog; @@ -696,9 +697,7 @@ public class ContikiMoteTypeDialog extends JDialog { smallPane.setLayout(new BoxLayout(smallPane, BoxLayout.X_AXIS)); label = new JLabel("Communication stack"); - commStackComboBox = new JComboBox(new Object[] { - ContikiMoteType.CommunicationStack.UIP, - ContikiMoteType.CommunicationStack.RIME}); + commStackComboBox = new JComboBox(CommunicationStack.values()); commStackComboBox.setSelectedIndex(0); smallPane.add(label); @@ -1443,11 +1442,7 @@ public class ContikiMoteTypeDialog extends JDialog { } // Add communication stack source files - if (commStack == ContikiMoteType.CommunicationStack.UIP) { - sourceFileNames += " cooja-radio.c radio-uip.c init-net-uip.c"; - } else if (commStack == ContikiMoteType.CommunicationStack.RIME) { - sourceFileNames += " cooja-radio.c radio-rime.c init-net-rime.c"; - } + sourceFileNames += commStack.getSourceFilenamesString(); logger.info("-- Compiling --"); logger.info("Project dirs: " + sourceDirs);