Skip to content

Commit

Permalink
GH-1393: Added resources 13-20 in to ServerConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Warmek authored and sbernard31 committed Apr 7, 2023
1 parent 989f4e7 commit 1ee287f
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,59 @@ public static class ServerConfig {
*/
public Integer apnLink = null;

/**
* The LwM2M Client sequences the LwM2M Server registrations in increasing order of this value. If this value is
* not defined, registration attempts to this server are not impacted by other server registrations.
*/
public ULong registrationPriority = null;

/**
* The delay before registration is attempted for this LwM2M Server based upon the completion of registration of
* the previous LwM2M Server in the registration order. This is only applied until the first successful
* registration after a successful bootstrapping sequence.
*/
public ULong initialDelay = null;

/**
* When set to true and registration to this LwM2M server fails, the LwM2M Client blocks registration to other
* servers in the order. When set to false, the LwM2M Client proceeds with registration to the next server in
* the order.
*/
public Boolean registrationFailure = null;

/**
* If set to true, this indicates that the LwM2M Client should re-bootstrap when either registration is
* explicitly rejected by the LwM2M Server or registration is considered as failing as dictated by the other
* resource settings. If set to false, the LwM2M Client will continue with the registration attempts as dictated
* by the other resource settings.
*/
public Boolean bootstrapOnRegistrationFailure = null;

/**
* The number of successive communication attempts before which a communication sequence is considered as failed
*/
public ULong communicationRetryCount = null;

/**
* The delay between successive communication attempts in a communication sequence. This value is multiplied by
* two to the power of the communication retry attempt minus one (2**(retry attempt-1)) to create an exponential
* back-off.
*/
public ULong CommunicationRetryTimer = null;

/**
* The delay between successive communication sequences. A communication sequence is defined as the exhaustion
* of the Communication Retry Count and Communication Retry Timer values. A communication sequence can be
* applied to server registrations or bootstrapping attempts. MAX_VALUE means do not perform another
* communication sequence.
*/
public ULong SequenceDelayTimer = null;

/**
* The number of successive communication sequences before which a registration attempt is considered as failed.
*/
public ULong SequenceRetryCount = null;

/**
* Using the Trigger Resource a LwM2M Client can indicate whether it is reachable over SMS (value set to 'true')
* or not (value set to 'false'). The default value (resource not present) is 'false'. When set to 'true' the
Expand Down Expand Up @@ -174,11 +227,12 @@ public static class ServerConfig {
@Override
public String toString() {
return String.format(
"ServerConfig [shortId=%s, lifetime=%s, defaultMinPeriod=%s, defaultMaxPeriod=%s, disableTimeout=%s, notifIfDisabled=%s, binding=%s, apnLink=%s, trigger=%s, preferredTransport=%s, muteSend=%s]",
"ServerConfig [shortId=%s, lifetime=%s, defaultMinPeriod=%s, defaultMaxPeriod=%s, disableTimeout=%s, notifIfDisabled=%s, binding=%s, apnLink=%s, registrationPriority=%s, initialDelay=%s, registrationFailure=%s, bootstrapOnRegistrationFailure=%s, communicationRetryCount=%s, CommunicationRetryTimer=%s, SequenceDelayTimer=%s, SequenceRetryCount=%s, trigger=%s, preferredTransport=%s, muteSend=%s]",
shortId, lifetime, defaultMinPeriod, defaultMaxPeriod, disableTimeout, notifIfDisabled, binding,
apnLink, trigger, preferredTransport, muteSend);
apnLink, registrationPriority, initialDelay, registrationFailure, bootstrapOnRegistrationFailure,
communicationRetryCount, CommunicationRetryTimer, SequenceDelayTimer, SequenceRetryCount, trigger,
preferredTransport, muteSend);
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,24 @@ public static LwM2mObjectInstance toServerInstance(int instanceId, ServerConfig
// resources since v1.1
if (serverConfig.apnLink != null)
resources.add(LwM2mSingleResource.newObjectLinkResource(10, new ObjectLink(11, serverConfig.apnLink)));

if (serverConfig.registrationPriority != null)
resources.add(LwM2mSingleResource.newUnsignedIntegerResource(13, serverConfig.registrationPriority));
if (serverConfig.initialDelay != null)
resources.add(LwM2mSingleResource.newUnsignedIntegerResource(14, serverConfig.initialDelay));
if (serverConfig.registrationFailure != null)
resources.add(LwM2mSingleResource.newBooleanResource(15, serverConfig.registrationFailure));
if (serverConfig.bootstrapOnRegistrationFailure != null)
resources.add(LwM2mSingleResource.newBooleanResource(16, serverConfig.bootstrapOnRegistrationFailure));
if (serverConfig.communicationRetryCount != null)
resources.add(LwM2mSingleResource.newUnsignedIntegerResource(17, serverConfig.communicationRetryCount));
if (serverConfig.CommunicationRetryTimer != null)
resources.add(LwM2mSingleResource.newUnsignedIntegerResource(18, serverConfig.CommunicationRetryTimer));
if (serverConfig.SequenceDelayTimer != null)
resources.add(LwM2mSingleResource.newUnsignedIntegerResource(19, serverConfig.SequenceDelayTimer));
if (serverConfig.SequenceRetryCount != null)
resources.add(LwM2mSingleResource.newUnsignedIntegerResource(20, serverConfig.SequenceRetryCount));

if (serverConfig.trigger != null)
resources.add(LwM2mSingleResource.newBooleanResource(21, serverConfig.trigger));
if (serverConfig.preferredTransport != null)
Expand Down

0 comments on commit 1ee287f

Please sign in to comment.