removed old libraries (created on demand)

+ added simple error handling when creating mote types
This commit is contained in:
fros4943 2007-03-26 16:30:28 +00:00
parent 8f160a3286
commit 80dfde9ab3
12 changed files with 29 additions and 493 deletions

View file

@ -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());

View file

@ -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<Element> configXML, boolean visAvailable);
Collection<Element> configXML, boolean visAvailable) throws MoteTypeCreationException;
public class MoteTypeCreationException extends Exception {
}
}

View file

@ -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<Element> configXML, boolean visAvailable) {
Collection<Element> configXML, boolean visAvailable) throws MoteTypeCreationException {
projectDirs = new Vector<File>();
compilationFiles = new Vector<File>();
processes = new Vector<String>();
@ -1211,5 +1212,5 @@ public class ContikiMoteType implements MoteType {
boolean createdOK = configureAndInit(GUI.frame, simulation, visAvailable);
return createdOK;
}
}

View file

@ -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());

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}