mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-03-29 18:33:24 +00:00
implements mandatory getID() method
This commit is contained in:
parent
72105a161e
commit
62287dcb03
@ -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: ContikiMote.java,v 1.12 2009/05/26 14:21:20 fros4943 Exp $
|
* $Id: ContikiMote.java,v 1.13 2009/09/17 11:05:56 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.contikimote;
|
package se.sics.cooja.contikimote;
|
||||||
@ -49,7 +49,6 @@ import se.sics.cooja.*;
|
|||||||
* When ticked a Contiki mote polls all interfaces, copies the mote
|
* When ticked a Contiki mote polls all interfaces, copies the mote
|
||||||
* memory to the core, lets the Contiki system handle one event,
|
* memory to the core, lets the Contiki system handle one event,
|
||||||
* fetches the updated memory and finally polls all interfaces again.
|
* fetches the updated memory and finally polls all interfaces again.
|
||||||
* The mote state is also updated during a mote tick.
|
|
||||||
*
|
*
|
||||||
* @author Fredrik Osterlind
|
* @author Fredrik Osterlind
|
||||||
*/
|
*/
|
||||||
@ -87,20 +86,10 @@ public class ContikiMote implements Mote {
|
|||||||
scheduleNextWakeup(mySim.getSimulationTime());
|
scheduleNextWakeup(mySim.getSimulationTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setState(State newState) {
|
public int getID() {
|
||||||
logger.warn("setState() not implemented");
|
return myInterfaceHandler.getMoteID().getMoteID();
|
||||||
}
|
|
||||||
|
|
||||||
public State getState() {
|
|
||||||
return State.ACTIVE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addStateObserver(Observer newObserver) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteStateObserver(Observer newObserver) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public MoteInterfaceHandler getInterfaces() {
|
public MoteInterfaceHandler getInterfaces() {
|
||||||
return myInterfaceHandler;
|
return myInterfaceHandler;
|
||||||
}
|
}
|
||||||
@ -236,13 +225,7 @@ public class ContikiMote implements Mote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
if (getInterfaces() == null) {
|
return "Contiki Mote ID=" + getID();
|
||||||
return "Contiki Mote";
|
|
||||||
}
|
|
||||||
if (getInterfaces().getMoteID() == null) {
|
|
||||||
return "Contiki Mote, ID=null";
|
|
||||||
}
|
|
||||||
return "Contiki Mote, ID=" + getInterfaces().getMoteID().getMoteID();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TimeEvent tickMoteEvent = new MoteTimeEvent(this, 0) {
|
private TimeEvent tickMoteEvent = new MoteTimeEvent(this, 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user