-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIDD device support in leshan. #904
Comments
This is LWM2M v1.1 feature so this should be added to 2.0.0 branch.
I could add this to my priority list.
I plan to work on those new content format just after binding mode.
I pretty sure I don't get it. |
Yes, I can pass the cbor encoder/decoder but it does normal serialize/deserialize . It does not implement NodeEncoder . Let me know if this helps . I am directly framing coapRequest and setting destination context and sending.
My downlink request looks like this . I am setting the endpointContext but it is always framed new in RequestSender class. My request was to set the endpointContext only if it is null like below. public void sendCoapRequest(Identity destination, String sessionId, Request coapRequest, long timeoutInMs,
|
We get recent discussion about that : #866 (comment)
I just get that you are sending coap request and not LWM2M request. I believe I get you point this time, if you set an endpoint context on your coap request you don't want leshan override it. |
Yes this will be very helpful .
Still composite operations are not supported , so I am using coapRequest.
We are using jackson for mapping json so using same for cbor as well. |
Step 1 done. @madhushreegc, you could have a look at #908. |
@madhushreegc about :
I start some try. About key merging should not be an issue. |
@sbernard31 Yes, null check would be the good approach because user can pass their own endpointContext. |
@madhushreegc, I created #914. There is a warning when you are using custom endpointcontext to avoid this is not done on purpose. |
@sbernard31, This is fine for me . Thank you . |
@sbernard31 If it is not null, we are not doing anything and sending the context sent in request else Leshan is creating. if clause should check == null like below. if (**coapRequest.getDestinationContext() == null**) {
EndpointContext context = EndpointContextUtil.extractContext(destination, allowConnectionInitiation);
coapRequest.setDestinationContext(context);
} else {
LOG.warn(
"Destination context was not set by Leshan for this request. The context is used to ensure your talk to the right peer. Bad usage could bring to security issue. {}",
coapRequest);
} |
Good catch. I thought I already fixed this but visibly I didn't push it ... 🤦 |
So
We will probably need more step to add Composite operation. About that, which composite operation are you using ? |
Ok . Thank you. I am using all composite operations like composite-read, composite-write, composite-observe and cancel composite-observe . |
Hi, some updates : All of this should be available in 2.0.0-M2, so I think we can close this issue ? I will probably release a 2.0.0-M2 either at the end of the week or after my vacation (begin of January). Next feature I plan to work on will probably be "composite operation" or "send operation". |
Yes, we can close the case . Thank you so much. |
Hi , // Define destination
if (coapRequest.getDestinationContext() == null) {
EndpointContext context = EndpointContextUtil.extractContext(destination, allowConnectionInitiation);
coapRequest.setDestinationContext(context);
} else {
LOG.warn(
"Destination context was not set by Leshan for this request. The context is used to ensure you talk to the right peer. Bad usage could bring to security issue. {}",
coapRequest);
} If you add, I can use the sendLwm2mRequest method exposed for all single and composite downlink operations. |
I'm not sure to get you 🤔 Previously in But in this case how |
Yes, coapRequest.getDestinationContext() cannot be null because you are generating there, we have to make a provision to pass the destinationContext to this layer. I am using NIDD device , to support that I have to pass my own destinationContext to the connector . |
If you have your own connector, maybe you implement also a |
Do you try to use See /**
* ...
* @param lowerLayerConfig to tweak lower layer request (e.g. coap request)
* ...
*/ |
I guess this is pretty much what @madhushreegc did or maybe he just reuses existing one. |
@madhushreegc I created an issue to think about adding transport layer (see #1025) |
Yes, We have implemented own connector with own EndpointContextMatcher. I am passing necessary details to connector via endPointContext for binding mode N . |
I have not tried with LowerLayerConfig . I will try this . Thank you .. |
Ok let we know if it works with it 🙂 |
Do you succeed to make it work ? should we close this issue ? |
No, I did not try this . We can close now , I will try when I have time . Thank you. |
Hi,
leshan version : 1.1.0
I have a usescase to integrate with the NIDD device.
I have written encoder and decoder class to support cbor and own connector class.
Now, registration is failing because binding mode 'N' is not supported in leshan.
To support my usecase, following three changes are required in leshan .
If the context passed then we can have the same context to be passed to connector instead of creating new?
For example in method sendCoapRequest of RequestSender in leshan-server-cf ?
org.eclipse.leshan.server.californium.request.RequestSender
Could you please add these changes in leshan so that we can support nidd devices?
The text was updated successfully, but these errors were encountered: