From: rincon Date: Fri, 6 Jul 2007 18:09:44 +0000 (+0000) Subject: Updated the HTML regression test report, named it something more date-neutral. Updat... X-Git-Tag: release_tools_1_2_4_1~73 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=b7b2538f1e896dbe3ccd629912c5ead5d399809b;p=tinyos-2.x.git Updated the HTML regression test report, named it something more date-neutral. Updated CC2420Config to provide async commands so CC2420Receive can use them to perform software address checking. --- diff --git a/tos/chips/cc2420/control/CC2420ControlP.nc b/tos/chips/cc2420/control/CC2420ControlP.nc index 582d8b0a..a3faa9a5 100644 --- a/tos/chips/cc2420/control/CC2420ControlP.nc +++ b/tos/chips/cc2420/control/CC2420ControlP.nc @@ -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 index 00000000..19c8971c 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 index 70a7aa02..00000000 Binary files a/tos/chips/cc2420/htmlreport_3-July-2007_05-05-PM.tar.gz and /dev/null differ diff --git a/tos/chips/cc2420/interfaces/CC2420Config.nc b/tos/chips/cc2420/interfaces/CC2420Config.nc index 8e11a095..972f37a0 100644 --- a/tos/chips/cc2420/interfaces/CC2420Config.nc +++ b/tos/chips/cc2420/interfaces/CC2420Config.nc @@ -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 diff --git a/tos/chips/cc2420/receive/CC2420ReceiveC.nc b/tos/chips/cc2420/receive/CC2420ReceiveC.nc index 1492f584..1c1bb728 100644 --- a/tos/chips/cc2420/receive/CC2420ReceiveC.nc +++ b/tos/chips/cc2420/receive/CC2420ReceiveC.nc @@ -49,7 +49,6 @@ implementation { components MainC; components CC2420ReceiveP; components CC2420PacketC; - components ActiveMessageAddressC; components new CC2420SpiC() as Spi; components CC2420ControlC; diff --git a/tos/chips/cc2420/receive/CC2420ReceiveP.nc b/tos/chips/cc2420/receive/CC2420ReceiveP.nc index b1dfb864..27eda279 100644 --- a/tos/chips/cc2420/receive/CC2420ReceiveP.nc +++ b/tos/chips/cc2420/receive/CC2420ReceiveP.nc @@ -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 ) { }