Skip to content

Commit

Permalink
Integration of java-coap 6.21.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Apr 23, 2024
1 parent 99b94e7 commit 556ba42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Expand Up @@ -150,13 +150,12 @@ public void add(CoapRequest observeRequest) {
NotificationHandler notificationHandler = new NotificationHandler(
// use router but change Observe request in Read request and also flag request as notification
req -> {
TransportContext extendedContext = req.getTransContext() //
.with(LwM2mKeys.LESHAN_NOTIFICATION, true);
req.modify() //
.addContext(LwM2mKeys.LESHAN_NOTIFICATION, true) //
.options(coapOptionsBuilder -> coapOptionsBuilder.observe(null)) //
.build();

CoapRequest newReq = new CoapRequest(req.getMethod(), req.getToken(), req.options(),
req.getPayload(), req.getPeerAddress(), extendedContext);

return router.apply(newReq.withOptions(coapOptionsBuilder -> coapOptionsBuilder.observe(null)));
return router.apply(req);
} //
, observersManager);
objectTree.addListener(notificationHandler);
Expand Down
Expand Up @@ -229,8 +229,8 @@ public void visit(ObserveCompositeRequest request) {

// Add Observation to request context
coapRequestBuilder //
.context(LwM2mKeys.LESHAN_OBSERVATION, observation) //
.context(LwM2mKeys.LESHAN_REGISTRATION, registration) //
.addContext(LwM2mKeys.LESHAN_OBSERVATION, observation) //
.addContext(LwM2mKeys.LESHAN_REGISTRATION, registration) //
.token(token);
}

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -124,9 +124,9 @@ Contributors:
<!-- dependencies version -->
<californium.version>3.10.0</californium.version>
<logback.version>1.3.12</logback.version>
<javacoap.version>6.19.0</javacoap.version>
<javacoap.version>6.21.0</javacoap.version>
<netty.version>4.1.109.Final</netty.version>
<slf4j.api.version>2.0.9</slf4j.api.version>
<slf4j.api.version>2.0.13</slf4j.api.version>
<!-- stuck to 9.4.x for java8 compliance -->
<jetty.version>9.4.53.v20231009</jetty.version>
<jackson.version>2.15.3</jackson.version>
Expand Down

0 comments on commit 556ba42

Please sign in to comment.