Commit 557d656d authored by Björn Butzin's avatar Björn Butzin
Browse files

Use constant for MTU in the core resource and fixed potential field hiding in...

Use constant for MTU in the core resource and fixed potential field hiding in the basic coap resource
parent 460a2f14
......@@ -186,7 +186,7 @@ public class BasicCoapResource implements CoapResource {
response = channel.createNotification(obsRequest, CoapResponseCode.Content_205,
this.observeSequenceNumber, this.reliableNotification);
}
response.setPayload(getValue());
response.setPayload(this.getValue());
channel.sendNotification(response);
}
}
......
......@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.ws4d.coap.Constants;
import org.ws4d.coap.messages.CoapMediaType;
import org.ws4d.coap.tools.Encoder;
......@@ -127,8 +128,8 @@ public class CoreResource extends BasicCoapResource {
returnString.append("\"");
}
// size estimate to be displayed?
// only display sz when larger than MTU; 1024 is MTU approx.
if (resource.getSizeEstimate() > 1024) {
// only display sz when larger than MTU
if (resource.getSizeEstimate() > Constants.COAP_PAYLOAD_SIZE_MAX) {
returnString.append(";sz=\"");
returnString.append(resource.getSizeEstimate());
returnString.append("\"");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment