Merge branch 'californium_3_11_0_and_2215' into californium_3_11_0_and_2215_MsaCoapTest
This commit is contained in:
commit
c4ad3e7f38
@ -488,10 +488,7 @@ public class DefaultCoapClientContext implements CoapClientContext {
|
|||||||
Response resp = state.getAdaptor().convertToPublish(msg);
|
Response resp = state.getAdaptor().convertToPublish(msg);
|
||||||
Response response = new Response(ResponseCode.VALID);
|
Response response = new Response(ResponseCode.VALID);
|
||||||
response.setPayload(resp.getPayload());
|
response.setPayload(resp.getPayload());
|
||||||
if (state.getRpc() == null) {
|
response.getOptions().setObserve(attrs.getObserveCounter().getAndIncrement());
|
||||||
state.setRpc(new TbCoapObservationState(attrs.getExchange(), attrs.getToken()));
|
|
||||||
}
|
|
||||||
response.getOptions().setObserve(state.getRpc().getObserveCounter().getAndIncrement());
|
|
||||||
respond(attrs.getExchange(), response, state.getContentFormat());
|
respond(attrs.getExchange(), response, state.getContentFormat());
|
||||||
} catch (AdaptorException e) {
|
} catch (AdaptorException e) {
|
||||||
log.trace("Failed to reply due to error", e);
|
log.trace("Failed to reply due to error", e);
|
||||||
@ -522,7 +519,7 @@ public class DefaultCoapClientContext implements CoapClientContext {
|
|||||||
boolean conRequest = AbstractSyncSessionCallback.isConRequest(state.getAttrs());
|
boolean conRequest = AbstractSyncSessionCallback.isConRequest(state.getAttrs());
|
||||||
int requestId = getNextMsgId();
|
int requestId = getNextMsgId();
|
||||||
Response response = state.getAdaptor().convertToPublish(msg);
|
Response response = state.getAdaptor().convertToPublish(msg);
|
||||||
response.getOptions().setObserve(state.getRpc().getObserveCounter().getAndIncrement());
|
response.getOptions().setObserve(attrs.getObserveCounter().getAndIncrement());
|
||||||
response.setConfirmable(conRequest);
|
response.setConfirmable(conRequest);
|
||||||
response.setMID(requestId);
|
response.setMID(requestId);
|
||||||
if (conRequest) {
|
if (conRequest) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user