andrewrapp / xbee-arduino

Arduino library for communicating with XBee radios in API mode
GNU General Public License v2.0
334 stars 162 forks source link

Failed to modify AT command. #77

Open sdiaz-qkt opened 5 years ago

sdiaz-qkt commented 5 years ago

Hello,

I'm trying to modify the destination address (DL) and destination port (DE) programmatically. I'm using the following code, which is basically a copy-paste from one of the examples:

 xbeeCallbacks.setSerial(monitorSerial);
 uint8_t value =  1;
 AtCommandRequest req((uint8_t*)"DE", &value, sizeof(value));
 req.setFrameId(xbeeCallbacks.getNextFrameId());
 uint8_t status = xbeeCallbacks.sendAndWait(req, 150);
 if (status == 0)
   Serial.println(F("Set DE successfully"));
 else
   Serial.println(F("Failed to set DE, expect problems"));

Just for testing purposes I'm writing the value of 1 into my destination port. This code prints a "Failed to set DE, expect problems".

Why is that ? Am I forgetting something? I'm using an Xbee Cellular 3G by the way.

Thank you.