diff --git a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/impl/CaliforniumObservation.java b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/impl/CaliforniumObservation.java index 7fc67804..cf12ab17 100644 --- a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/impl/CaliforniumObservation.java +++ b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/impl/CaliforniumObservation.java @@ -72,10 +72,11 @@ public void cancel() { @Override public void onResponse(Response coapResponse) { - if (coapResponse.getCode() == CoAP.ResponseCode.CHANGED) { + if (coapResponse.getCode() == CoAP.ResponseCode.CHANGED || coapResponse.getCode() == CoAP.ResponseCode.CONTENT) { try { LwM2mNode content = LwM2mNodeDecoder.decode(coapResponse.getPayload(), ContentFormat.fromCode(coapResponse.getOptions().getContentFormat()), path); + // TODO : response code changed or content from a LWM2M point of view? ValueResponse response = new ValueResponse(ResponseCode.CHANGED, content); for (ObservationListener listener : listeners) {