example code for manually configuring sky motes MAC addresses

This commit is contained in:
Fredrik Osterlind 2011-11-01 09:38:46 +01:00
parent 3154d73e24
commit 7c20758662

View file

@ -61,6 +61,7 @@ public class SkyMote extends MspMote {
skyNode = new SkyNode();
registry = skyNode.getRegistry();
skyNode.setFlash(new CoojaM25P80(skyNode.getCPU()));
prepareMote(fileELF, skyNode);
} catch (Exception e) {
logger.fatal("Error when creating Sky mote: ", e);
@ -69,8 +70,40 @@ public class SkyMote extends MspMote {
return true;
}
/*private void configureWithMacAddressesTxt(int id) {
String txt =
"18 MAC 00:12:74:00:11:2b:0a:e9\n" +
"16 MAC 00:12:74:00:11:2b:03:7f\n" +
"8 MAC 00:12:74:00:10:58:2c:fb\n" +
"7 MAC 00:12:74:00:10:58:4b:6c\n" +
"6 MAC 00:12:74:00:10:58:42:22\n" +
"5 MAC 00:12:74:00:10:58:5e:65\n" +
"19 MAC 00:12:74:00:10:57:23:25\n";
for (String l: txt.split("\n")) {
String[] arr = l.split(" ");
if (Integer.parseInt(arr[0]) != id) {
continue;
}
String mac = arr[2];
String[] arr2 = mac.split(":");
skyNode.ds2411.setMACID(
Integer.parseInt(arr2[7],16),
Integer.parseInt(arr2[6],16),
Integer.parseInt(arr2[5],16),
Integer.parseInt(arr2[4],16),
Integer.parseInt(arr2[3],16),
0
);
}
}*/
public void idUpdated(int newID) {
skyNode.setNodeID(newID);
/* Statically configured MAC addresses */
/*configureWithMacAddressesTxt(newID);*/
}
public SkyCoffeeFilesystem getFilesystem() {