Skip to content

Commit 9ff6a9b

Browse files
diescalohgonzaleDigi
authored andcommitted
thread: add default value to apply AT command changes when sending CoAP data
Signed-off-by: Diego Escalona <diego.escalona@digi.com>
1 parent cd2135f commit 9ff6a9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/src/main/java/com/digi/xbee/api/ThreadDevice.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ protected AssociationIndicationStatus getAssociationIndicationStatus()
379379
*/
380380
public byte[] sendCoAPData(Inet6Address ipv6Address, String uri,
381381
HTTPMethodEnum method, byte[] data) throws TimeoutException, IllegalArgumentException, XBeeException {
382-
return sendCoAPData(ipv6Address, uri, method, true, data, false);
382+
boolean applyChanges = uri.startsWith(CoAPTxRequestPacket.URI_AT_COMMAND);
383+
return sendCoAPData(ipv6Address, uri, method, applyChanges, data, false);
383384
}
384385

385386
/**
@@ -485,7 +486,8 @@ public byte[] sendCoAPData(Inet6Address ipv6Address, String uri, HTTPMethodEnum
485486
*/
486487
public void sendCoAPDataAsync(Inet6Address ipv6Address, String uri,
487488
HTTPMethodEnum method, byte[] data) throws TimeoutException, IllegalArgumentException, XBeeException {
488-
sendCoAPData(ipv6Address, uri, method, true, data, true);
489+
boolean applyChanges = uri.startsWith(CoAPTxRequestPacket.URI_AT_COMMAND);
490+
sendCoAPData(ipv6Address, uri, method, applyChanges, data, true);
489491
}
490492

491493
/**

0 commit comments

Comments
 (0)