Skip to content

Commit

Permalink
make observation works with return code 2.05
Browse files Browse the repository at this point in the history
  • Loading branch information
jvermillard committed Jan 31, 2015
1 parent 553e471 commit 1565c86
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1565c86

Please sign in to comment.