Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txstatus.getDeliveryStatus delivers wrong value for certain payload length #13

Open
GoogleCodeExporter opened this issue Apr 6, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

Sending a payload of 9-11 bytes always produces strange return value from 
txresponse.getDeliverystatus() (should be SUCCESS), receiving node is online. 
Sending payload length 0 to 8 bytes is ok, more than 11 bytes is also ok.

Here my code:
==============

boolean XbeeSend(uint8_t* payload, int payloadlength)
{
  // **********************************
  // sending xbee packet to coordinator
  XBeeAddress64 addr64;
  ZBTxRequest zbTx;

  ZBRxResponse rx;
  ModemStatusResponse msr;
  ZBTxStatusResponse txStatus;

  // if message is 9 bytes, I get 0x6, 10 bytes=0x1 and 11 bytes no response at all! Should be 0x24.

  char message[] = "123456789";

  // creating address header
  addr64 = XBeeAddress64(config.networkid, config.coordinatorid);
  // creating transmit request
  zbTx = ZBTxRequest(addr64,(uint8_t*)message, strlen(message));

  // sending the xbee packet
  xbee.send(zbTx);

  // ******************************************************
  // awaiting packet recieved confirmation from coordinator

  if (xbee.readPacket(5000))
  {
    // checking for isError() shortened

    else if (xbee.getResponse().getApiId() == ZB_TX_STATUS_RESPONSE)
    { 
      // get xbee send status response
      xbee.getResponse().getZBTxStatusResponse(txStatus);

      if (txStatus.getDeliveryStatus() == SUCCESS)
      {            
        return true;
      } else {

        // an error occurred - reset our timeaccounting request waiting stuff
        awaitingTimeaccountingConfirmation = false;
        awaitingTimeaccountingExpire = 0;

        // DEBUG
        // see XBee.h for error codes
        sprintf(errormsg,"Errorcode: %02x",txStatus.getDeliveryStatus());
        lcdExpiringMessage(NONBLOCK,RED, "ERROR (Send)", errormsg,2000); 

        return false;
      }   
    }

    // checking for modem response shortened
  }
}

What is the expected output? What do you see instead?
Expected outbut is 0x24

What version of the product are you using? On what operating system?
recent version of xbee-arduino library

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 2 May 2011 at 3:48

@GoogleCodeExporter
Copy link
Author

Digi has added additional status response codes since I wrote the library. You 
can find them all in the manual:

x00 = Success
0x01 = MAC ACK Failure
0x02 = CCA Failure
0x15 = Invalid destination endpoint
0x21 = Network ACK Failure
0x22 = Not Joined to Network
0x23 = Self-addressed
0x24 = Address Not Found
0x25 = Route Not Found
0x26 = Broadcast source failed to hear a neighbor relay the message
0x2B = Invalid binding table index
0x2C = Resource error lack of free buffers, timers, etc. 0x2D = Attempted 
broadcast with APS transmission 0x2E = Attempted unicast with APS transmission, 
but EE=0
0x32 = Resource error lack of free buffers, timers, etc. 0x74 = Data payload 
too large

These will need to be added to the library

Original comment by [email protected] on 2 Feb 2014 at 6:38

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant