From 88eafcf479b90c17f282821ef9c43bd11b4ee247 Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Tue, 10 Apr 2012 13:52:12 +0200 Subject: [PATCH] example script demonstrating how to interface powertracker plugin --- tools/cooja/config/scripts/plugins.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/cooja/config/scripts/plugins.js b/tools/cooja/config/scripts/plugins.js index 9e9881dd3..16963fabd 100644 --- a/tools/cooja/config/scripts/plugins.js +++ b/tools/cooja/config/scripts/plugins.js @@ -38,16 +38,18 @@ while (counter<10) { GENERATE_MSG(1000, "wait"); YIELD_THEN_WAIT_UNTIL(msg.equals("wait")); - /* Extract Timeline statistics */ - plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.TimeLine"); + /* Extract PowerTracker statistics */ + plugin = mote.getSimulation().getGUI().getStartedPlugin("PowerTracker"); if (plugin != null) { plugins++; - stats = plugin.extractStatistics(); + stats = plugin.radioStatistics(); if (stats.length() > 40) { /* Stripping */ stats = stats.substring(0, 40) + "..."; } - log.log("Timeline: Extracted statistics:\n" + stats + "\n"); + log.log("PowerTracker: Extracted statistics:\n" + stats + "\n"); + } else { + log.log("No PowerTracker plugin\n"); } GENERATE_MSG(1000, "wait");