From f45e5fbd6b9b92555fb5125fd35b6b36017ba1b9 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Fri, 13 Aug 2010 10:20:07 +0000 Subject: [PATCH] notify observers when radio channel changes --- .../sics/cooja/mspmote/interfaces/SkyByteRadio.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 338c2db89..7b7c16069 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.25 2010/03/15 19:22:03 fros4943 Exp $ + * $Id: SkyByteRadio.java,v 1.26 2010/08/13 10:20:07 fros4943 Exp $ */ package se.sics.cooja.mspmote.interfaces; @@ -177,6 +177,16 @@ public class SkyByteRadio extends Radio implements CustomDataRadio { notifyObservers(); } }); + + cc2420.setChannelListener(new CC2420.ChannelListener() { + public void changedChannel(int channel) { + /* XXX Currently assumes zero channel switch time */ + lastEvent = RadioEvent.UNKNOWN; + lastEventTime = SkyByteRadio.this.mote.getSimulation().getSimulationTime(); + setChanged(); + notifyObservers(); + } + }); } /* Packet radio support */