]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Updated the HTML regression test report, named it something more date-neutral. Updat...
authorrincon <rincon>
Fri, 6 Jul 2007 18:09:44 +0000 (18:09 +0000)
committerrincon <rincon>
Fri, 6 Jul 2007 18:09:44 +0000 (18:09 +0000)
tos/chips/cc2420/control/CC2420ControlP.nc
tos/chips/cc2420/htmlreport.tar.gz [new file with mode: 0644]
tos/chips/cc2420/htmlreport_3-July-2007_05-05-PM.tar.gz [deleted file]
tos/chips/cc2420/interfaces/CC2420Config.nc
tos/chips/cc2420/receive/CC2420ReceiveC.nc
tos/chips/cc2420/receive/CC2420ReceiveP.nc

index 582d8b0afafcca15ad3e36839311b9596a711797..a3faa9a5a808ea40fc02988d9ce261f30b025aea 100644 (file)
@@ -99,6 +99,8 @@ implementation {
   
   bool hwAutoAckDefault;
   
+  bool addressRecognition;
+  
   norace cc2420_control_state_t m_state = S_VREG_STOPPED;
   
   /***************** Prototypes ****************/
@@ -133,6 +135,12 @@ implementation {
     hwAutoAckDefault = FALSE;
 #endif
 
+#if defined(CC2420_NO_ADDRESS_RECOGNITION)
+    addressRecognition = FALSE;
+#else
+    addressRecognition = TRUE;
+#endif
+
     return SUCCESS;
   }
 
@@ -253,7 +261,7 @@ implementation {
     atomic m_channel = channel;
   }
 
-  command uint16_t CC2420Config.getShortAddr() {
+  async command uint16_t CC2420Config.getShortAddr() {
     atomic return m_short_addr;
   }
 
@@ -261,8 +269,8 @@ implementation {
     atomic m_short_addr = addr;
   }
 
-  command uint16_t CC2420Config.getPanAddr() {
-    return m_pan;
+  async command uint16_t CC2420Config.getPanAddr() {
+    atomic return m_pan;
   }
 
   command void CC2420Config.setPanAddr( uint16_t pan ) {
@@ -290,6 +298,21 @@ implementation {
     return SUCCESS;
   }
 
+  /**
+   * @param on TRUE to turn address recognition on, FALSE to turn it off
+   */
+  command void CC2420Config.setAddressRecognition(bool on) {
+    atomic addressRecognition = on;
+  }
+  
+  /**
+   * @return TRUE if address recognition is enabled
+   */
+  async command bool CC2420Config.isAddressRecognitionEnabled() {
+    atomic return addressRecognition;
+  }
+  
+  
   /**
    * Sync must be called for acknowledgement changes to take effect
    * @param enableAutoAck TRUE to enable auto acknowledgements
@@ -306,22 +329,14 @@ implementation {
    *     acks are the default
    */
   async command bool CC2420Config.isHwAutoAckDefault() {
-    bool isHwAck;
-    atomic {
-      isHwAck = hwAutoAckDefault;
-    }
-    return isHwAck;    
+    atomic return hwAutoAckDefault;    
   }
   
   /**
    * @return TRUE if auto acks are enabled
    */
   async command bool CC2420Config.isAutoAckEnabled() {
-    bool isAckEnabled;
-    atomic {
-      isAckEnabled = autoAckEnabled;
-    }
-    return isAckEnabled;
+    atomic return autoAckEnabled;
   }
   
   /***************** ReadRssi Commands ****************/
@@ -427,7 +442,7 @@ implementation {
   void writeMdmctrl0() {
     atomic {
       call MDMCTRL0.write( ( 1 << CC2420_MDMCTRL0_RESERVED_FRAME_MODE ) |
-          ( 1 << CC2420_MDMCTRL0_ADR_DECODE ) |
+          ( addressRecognition << CC2420_MDMCTRL0_ADR_DECODE ) |
           ( 2 << CC2420_MDMCTRL0_CCA_HYST ) |
           ( 3 << CC2420_MDMCTRL0_CCA_MOD ) |
           ( 1 << CC2420_MDMCTRL0_AUTOCRC ) |
diff --git a/tos/chips/cc2420/htmlreport.tar.gz b/tos/chips/cc2420/htmlreport.tar.gz
new file mode 100644 (file)
index 0000000..19c8971
Binary files /dev/null and b/tos/chips/cc2420/htmlreport.tar.gz differ
diff --git a/tos/chips/cc2420/htmlreport_3-July-2007_05-05-PM.tar.gz b/tos/chips/cc2420/htmlreport_3-July-2007_05-05-PM.tar.gz
deleted file mode 100644 (file)
index 70a7aa0..0000000
Binary files a/tos/chips/cc2420/htmlreport_3-July-2007_05-05-PM.tar.gz and /dev/null differ
index 8e11a095612e3603cfdf4c2b214f726473c77f07..972f37a09fc55243e7af285295ea04720e1dd549 100644 (file)
@@ -61,16 +61,26 @@ interface CC2420Config {
   /**
    * Change the short address of the radio.
    */
-  command uint16_t getShortAddr();
+  async command uint16_t getShortAddr();
   command void setShortAddr( uint16_t address );
 
   /**
    * Change the PAN address of the radio.
    */
-  command uint16_t getPanAddr();
+  async command uint16_t getPanAddr();
   command void setPanAddr( uint16_t address );
 
   
+  /**
+   * @param on TRUE to turn address recognition on, FALSE to turn it off
+   */
+  command void setAddressRecognition(bool on);
+  
+  /**
+   * @return TRUE if address recognition is enabled
+   */
+  async command bool isAddressRecognitionEnabled();
+  
   /**
    * Sync must be called for acknowledgement changes to take effect
    * @param enableAutoAck TRUE to enable auto acknowledgements
index 1492f584b41b8423a07a7d32c07b7a560147d4a8..1c1bb728bba253aa7fedcd973d82944b044a472f 100644 (file)
@@ -49,7 +49,6 @@ implementation {
   components MainC;
   components CC2420ReceiveP;
   components CC2420PacketC;
-  components ActiveMessageAddressC;
   components new CC2420SpiC() as Spi;
   components CC2420ControlC;
   
index b1dfb86432f251444f3dc23acc70dec5271af41e..27eda27951e010b0ebc20390c247d84b070a222e 100644 (file)
@@ -73,7 +73,7 @@ implementation {
   enum {
     RXFIFO_SIZE = 128,
     TIMESTAMP_QUEUE_SIZE = 8,
-    FCF_LENGTH = 2,
+    SACK_HEADER_LENGTH = 7,
   };
 
   uint16_t m_timestamp_queue[ TIMESTAMP_QUEUE_SIZE ];
@@ -124,8 +124,6 @@ implementation {
     }
     return SUCCESS;
   }
-
-
   
   command error_t StdControl.stop() {
     atomic {
@@ -224,9 +222,9 @@ implementation {
         
         if(rxFrameLength <= MAC_PACKET_SIZE) {
           if(rxFrameLength > 0) {
-            if(rxFrameLength > FCF_LENGTH) {
+            if(rxFrameLength > SACK_HEADER_LENGTH) {
               // This packet has an FCF byte plus at least one more byte to read
-              call RXFIFO.continueRead(buf + 1, FCF_LENGTH);
+              call RXFIFO.continueRead(buf + 1, SACK_HEADER_LENGTH);
               
             } else {
               // This is really a bad packet, skip FCF and get it out of here.
@@ -251,8 +249,19 @@ implementation {
       
     case S_RX_FCF:
       m_state = S_RX_PAYLOAD;
+      
+      /*
+       * The destination address check here is not completely optimized. If you 
+       * are seeing issues with dropped acknowledgements, try removing
+       * the address check and decreasing SACK_HEADER_LENGTH to 2.
+       * The length byte and the FCF byte are the only two bytes required
+       * to know that the packet is valid and requested an ack.  The destination
+       * address is useful when we want to sniff packets from other transmitters
+       * while acknowledging packets that were destined for our local address.
+       */
       if(call CC2420Config.isAutoAckEnabled() && !call CC2420Config.isHwAutoAckDefault()) {
         if (((( header->fcf >> IEEE154_FCF_ACK_REQ ) & 0x01) == 1)
+            && (header->dest == call CC2420Config.getShortAddr())
             && ((( header->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7) == IEEE154_TYPE_DATA)) {
           // CSn flippage cuts off our FIFO; SACK and begin reading again
           call CSN.set();
@@ -260,15 +269,15 @@ implementation {
           call SACK.strobe();
           call CSN.set();
           call CSN.clr();
-          call RXFIFO.beginRead(buf + 1 + FCF_LENGTH, 
-              rxFrameLength - FCF_LENGTH);
+          call RXFIFO.beginRead(buf + 1 + SACK_HEADER_LENGTH, 
+              rxFrameLength - SACK_HEADER_LENGTH);
           return;
         }
       }
       
       // Didn't flip CSn, we're ok to continue reading.
-      call RXFIFO.continueRead(buf + 1 + FCF_LENGTH, 
-          rxFrameLength - FCF_LENGTH);
+      call RXFIFO.continueRead(buf + 1 + SACK_HEADER_LENGTH, 
+          rxFrameLength - SACK_HEADER_LENGTH);
       break;
     
     case S_RX_PAYLOAD:
@@ -334,7 +343,7 @@ implementation {
     atomic receivingPacket = FALSE;
     waitForNextPacket();
   }
-
+  
   /****************** CC2420Config Events ****************/
   event void CC2420Config.syncDone( error_t error ) {
   }