added getMote() method to all radios

This commit is contained in:
fros4943 2007-05-30 10:52:57 +00:00
parent c15c38bb1a
commit 209a35bf53
4 changed files with 23 additions and 4 deletions

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.contikimote.interfaces;
@ -452,4 +452,7 @@ public class ContikiRadio extends Radio implements ContikiMoteInterface,
public void setConfigXML(Collection<Element> configXML, boolean visAvailable) { public void setConfigXML(Collection<Element> configXML, boolean visAvailable) {
} }
public Mote getMote() {
return myMote;
}
} }

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.interfaces;
@ -313,4 +313,8 @@ public class ApplicationRadio extends Radio implements PacketRadio {
public void setConfigXML(Collection<Element> configXML, boolean visAvailable) { public void setConfigXML(Collection<Element> configXML, boolean visAvailable) {
} }
public Mote getMote() {
return myMote;
}
} }

View file

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 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; package se.sics.cooja.interfaces;
@ -148,5 +148,13 @@ public abstract class Radio extends MoteInterface {
* @return Radio position * @return Radio position
*/ */
public abstract Position getPosition(); 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();
} }

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.motes;
@ -256,4 +256,8 @@ public class DisturberRadio extends Radio implements PacketRadio {
logger.fatal("Read unknown configuration: " + name); logger.fatal("Read unknown configuration: " + name);
} }
} }
public Mote getMote() {
return myMote;
}
} }