From 209a35bf53bc3c83eac99b6b631a4be0470e0b2c Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 30 May 2007 10:52:57 +0000 Subject: [PATCH] added getMote() method to all radios --- .../cooja/contikimote/interfaces/ContikiRadio.java | 5 ++++- .../se/sics/cooja/interfaces/ApplicationRadio.java | 6 +++++- tools/cooja/java/se/sics/cooja/interfaces/Radio.java | 10 +++++++++- .../cooja/java/se/sics/cooja/motes/DisturberRadio.java | 6 +++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiRadio.java b/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiRadio.java index 184166526..95c4276c6 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiRadio.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/interfaces/ContikiRadio.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ContikiRadio.java,v 1.14 2007/05/29 12:53:49 fros4943 Exp $ + * $Id: ContikiRadio.java,v 1.15 2007/05/30 10:52:57 fros4943 Exp $ */ package se.sics.cooja.contikimote.interfaces; @@ -452,4 +452,7 @@ public class ContikiRadio extends Radio implements ContikiMoteInterface, public void setConfigXML(Collection configXML, boolean visAvailable) { } + public Mote getMote() { + return myMote; + } } diff --git a/tools/cooja/java/se/sics/cooja/interfaces/ApplicationRadio.java b/tools/cooja/java/se/sics/cooja/interfaces/ApplicationRadio.java index deaa77eca..2bf96a51c 100644 --- a/tools/cooja/java/se/sics/cooja/interfaces/ApplicationRadio.java +++ b/tools/cooja/java/se/sics/cooja/interfaces/ApplicationRadio.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ApplicationRadio.java,v 1.1 2007/05/19 17:17:34 fros4943 Exp $ + * $Id: ApplicationRadio.java,v 1.2 2007/05/30 10:52:57 fros4943 Exp $ */ package se.sics.cooja.interfaces; @@ -313,4 +313,8 @@ public class ApplicationRadio extends Radio implements PacketRadio { public void setConfigXML(Collection configXML, boolean visAvailable) { } + + public Mote getMote() { + return myMote; + } } diff --git a/tools/cooja/java/se/sics/cooja/interfaces/Radio.java b/tools/cooja/java/se/sics/cooja/interfaces/Radio.java index 80aae6974..03616161b 100644 --- a/tools/cooja/java/se/sics/cooja/interfaces/Radio.java +++ b/tools/cooja/java/se/sics/cooja/interfaces/Radio.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: Radio.java,v 1.6 2007/02/28 09:49:20 fros4943 Exp $ + * $Id: Radio.java,v 1.7 2007/05/30 10:52:57 fros4943 Exp $ */ package se.sics.cooja.interfaces; @@ -148,5 +148,13 @@ public abstract class Radio extends MoteInterface { * @return Radio position */ public abstract Position getPosition(); + + /** + * This is a convenience function. + * It returns the mote, if any, that holds this radio. + * + * @return Mote + */ + public abstract Mote getMote(); } diff --git a/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java b/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java index 3eed1cc44..59fb173cb 100644 --- a/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java +++ b/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: DisturberRadio.java,v 1.3 2007/02/28 09:49:48 fros4943 Exp $ + * $Id: DisturberRadio.java,v 1.4 2007/05/30 10:53:18 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -256,4 +256,8 @@ public class DisturberRadio extends Radio implements PacketRadio { logger.fatal("Read unknown configuration: " + name); } } + + public Mote getMote() { + return myMote; + } }