diff --git a/platform/cooja/cfs/cfs-cooja.c b/platform/cooja/cfs/cfs-cooja.c index b8b4fd37e..3819277b6 100644 --- a/platform/cooja/cfs/cfs-cooja.c +++ b/platform/cooja/cfs/cfs-cooja.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: cfs-cooja.c,v 1.10 2009/09/08 15:08:20 zhitao Exp $ + * $Id: cfs-cooja.c,v 1.11 2010/02/05 08:59:51 fros4943 Exp $ */ #include #include "lib/simEnvChange.h" @@ -49,7 +49,7 @@ static struct filestate file; const struct simInterface cfs_interface; // COOJA variables -#define CFS_BUF_SIZE 1000000 +#define CFS_BUF_SIZE 1000 /* Configure CFS size here and in ContikiCFS.java */ char simCFSData[CFS_BUF_SIZE] = { 0 }; char simCFSChanged = 0; int simCFSRead = 0; diff --git a/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiCFS.java b/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiCFS.java index 2b7b10b37..17522c307 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiCFS.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiCFS.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiCFS.java,v 1.10 2009/05/26 14:24:20 fros4943 Exp $ + * $Id: ContikiCFS.java,v 1.11 2010/02/05 09:01:06 fros4943 Exp $ */ package se.sics.cooja.contikimote.interfaces; @@ -70,35 +70,21 @@ import se.sics.cooja.interfaces.PolledAfterActiveTicks; public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, PolledAfterActiveTicks { private static Logger logger = Logger.getLogger(ContikiCFS.class); - public int FILESYSTEM_SIZE = 60*1024; /* Configure me */ - + public int FILESYSTEM_SIZE = 1000; /* Configure CFS size here and in cfs-cooja.c */ private Mote mote = null; private SectionMoteMemory moteMem = null; private int lastRead = 0; private int lastWritten = 0; - /** - * Approximate energy consumption of every character read from filesystem (mQ). - */ - public final double ENERGY_CONSUMPTION_PER_READ_CHAR_mQ; - public final double ENERGY_CONSUMPTION_PER_WRITTEN_CHAR_mQ; - /** * Creates an interface to the filesystem at mote. * - * @param mote - * Mote. + * @param mote Mote * @see Mote * @see se.sics.cooja.MoteInterfaceHandler */ public ContikiCFS(Mote mote) { - // Read class configurations of this mote type - ENERGY_CONSUMPTION_PER_READ_CHAR_mQ = mote.getType().getConfig() - .getDoubleValue(ContikiCFS.class, "CONSUMPTION_PER_READ_CHAR_mQ"); - ENERGY_CONSUMPTION_PER_WRITTEN_CHAR_mQ = mote.getType().getConfig() - .getDoubleValue(ContikiCFS.class, "CONSUMPTION_PER_WRITTEN_CHAR_mQ"); - this.mote = mote; this.moteMem = (SectionMoteMemory) mote.getMemory(); } @@ -179,8 +165,9 @@ public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, P // Write file data to CFS if (fileData != null) { - setFilesystemData(fileData); - logger.info("Done! (" + fileData.length + " bytes written to CFS)"); + if (setFilesystemData(fileData)) { + logger.info("Done! (" + fileData.length + " bytes written to CFS)"); + } } } }); @@ -214,10 +201,6 @@ public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, P this.deleteObserver(observer); } - public double energyConsumption() { - return 0.0; - } - public Collection getConfigXML() { return null; }