From 74c003b7d4cf8c4e859db19a64f93a0de0921a2d Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 3 Feb 2010 19:15:56 +0000 Subject: [PATCH] wrapping tr1001 byte delivery in MspMoteTimeEvent:s, to avoid scheduling problems when emulated mote is in lpm --- .../src/se/sics/cooja/mspmote/interfaces/TR1001Radio.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/TR1001Radio.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/TR1001Radio.java index 87f25dbce..78c2d7bfa 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/TR1001Radio.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/TR1001Radio.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: TR1001Radio.java,v 1.17 2010/02/03 13:47:33 nifi Exp $ + * $Id: TR1001Radio.java,v 1.18 2010/02/03 19:15:56 fros4943 Exp $ */ package se.sics.cooja.mspmote.interfaces; @@ -58,6 +58,7 @@ import se.sics.cooja.interfaces.CustomDataRadio; import se.sics.cooja.interfaces.Position; import se.sics.cooja.interfaces.Radio; import se.sics.cooja.mspmote.MspMote; +import se.sics.cooja.mspmote.MspMoteTimeEvent; import se.sics.mspsim.core.IOUnit; import se.sics.mspsim.core.USART; import se.sics.mspsim.core.USARTListener; @@ -142,8 +143,10 @@ public class TR1001Radio extends Radio implements USARTListener, CustomDataRadio } /* Feed incoming bytes to radio "slowly" via time events */ - TimeEvent receiveCrosslevelDataEvent = new MoteTimeEvent(mote, 0) { + TimeEvent receiveCrosslevelDataEvent = new MspMoteTimeEvent(mote, 0) { public void execute(long t) { + super.execute(t); + /* Stop receiving data when buffer is empty */ if (data.isEmpty()) { return;