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 b2c4755
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,10 @@ public void add(CoapRequest observeRequest) {
// Create notification handler
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);

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

return router.apply(newReq.withOptions(coapOptionsBuilder -> coapOptionsBuilder.observe(null)));
} //
req -> router.apply(req.modify() //
.addContext(LwM2mKeys.LESHAN_NOTIFICATION, true) //
.options(coapOptionsBuilder -> coapOptionsBuilder.observe(null)) //
.build()) //
, observersManager);
objectTree.addListener(notificationHandler);
}
Expand Down
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 b2c4755

Please sign in to comment.