question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NIDD device support in leshan.

See original GitHub issue

Hi,

leshan version : 1.1.0

I have a usescase to integrate with the NIDD device.

  1. Binding Mode comes with the type N
  2. Content format is senml CBOR.
  3. 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 .

  1. Add BindingMode N in BindingMode class of leshan-core.
  2. Add contentformat SENML_CBOR_CODE = 112 and SENML_JSON_CODE=110 in ContentFormat class of leshan-core.
  3. 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:closed
  • Created 3 years ago
  • Comments:27 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
madhushreegccommented, Jul 1, 2021

No, I did not try this . We can close now , I will try when I have time . Thank you.

0reactions
sbernard31commented, Jun 30, 2021

Do you succeed to make it work ? should we close this issue ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found