Monday, March 4, 2013

Enforce software ACK on CC2420 tinyos

cc2420/receive/CC2420ReceiveP.nc:


      /*
       * 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( !call CC2420Config.isHwAutoAckDefault()) {
      //--if (1) {
        //--if (((( header->fcf >> IEEE154_FCF_ACK_REQ ) & 0x01) == 1)
        if ( 1
            && ((header->dest == call CC2420Config.getShortAddr())
                || (header->dest == AM_BROADCAST_ADDR))
            && ((( header->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7) == IEEE154_TYPE_DATA)) {
          // CSn flippage cuts off our FIFO; SACK and begin reading again







      // We may have received an ack that should be processed by Transmit
      // buf[rxFrameLength] >> 7 checks the CRC
      //--if ( ( buf[ rxFrameLength ] >> 7 ) && rx_buf ) {
      if ( rx_buf ) {



cc2420/transmit/CC2420TransmitP.nc:


      case S_EFD:
        sfdHigh = FALSE;
        call CaptureSFD.captureRisingEdge();
       
        //--if ( (call CC2420PacketBody.getHeader( m_msg ))->fcf & ( 1 << IEEE154_FCF_ACK_REQ ) ) {
        if ( 1 ) {


No comments: