fix coap efento callbacks
This commit is contained in:
parent
0ef517c512
commit
0db0bb8607
@ -34,10 +34,9 @@ public class CoapEfentoCallback implements TransportServiceCallback<Void> {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Void msg) {
|
||||
//We respond only to confirmed requests in order to reduce battery consumption for Efento devices.
|
||||
if (isConRequest()) {
|
||||
Response response = new Response(onSuccessResponse);
|
||||
response.setAcknowledged(true);
|
||||
exchange.respond(response);
|
||||
exchange.respond(new Response(onSuccessResponse));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -99,10 +99,9 @@ public class CoapEfentoTransportResource extends AbstractCoapTransportResource {
|
||||
break;
|
||||
case DEVICE_INFO:
|
||||
case CONFIGURATION:
|
||||
Response response = new Response(CoAP.ResponseCode.CREATED);
|
||||
//We respond only to confirmed requests in order to reduce battery consumption for Efento devices.
|
||||
if (exchange.advanced().getRequest().isConfirmable()) {
|
||||
response.setAcknowledged(true);
|
||||
exchange.respond(response);
|
||||
exchange.respond(new Response(CoAP.ResponseCode.CREATED));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user