From f0fbbaa3797994e8ac1879c53ef275ee8540fbe5 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 18 Mar 2008 16:37:35 +0000 Subject: [PATCH] negative channels can talk to any other channel (both rx and tx) --- tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java | 6 ++++-- tools/cooja/java/se/sics/cooja/radiomediums/UDGM.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java b/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java index 32c27ba1f..622e4cac7 100644 --- a/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java +++ b/tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: MRM.java,v 1.6 2008/02/18 08:21:59 fros4943 Exp $ + * $Id: MRM.java,v 1.7 2008/03/18 16:37:35 fros4943 Exp $ */ package se.sics.mrm; @@ -94,7 +94,9 @@ public class MRM extends AbstractRadioMedium { if (sendingRadio == listeningRadio) { continue; } - if (sendingRadio.getChannel() != listeningRadio.getChannel()) { + if (sendingRadio.getChannel() >= 0 && + listeningRadio.getChannel() >= 0 && + sendingRadio.getChannel() != listeningRadio.getChannel()) { continue; } diff --git a/tools/cooja/java/se/sics/cooja/radiomediums/UDGM.java b/tools/cooja/java/se/sics/cooja/radiomediums/UDGM.java index 85251667c..636c329de 100644 --- a/tools/cooja/java/se/sics/cooja/radiomediums/UDGM.java +++ b/tools/cooja/java/se/sics/cooja/radiomediums/UDGM.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: UDGM.java,v 1.17 2008/03/17 10:18:37 fros4943 Exp $ + * $Id: UDGM.java,v 1.18 2008/03/18 16:37:35 fros4943 Exp $ */ package se.sics.cooja.radiomediums; @@ -457,7 +457,9 @@ public class UDGM extends AbstractRadioMedium { if (sendingRadio == listeningRadio) { continue; } - if (sendingRadio.getChannel() != listeningRadio.getChannel()) { + if (sendingRadio.getChannel() >= 0 && + listeningRadio.getChannel() >= 0 && + sendingRadio.getChannel() != listeningRadio.getChannel()) { continue; }