NIDD device support in leshan.
See original GitHub issueHi,
leshan version : 1.1.0
I have a usescase to integrate with the NIDD device.
- Binding Mode comes with the type N
- Content format is senml CBOR.
- Need to pass few parameters like externalId to the connector and then to proxy.
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 .
- Add BindingMode N in BindingMode class of leshan-core.
- Add contentformat SENML_CBOR_CODE = 112 and SENML_JSON_CODE=110 in ContentFormat class of leshan-core.
- For every downlink , I am passing extra parameters in the context which are required to be passed to connector. 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 ?
// Define destination
if(null == coapRequest.getDestinationContext()) {
EndpointContext context = EndpointContextUtil.extractContext(destination, allowConnectionInitiation);
coapRequest.setDestinationContext(context);
}
org.eclipse.leshan.server.californium.request.RequestSender
public Response sendCoapRequest(Identity destination, String sessionId, Request coapRequest, long timeoutInMs,
boolean allowConnectionInitiation) throws InterruptedException {
// Define destination
if(coapRequest.getDestinationContext() == null) {
EndpointContext context = EndpointContextUtil.extractContext(destination, allowConnectionInitiation);
coapRequest.setDestinationContext(context);
}
// Send CoAP request synchronously
CoapSyncRequestObserver syncMessageObserver = new CoapSyncRequestObserver(coapRequest, timeoutInMs);
coapRequest.addMessageObserver(syncMessageObserver);
// Store pending request to be able to cancel it later
addOngoingRequest(sessionId, coapRequest);
// Send CoAP request asynchronously
if (destination.isSecure())
secureEndpoint.sendRequest(coapRequest);
else
nonSecureEndpoint.sendRequest(coapRequest);
// Wait for response, then return it
return syncMessageObserver.waitForCoapResponse();
}
public void sendCoapRequest(Identity destination, String sessionId, Request coapRequest, long timeoutInMs,
CoapResponseCallback responseCallback, ErrorCallback errorCallback, boolean allowConnectionInitiation) {
Validate.notNull(responseCallback);
Validate.notNull(errorCallback);
// Define destination
if(coapRequest.getDestinationContext() == null) {
EndpointContext context = EndpointContextUtil.extractContext(destination, allowConnectionInitiation);
coapRequest.setDestinationContext(context);
}
// Add CoAP request callback
MessageObserver obs = new CoapAsyncRequestObserver(coapRequest, responseCallback, errorCallback, timeoutInMs,
executor);
coapRequest.addMessageObserver(obs);
// Store pending request to be able to cancel it later
addOngoingRequest(sessionId, coapRequest);
// Send CoAP request asynchronously
if (destination.isSecure())
secureEndpoint.sendRequest(coapRequest);
else
nonSecureEndpoint.sendRequest(coapRequest);
}
Could you please add these changes in leshan so that we can support nidd devices?
Issue Analytics
- State:
- Created 3 years ago
- Comments:27 (14 by maintainers)
Top Results From Across the Web
Provide client certificate for mutual authentification with ...
My server (a leshan server) provide a x509 encoded certificate that the client need to trust in order to accept DTLS connection with...
Read more >About Non-IP Data Delivery (NIDD) - ThingSpace - Verizon
Non-IP Data Delivery (NIDD) offers efficient communication between IoT devices and enterprise applications. This data delivery method can help applications ...
Read more >An End-To-End LwM2M-Based Communication Architecture ...
Both NB-IoT and BLE support IP and NIDD and different combinations will have an impact on the end-to-end communication architecture.
Read more >Lightweight M2M | LWM2M - Software AG Technology Radar
OMA LightweightM2M (LwM2M) is a protocol standard that allows IoT devices to securely connect to ... A LwM2M client must support a standard-defined...
Read more >Comparing the efficiency of LwM2M and MQTT: hands-on test ...
of tests on a typical IoT device using an MQTT client and a LwM2M client. With technology support from AT&T and AVSystem, MachNation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, I did not try this . We can close now , I will try when I have time . Thank you.
Do you succeed to make it work ? should we close this issue ?