From 03605a568c869a7e6d3d0ae9d3cff7058ef8a647 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Mon, 8 Mar 2010 11:29:39 +0000 Subject: [PATCH] bugfix: wrapping signal strength updates in separate event, to be executed after the last byte received --- .../sics/cooja/mspmote/interfaces/SkyByteRadio.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/SkyByteRadio.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/SkyByteRadio.java index 607275fb5..8667bc717 100755 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/SkyByteRadio.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/SkyByteRadio.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: SkyByteRadio.java,v 1.22 2010/02/03 19:15:15 fros4943 Exp $ + * $Id: SkyByteRadio.java,v 1.23 2010/03/08 11:29:39 fros4943 Exp $ */ package se.sics.cooja.mspmote.interfaces; @@ -329,8 +329,13 @@ public class SkyByteRadio extends Radio implements CustomDataRadio { return cc2420.getRSSI(); } - public void setCurrentSignalStrength(double signalStrength) { - cc2420.setRSSI((int) signalStrength); + public void setCurrentSignalStrength(final double signalStrength) { + getMote().getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) { + public void execute(long t) { + super.execute(t); + cc2420.setRSSI((int) signalStrength); + } + }, mote.getSimulation().getSimulationTime()); } public JPanel getInterfaceVisualizer() {