X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FDeluge%2Fextra%2FNetProgM.nc;h=ab122f4d1ccf3bf88e70db5b77ec82b26eb3aed0;hb=a246434cd8090fc8571e59adf8125961ccd20a90;hp=93bed42cc8ec49aa145b1717e863e78e9d5cd87b;hpb=50db1521a72ec58a83f81949c832f285a4e6daf2;p=tinyos-2.x.git diff --git a/tos/lib/net/Deluge/extra/NetProgM.nc b/tos/lib/net/Deluge/extra/NetProgM.nc index 93bed42c..ab122f4d 100644 --- a/tos/lib/net/Deluge/extra/NetProgM.nc +++ b/tos/lib/net/Deluge/extra/NetProgM.nc @@ -42,6 +42,8 @@ module NetProgM { interface Crc; interface DelugeMetadata; interface Leds; + interface CC2420Config; + async command void setAmAddress(am_addr_t a); } } @@ -76,13 +78,20 @@ implementation { if (tosInfo.crc == computeTosInfoCrc(&tosInfo)) { // TOS_AM_GROUP is not a variable in T2 - // TOS_AM_GROUP = tosInfo.groupId; - atomic TOS_NODE_ID = tosInfo.addr; + // TOS_AM_GROUP = tosInfo.groupId; + + // Updates local node ID + atomic { + TOS_NODE_ID = tosInfo.addr; + call setAmAddress(tosInfo.addr); + } + call CC2420Config.setShortAddr(tosInfo.addr); + call CC2420Config.sync(); } else { writeTOSinfo(); } - + return SUCCESS; } @@ -123,6 +132,8 @@ implementation { return FAIL; } + event void CC2420Config.syncDone(error_t error) {} + default command storage_addr_t DelugeStorage.getPhysicalAddress[uint8_t img_num](storage_addr_t addr) { return 0xFFFFFFFF; } }