Changeset 231


Ignore:
Timestamp:
10/20/09 16:57:43 (4 years ago)
Author:
thomas
Message:

temp

Location:
apps/TSCH
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • apps/TSCH/TODO.txt

    r225 r231  
    1 - slots get crazy 
    21- when a node reboots, it forgets all its RES slots. So should its neighbors. 
    32- 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  
    1111   RESRETRIES = 5, 
    1212   DELAY_REMOVE_FROZEN_RESERVATIONS =10000,  //in ms 
    13    DELAY_REMOVE_DEAD_NEIGHBOR       =320000, //32000=1s 
     13   DELAY_REMOVE_DEAD_NEIGHBOR       =960000, //32000=1s 
    1414   //state 
    1515   QUEUELENGTH = 5, 
  • apps/TSCH/TSCHP.nc

    r226 r231  
    4747 
    4848   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 
    5055   } 
    5156 
     
    5762         if (queuedPktUsed[i]==FALSE) { 
    5863            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            } 
    6069            ((data_format_t*)queuedPkt[i].data)->payload[0]=datavaluecounter; 
    6170            sendError = call Send.send(&queuedPkt[i],sizeof(data_format_t)); 
     
    139148         case 4: call PrintSerialIO.print();    break; 
    140149         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; 
    144153         default: debugPrintCounter=0; 
    145154      } 
  • apps/TSCH/advertise/AdvertiseP.nc

    r230 r231  
    3838      //fill data slotOffset and channelOffset 
    3939      slotChannelRES = (call CellUsageGet.getCell(CELLTYPE_RES,(call IDManager.getMyID()))); 
    40       if(slotChannelRES.exists==TRUE){ 
     40      if (slotChannelRES.exists==TRUE) { 
    4141         ((adv_format_t*)pkt.data)->channelOffset=slotChannelRES.channelOffset; 
    4242      } else { 
     
    6262      ((cc2420_header_t*)pkt.header)->type=AM_TSCH_ADV; 
    6363      //send 
    64       if ((call SimpleSend.send(&pkt))==FAIL){//if radio has problems sending 
     64      if ((call SimpleSend.send(&pkt))==FAIL) {//if radio has problems sending 
    6565         atomic busy=FALSE; 
    6666      } 
    6767      //set a new random advPeriod 
    6868      if (call NeighborGet.getNumNeighbors()>1) { 
    69          //advPeriod = SLOT_TIME*LENGTHCELLFRAME*(call NeighborGet.getNumNeighbors());//poipoi 
     69         advPeriod = (SLOT_TIME/32)*LENGTHCELLFRAME*(call NeighborGet.getNumNeighbors()); 
    7070      } 
    7171      call Timer.stop(); 
  • apps/TSCH/deploy.sh

    r230 r231  
    11#!/bin/bash 
    22make telosb install.1  bsl,20 
    3 #make telosb install.2  bsl,21 
     3make telosb install.2  bsl,21 
    44make telosb install.3  bsl,22 
    55 
  • apps/TSCH/neighbors/NeighborsP.nc

    r230 r231  
    5151      uint8_t i; 
    5252      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            } 
    6363         } 
    6464      } 
     
    242242         } 
    243243      } else {                                                       //neighbor known 
    244          //check that there is at least one TXDATA to that neighbor (for KA and connectivity) poipoi 
    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            }*/ 
     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         } 
    250250      } 
    251251      i=0; //update DAGrank 
  • apps/TSCH/reservation/ReservationP.nc

    r226 r231  
    165165               } 
    166166               ongoingRes[i].todo = INFORM_REQUESTER; 
    167             }*/ 
     167            }*///poipoi 
    168168            break; 
    169169         default: 
     
    172172      } 
    173173      //any other ongoingRes I need to serve? 
     174      i=0; 
    174175      while(i<NUMONGOINGRES) { 
    175176         if(ongoingRes[i].todo!=UNUSED && ongoingRes[i].todo!=WAIT_FOR_SENT && ongoingRes[i].todo!=WAIT_FOR_RESPONSE) { 
     
    330331   event void SimpleSend.sendDone(message_t *msg, error_t error) { 
    331332      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); 
    333333      //which ongoing reservation is this for? 
    334334      while(i<NUMONGOINGRES) { 
     
    346346         return; 
    347347      } 
     348      call SerialIO.printError(COMPONENT_RESERVATION,ERR_RES_SENT,(uint16_t)ongoingRes[i].slotOffset,(uint16_t)((cc2420_metadata_t*)msg->metadata)->ack); 
    348349      if (ongoingRes[i].localRequester==LOCAL) {//I sent a request 
    349350         ongoingRes[i].retries++; 
Note: See TracChangeset for help on using the changeset viewer.