minor fix to allow adding mote interfaces from configuration

This commit is contained in:
fros4943 2010-07-05 16:48:55 +00:00
parent 11760059d3
commit 3fc00a8bed

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: AbstractApplicationMote.java,v 1.10 2010/03/05 14:59:43 fros4943 Exp $ * $Id: AbstractApplicationMote.java,v 1.11 2010/07/05 16:48:55 fros4943 Exp $
*/ */
package se.sics.cooja.motes; package se.sics.cooja.motes;
@ -86,6 +86,7 @@ public abstract class AbstractApplicationMote extends AbstractWakeupMote impleme
public abstract void sentPacket(RadioPacket p); public abstract void sentPacket(RadioPacket p);
public AbstractApplicationMote() { public AbstractApplicationMote() {
moteInterfaces = new MoteInterfaceHandler(this, moteType.getMoteInterfaceClasses());
} }
public AbstractApplicationMote(MoteType moteType, Simulation sim) { public AbstractApplicationMote(MoteType moteType, Simulation sim) {
@ -155,7 +156,6 @@ public abstract class AbstractApplicationMote extends AbstractWakeupMote impleme
Collection<Element> configXML, boolean visAvailable) { Collection<Element> configXML, boolean visAvailable) {
this.simulation = simulation; this.simulation = simulation;
this.memory = new SectionMoteMemory(new Properties()); this.memory = new SectionMoteMemory(new Properties());
moteInterfaces = new MoteInterfaceHandler(this, moteType.getMoteInterfaceClasses());
moteInterfaces.getRadio().addObserver(radioDataObserver); moteInterfaces.getRadio().addObserver(radioDataObserver);
for (Element element : configXML) { for (Element element : configXML) {