diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index b98432b38..895605e0c 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.36 2007/03/25 21:32:33 fros4943 Exp $ + * $Id: GUI.java,v 1.37 2007/03/26 16:31:09 fros4943 Exp $ */ package se.sics.cooja; @@ -50,6 +50,7 @@ import org.jdom.input.SAXBuilder; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; +import se.sics.cooja.MoteType.MoteTypeCreationException; import se.sics.cooja.contikimote.*; import se.sics.cooja.dialogs.*; import se.sics.cooja.plugins.*; @@ -896,7 +897,13 @@ public class GUI { // Create mote type logger.info("> Creating mote type"); - ContikiMoteType moteType = new ContikiMoteType(moteTypeID); + ContikiMoteType moteType; + try { + moteType = new ContikiMoteType(moteTypeID); + } catch (MoteTypeCreationException e) { + logger.fatal("Exception when creating mote type: " + e); + return false; + } moteType.setDescription("Mote type: " + filename); moteType.setContikiBaseDir(contikiBaseDir.getPath()); moteType.setContikiCoreDir(contikiCoreDir.getPath()); diff --git a/tools/cooja/java/se/sics/cooja/MoteType.java b/tools/cooja/java/se/sics/cooja/MoteType.java index 115fea012..4bb75dc2a 100644 --- a/tools/cooja/java/se/sics/cooja/MoteType.java +++ b/tools/cooja/java/se/sics/cooja/MoteType.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: MoteType.java,v 1.4 2007/03/23 23:34:33 fros4943 Exp $ + * $Id: MoteType.java,v 1.5 2007/03/26 16:31:09 fros4943 Exp $ */ package se.sics.cooja; @@ -118,7 +118,7 @@ public interface MoteType { * @return True if mote type has valid settings and is ready to be used */ public boolean configureAndInit(JFrame parentFrame, Simulation simulation, - boolean visAvailable); + boolean visAvailable) throws MoteTypeCreationException; /** * Returns XML elements representing the current config of this mote type. @@ -146,6 +146,9 @@ public interface MoteType { * @return True if config was set successfully, false otherwise */ public boolean setConfigXML(Simulation simulation, - Collection configXML, boolean visAvailable); + Collection configXML, boolean visAvailable) throws MoteTypeCreationException; + + public class MoteTypeCreationException extends Exception { + } } diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java index 87c100f29..0967b31bc 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.8 2007/03/23 23:34:33 fros4943 Exp $ + * $Id: ContikiMoteType.java,v 1.9 2007/03/26 16:30:29 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -147,7 +147,7 @@ public class ContikiMoteType implements MoteType { * @param identifier * Unique identifier for this mote type */ - public ContikiMoteType(String identifier) { + public ContikiMoteType(String identifier) throws MoteTypeCreationException { doInit(identifier); } @@ -155,7 +155,8 @@ public class ContikiMoteType implements MoteType { return new ContikiMote(this, simulation); } - public boolean configureAndInit(JFrame parentFrame, Simulation simulation, boolean visAvailable) { + public boolean configureAndInit(JFrame parentFrame, Simulation simulation, boolean visAvailable) + throws MoteTypeCreationException { if (visAvailable) { return ContikiMoteTypeDialog.showDialog(parentFrame, simulation, this); } else { @@ -241,7 +242,7 @@ public class ContikiMoteType implements MoteType { * Mote type identifier * @return True if initialization ok, false otherwise */ - protected boolean doInit(String identifier) { + protected boolean doInit(String identifier) throws MoteTypeCreationException { this.identifier = identifier; if (myCoreComm != null) { @@ -1149,7 +1150,7 @@ public class ContikiMoteType implements MoteType { } public boolean setConfigXML(Simulation simulation, - Collection configXML, boolean visAvailable) { + Collection configXML, boolean visAvailable) throws MoteTypeCreationException { projectDirs = new Vector(); compilationFiles = new Vector(); processes = new Vector(); @@ -1211,5 +1212,5 @@ public class ContikiMoteType implements MoteType { boolean createdOK = configureAndInit(GUI.frame, simulation, visAvailable); return createdOK; } - + } diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteTypeDialog.java index ddd4b92d9..40388f7a1 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.24 2007/03/24 00:44:55 fros4943 Exp $ + * $Id: ContikiMoteTypeDialog.java,v 1.25 2007/03/26 16:30:29 fros4943 Exp $ */ package se.sics.cooja.contikimote; @@ -43,6 +43,7 @@ import javax.swing.event.*; import org.apache.log4j.Logger; import se.sics.cooja.*; +import se.sics.cooja.MoteType.MoteTypeCreationException; import se.sics.cooja.dialogs.MessageList; import se.sics.cooja.dialogs.ProjectDirectoriesDialog; @@ -2055,7 +2056,11 @@ public class ContikiMoteTypeDialog extends JDialog { } } else if (e.getActionCommand().equals("create")) { // Create mote type and set various data - myMoteType.doInit(textID.getText()); + try { + myMoteType.doInit(textID.getText()); + } catch (MoteTypeCreationException ex) { + logger.fatal("Exception when loading library: " + ex); + } myMoteType.setDescription(textDescription.getText()); myMoteType.setContikiBaseDir(textContikiDir.getText()); myMoteType.setContikiCoreDir(textCoreDir.getText()); diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib1.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib1.java deleted file mode 100644 index f8028ba4f..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib1.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib1.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib1 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib1(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib2.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib2.java deleted file mode 100644 index 725badd88..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib2.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib2.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib2 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib2(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib3.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib3.java deleted file mode 100644 index e9fe850e6..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib3.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib3.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib3 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib3(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib4.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib4.java deleted file mode 100644 index 77713f5da..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib4.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib4.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib4 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib4(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib5.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib5.java deleted file mode 100644 index b1f3e3ead..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib5.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib5.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib5 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib5(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib6.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib6.java deleted file mode 100644 index 6b38cb5ae..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib6.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib6.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib6 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib6(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib7.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib7.java deleted file mode 100644 index 996e8998f..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib7.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib7.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib7 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib7(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -} diff --git a/tools/cooja/java/se/sics/cooja/corecomm/Lib8.java b/tools/cooja/java/se/sics/cooja/corecomm/Lib8.java deleted file mode 100644 index 071de05a4..000000000 --- a/tools/cooja/java/se/sics/cooja/corecomm/Lib8.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: Lib8.java,v 1.2 2006/08/23 17:13:03 fros4943 Exp $ - */ - -package se.sics.cooja.corecomm; -import java.io.File; - -import se.sics.cooja.*; - -/** - * @see CoreComm - * @author Fredrik Osterlind - */ -public class Lib8 extends CoreComm { - - /** - * Loads library libFile. - * - * @see CoreComm - * @param libFile Library file - */ - public Lib8(File libFile) { - System.load(libFile.getAbsolutePath()); - init(); - } - - public native void tick(); - public native void init(); - public native int getReferenceAbsAddr(); - public native void getMemory(int start, int length, byte[] mem); - public native void setMemory(int start, int length, byte[] mem); - -}