added MAC address setting - setNodeID in SkyNode
This commit is contained in:
parent
29ec3b02f5
commit
4b78e80bda
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: MspMote.java,v 1.19 2009/01/23 15:32:24 fros4943 Exp $
|
||||
* $Id: MspMote.java,v 1.20 2009/02/07 16:38:51 joxe Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja.mspmote;
|
||||
|
@ -257,6 +257,10 @@ public abstract class MspMote implements Mote {
|
|||
return Mote.State.ACTIVE;
|
||||
}
|
||||
|
||||
/* called when moteID is updated */
|
||||
public void idUpdated(int newID) {
|
||||
}
|
||||
|
||||
public MoteType getType() {
|
||||
return myMoteType;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: SkyMote.java,v 1.9 2008/12/03 13:11:20 fros4943 Exp $
|
||||
* $Id: SkyMote.java,v 1.10 2009/02/07 16:38:51 joxe Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja.mspmote;
|
||||
|
@ -120,6 +120,10 @@ public class SkyMote extends MspMote {
|
|||
return moteInterfaceHandler;
|
||||
}
|
||||
|
||||
public void idUpdated(int newID) {
|
||||
skyNode.setNodeID(newID);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
MoteID moteID = getInterfaces() != null ? getInterfaces().getMoteID() : null;
|
||||
if (moteID != null) {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: MspMoteID.java,v 1.9 2008/12/04 14:03:41 joxe Exp $
|
||||
* $Id: MspMoteID.java,v 1.10 2009/02/07 16:38:51 joxe Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja.mspmote.interfaces;
|
||||
|
@ -161,6 +161,10 @@ public class MspMoteID extends MoteID {
|
|||
}
|
||||
|
||||
public void setMoteID(int newID) {
|
||||
/* tell mote instance */
|
||||
if (moteID != newID) {
|
||||
mote.idUpdated(newID);
|
||||
}
|
||||
moteID = newID;
|
||||
|
||||
if (location == ID_LOCATION.VARIABLE_NODE_ID) {
|
||||
|
|
Loading…
Reference in a new issue