Skip to content

Commit

Permalink
Fix CancelObservationResponse building.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Nov 8, 2019
1 parent 480d886 commit e36b0cd
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,8 @@ public void visit(CancelObservationRequest request) {
// handle success response:
LwM2mNode content = decodeCoapResponse(request.getPath(), coapResponse, request,
registration.getEndpoint());
if (coapResponse.getOptions().hasObserve()) {
// observe request successful
Observation observation = ObserveUtil.createLwM2mObservation(coapRequest);
observationService.addObservation(registration, observation);
// add the observation to an ObserveResponse instance
lwM2mresponse = new CancelObservationResponse(toLwM2mResponseCode(coapResponse.getCode()), content,
null, observation, null, coapResponse);
} else {
lwM2mresponse = new CancelObservationResponse(toLwM2mResponseCode(coapResponse.getCode()), content,
null, null, null, coapResponse);
}
lwM2mresponse = new CancelObservationResponse(toLwM2mResponseCode(coapResponse.getCode()), content, null,
null, null, coapResponse);
} else {
// handle unexpected response:
handleUnexpectedResponseCode(registration.getEndpoint(), request, coapResponse);
Expand Down

0 comments on commit e36b0cd

Please sign in to comment.