Changeset 231
- Timestamp:
- 10/20/09 16:57:43 (4 years ago)
- Location:
- apps/TSCH
- Files:
-
- 7 edited
-
TODO.txt (modified) (1 diff)
-
TSCH.h (modified) (1 diff)
-
TSCHP.nc (modified) (3 diffs)
-
advertise/AdvertiseP.nc (modified) (2 diffs)
-
deploy.sh (modified) (1 diff)
-
neighbors/NeighborsP.nc (modified) (2 diffs)
-
reservation/ReservationP.nc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/TSCH/TODO.txt
r225 r231 1 - slots get crazy2 1 - when a node reboots, it forgets all its RES slots. So should its neighbors. 3 2 - when a node gets out of sync, it keeps its tables. If it stays out of sync for over delays, it should erase its tables. -
apps/TSCH/TSCH.h
r228 r231 11 11 RESRETRIES = 5, 12 12 DELAY_REMOVE_FROZEN_RESERVATIONS =10000, //in ms 13 DELAY_REMOVE_DEAD_NEIGHBOR = 320000, //32000=1s13 DELAY_REMOVE_DEAD_NEIGHBOR =960000, //32000=1s 14 14 //state 15 15 QUEUELENGTH = 5, -
apps/TSCH/TSCHP.nc
r226 r231 47 47 48 48 task void taskAddReservation() { 49 call ReservationUpdate.addSlot(1); 49 if ((call IDManager.getMyID())==1) { 50 call ReservationUpdate.addSlot(3); 51 } else { 52 call ReservationUpdate.addSlot(1); 53 } 54 50 55 } 51 56 … … 57 62 if (queuedPktUsed[i]==FALSE) { 58 63 queuedPktUsed[i]=TRUE; 59 ((cc2420_header_t*)queuedPkt[i].header)->dest=1; 64 if ((call IDManager.getMyID())==1) { 65 ((cc2420_header_t*)queuedPkt[i].header)->dest=3; 66 } else { 67 ((cc2420_header_t*)queuedPkt[i].header)->dest=1; 68 } 60 69 ((data_format_t*)queuedPkt[i].data)->payload[0]=datavaluecounter; 61 70 sendError = call Send.send(&queuedPkt[i],sizeof(data_format_t)); … … 139 148 case 4: call PrintSerialIO.print(); break; 140 149 case 5: call PrintTSCHQueue.print(); break; 141 //case ?: call PrintGlobalTime.print(); break;142 //case ?: call PrintForwarding.print(); break;143 //case ?: call PrintSlotEngine.print(); break;150 //case ?: call PrintGlobalTime.print(); break; 151 //case ?: call PrintForwarding.print(); break; 152 //case ?: call PrintSlotEngine.print(); break; 144 153 default: debugPrintCounter=0; 145 154 } -
apps/TSCH/advertise/AdvertiseP.nc
r230 r231 38 38 //fill data slotOffset and channelOffset 39 39 slotChannelRES = (call CellUsageGet.getCell(CELLTYPE_RES,(call IDManager.getMyID()))); 40 if (slotChannelRES.exists==TRUE){40 if (slotChannelRES.exists==TRUE) { 41 41 ((adv_format_t*)pkt.data)->channelOffset=slotChannelRES.channelOffset; 42 42 } else { … … 62 62 ((cc2420_header_t*)pkt.header)->type=AM_TSCH_ADV; 63 63 //send 64 if ((call SimpleSend.send(&pkt))==FAIL) {//if radio has problems sending64 if ((call SimpleSend.send(&pkt))==FAIL) {//if radio has problems sending 65 65 atomic busy=FALSE; 66 66 } 67 67 //set a new random advPeriod 68 68 if (call NeighborGet.getNumNeighbors()>1) { 69 //advPeriod = SLOT_TIME*LENGTHCELLFRAME*(call NeighborGet.getNumNeighbors());//poipoi69 advPeriod = (SLOT_TIME/32)*LENGTHCELLFRAME*(call NeighborGet.getNumNeighbors()); 70 70 } 71 71 call Timer.stop(); -
apps/TSCH/deploy.sh
r230 r231 1 1 #!/bin/bash 2 2 make telosb install.1 bsl,20 3 #make telosb install.2 bsl,213 make telosb install.2 bsl,21 4 4 make telosb install.3 bsl,22 5 5 -
apps/TSCH/neighbors/NeighborsP.nc
r230 r231 51 51 uint8_t i; 52 52 for (i=0;i<MAXNUMNEIGHBORS;i++){ 53 if (neighbors[i].used==TRUE) {54 actualTimeSinceLastHeard = (call GlobalTime.getLocalTime())-neighbors[i].lastHeardTimestamp;55 if (actualTimeSinceLastHeard>allowedTimeSinceLastHeard) {56 deadNeighbor = neighbors[i].id;57 removeNeighbor(deadNeighbor);58 call CellUsageSet.removeAllCellsToNeighbor(deadNeighbor);59 call DeQueue.removeAllPacketsToNeighbor(deadNeighbor);60 call ReservationUpdate.removeAllOngoingResToNeighbor(deadNeighbor);61 call SerialIO.printError(COMPONENT_NEIGHBORS,ERR_REMOVE_NEIGHBOR,(uint16_t)deadNeighbor,0);62 }53 if (neighbors[i].used==TRUE) { 54 actualTimeSinceLastHeard = (call GlobalTime.getLocalTime())-neighbors[i].lastHeardTimestamp; 55 if (actualTimeSinceLastHeard>allowedTimeSinceLastHeard) { 56 deadNeighbor = neighbors[i].id; 57 removeNeighbor(deadNeighbor); 58 call CellUsageSet.removeAllCellsToNeighbor(deadNeighbor); 59 call DeQueue.removeAllPacketsToNeighbor(deadNeighbor); 60 call ReservationUpdate.removeAllOngoingResToNeighbor(deadNeighbor); 61 call SerialIO.printError(COMPONENT_NEIGHBORS,ERR_REMOVE_NEIGHBOR,(uint16_t)deadNeighbor,0); 62 } 63 63 } 64 64 } … … 242 242 } 243 243 } else { //neighbor known 244 //check that there is at least one TXDATA to that neighbor (for KA and connectivity) poipoi245 /*if ((call CellUsageGet.getCell(CELLTYPE_TXDATA,((cc2420_header_t*)msg->header)->src)).exists==FALSE) {246 if ((call ReservationUpdate.addSlot(((cc2420_header_t*)msg->header)->src))==FAIL) {247 call SerialIO.printError(COMPONENT_NEIGHBORS,ERR_TXDATA_RESERVATION_TO_NEIGHBOR_FAILED,(uint16_t)((cc2420_header_t*)msg->header)->src,0);248 }249 }*/244 //check that there is at least one TXDATA to that neighbor (for KA and connectivity) 245 if ((call CellUsageGet.getCell(CELLTYPE_TXDATA,((cc2420_header_t*)msg->header)->src)).exists==FALSE) { 246 if ((call ReservationUpdate.addSlot(((cc2420_header_t*)msg->header)->src))==FAIL) { 247 call SerialIO.printError(COMPONENT_NEIGHBORS,ERR_TXDATA_RESERVATION_TO_NEIGHBOR_FAILED,(uint16_t)((cc2420_header_t*)msg->header)->src,0); 248 } 249 } 250 250 } 251 251 i=0; //update DAGrank -
apps/TSCH/reservation/ReservationP.nc
r226 r231 165 165 } 166 166 ongoingRes[i].todo = INFORM_REQUESTER; 167 }*/ 167 }*///poipoi 168 168 break; 169 169 default: … … 172 172 } 173 173 //any other ongoingRes I need to serve? 174 i=0; 174 175 while(i<NUMONGOINGRES) { 175 176 if(ongoingRes[i].todo!=UNUSED && ongoingRes[i].todo!=WAIT_FOR_SENT && ongoingRes[i].todo!=WAIT_FOR_RESPONSE) { … … 330 331 event void SimpleSend.sendDone(message_t *msg, error_t error) { 331 332 uint8_t i=0; 332 call SerialIO.printError(COMPONENT_RESERVATION,ERR_RES_SENT,(uint16_t)ongoingRes[i].slotOffset,(uint16_t)((cc2420_metadata_t*)msg->metadata)->ack);333 333 //which ongoing reservation is this for? 334 334 while(i<NUMONGOINGRES) { … … 346 346 return; 347 347 } 348 call SerialIO.printError(COMPONENT_RESERVATION,ERR_RES_SENT,(uint16_t)ongoingRes[i].slotOffset,(uint16_t)((cc2420_metadata_t*)msg->metadata)->ack); 348 349 if (ongoingRes[i].localRequester==LOCAL) {//I sent a request 349 350 ongoingRes[i].retries++;
Note: See TracChangeset
for help on using the changeset viewer.
