Skip to content

Commit

Permalink
In LWM2M 1.1 client use /3/0/16 as binding register param. (not /1/?/7)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Oct 16, 2020
1 parent 3822bcd commit 6553441
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.eclipse.leshan.client.engine;

import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand All @@ -41,7 +42,9 @@
import org.eclipse.leshan.client.servers.ServersInfoExtractor;
import org.eclipse.leshan.client.util.LinkFormatHelper;
import org.eclipse.leshan.core.LwM2m.Version;
import org.eclipse.leshan.core.LwM2mId;
import org.eclipse.leshan.core.ResponseCode;
import org.eclipse.leshan.core.request.BindingMode;
import org.eclipse.leshan.core.request.BootstrapRequest;
import org.eclipse.leshan.core.request.DeregisterRequest;
import org.eclipse.leshan.core.request.Identity;
Expand Down Expand Up @@ -301,9 +304,11 @@ private Status register(ServerIdentity server) throws InterruptedException {
LOG.info("Trying to register to {} ...", server.getUri());
RegisterRequest request = null;
try {
request = new RegisterRequest(endpoint, dmInfo.lifetime, Version.lastSupported().toString(), dmInfo.binding,
queueMode, null, LinkFormatHelper.getClientDescription(objectEnablers.values(), null),
additionalAttributes);
EnumSet<BindingMode> supportedBindingMode = ServersInfoExtractor
.getDeviceSupportedBindingMode(objectEnablers.get(LwM2mId.DEVICE), 0);
request = new RegisterRequest(endpoint, dmInfo.lifetime, Version.lastSupported().toString(),
supportedBindingMode, queueMode, null,
LinkFormatHelper.getClientDescription(objectEnablers.values(), null), additionalAttributes);
if (observer != null) {
observer.onRegistrationStarted(server, request);
}
Expand Down

0 comments on commit 6553441

Please sign in to comment.