decreased default cooja CFS size

This commit is contained in:
fros4943 2010-02-05 08:59:51 +00:00
parent a32035dc14
commit b9bf06c2a7
2 changed files with 8 additions and 25 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * 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 <string.h> #include <string.h>
#include "lib/simEnvChange.h" #include "lib/simEnvChange.h"
@ -49,7 +49,7 @@ static struct filestate file;
const struct simInterface cfs_interface; const struct simInterface cfs_interface;
// COOJA variables // 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 simCFSData[CFS_BUF_SIZE] = { 0 };
char simCFSChanged = 0; char simCFSChanged = 0;
int simCFSRead = 0; int simCFSRead = 0;

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.contikimote.interfaces;
@ -70,35 +70,21 @@ import se.sics.cooja.interfaces.PolledAfterActiveTicks;
public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, PolledAfterActiveTicks { public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, PolledAfterActiveTicks {
private static Logger logger = Logger.getLogger(ContikiCFS.class); 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 Mote mote = null;
private SectionMoteMemory moteMem = null; private SectionMoteMemory moteMem = null;
private int lastRead = 0; private int lastRead = 0;
private int lastWritten = 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. * Creates an interface to the filesystem at mote.
* *
* @param mote * @param mote Mote
* Mote.
* @see Mote * @see Mote
* @see se.sics.cooja.MoteInterfaceHandler * @see se.sics.cooja.MoteInterfaceHandler
*/ */
public ContikiCFS(Mote mote) { 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.mote = mote;
this.moteMem = (SectionMoteMemory) mote.getMemory(); this.moteMem = (SectionMoteMemory) mote.getMemory();
} }
@ -179,8 +165,9 @@ public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, P
// Write file data to CFS // Write file data to CFS
if (fileData != null) { if (fileData != null) {
setFilesystemData(fileData); if (setFilesystemData(fileData)) {
logger.info("Done! (" + fileData.length + " bytes written to CFS)"); logger.info("Done! (" + fileData.length + " bytes written to CFS)");
}
} }
} }
}); });
@ -214,10 +201,6 @@ public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, P
this.deleteObserver(observer); this.deleteObserver(observer);
} }
public double energyConsumption() {
return 0.0;
}
public Collection<Element> getConfigXML() { public Collection<Element> getConfigXML() {
return null; return null;
} }