Commit 45c5703f2f5e28de8fe911cd0c8955d977f47e57
1 parent
040473ac
eDRX cycle parameters on device level
Showing
3 changed files
with
12 additions
and
6 deletions
@@ -136,7 +136,9 @@ public class LwM2mClient implements Serializable { | @@ -136,7 +136,9 @@ public class LwM2mClient implements Serializable { | ||
136 | builder.setDeviceName(device.getName()); | 136 | builder.setDeviceName(device.getName()); |
137 | deviceProfileOpt.ifPresent(deviceProfile -> updateSession(deviceProfile, builder)); | 137 | deviceProfileOpt.ifPresent(deviceProfile -> updateSession(deviceProfile, builder)); |
138 | this.session = builder.build(); | 138 | this.session = builder.build(); |
139 | - this.powerMode = ((Lwm2mDeviceTransportConfiguration) device.getDeviceData().getTransportConfiguration()).getPowerMode(); | 139 | + Lwm2mDeviceTransportConfiguration transportConfiguration = (Lwm2mDeviceTransportConfiguration) device.getDeviceData().getTransportConfiguration(); |
140 | + this.powerMode = transportConfiguration.getPowerMode(); | ||
141 | + this.edrxCycle = transportConfiguration.getEdrxCycle(); | ||
140 | } | 142 | } |
141 | 143 | ||
142 | public void onDeviceProfileUpdate(DeviceProfile deviceProfile) { | 144 | public void onDeviceProfileUpdate(DeviceProfile deviceProfile) { |
@@ -349,11 +349,15 @@ public class LwM2mClientContextImpl implements LwM2mClientContext { | @@ -349,11 +349,15 @@ public class LwM2mClientContextImpl implements LwM2mClientContext { | ||
349 | 349 | ||
350 | @Override | 350 | @Override |
351 | public Long getRequestTimeout(LwM2mClient client) { | 351 | public Long getRequestTimeout(LwM2mClient client) { |
352 | - var clientProfile = getProfile(client.getProfileId()); | ||
353 | - OtherConfiguration clientLwM2mSettings = clientProfile.getClientLwM2mSettings(); | ||
354 | Long timeout = null; | 352 | Long timeout = null; |
355 | - if (PowerMode.E_DRX.equals(clientLwM2mSettings.getPowerMode())) { | ||
356 | - timeout = clientLwM2mSettings.getEdrxCycle(); | 353 | + if (PowerMode.E_DRX.equals(client.getPowerMode()) && client.getEdrxCycle() != null) { |
354 | + timeout = client.getEdrxCycle(); | ||
355 | + } else { | ||
356 | + var clientProfile = getProfile(client.getProfileId()); | ||
357 | + OtherConfiguration clientLwM2mSettings = clientProfile.getClientLwM2mSettings(); | ||
358 | + if (PowerMode.E_DRX.equals(clientLwM2mSettings.getPowerMode())) { | ||
359 | + timeout = clientLwM2mSettings.getEdrxCycle(); | ||
360 | + } | ||
357 | } | 361 | } |
358 | if (timeout == null || timeout == 0L) { | 362 | if (timeout == null || timeout == 0L) { |
359 | timeout = this.config.getTimeout(); | 363 | timeout = this.config.getTimeout(); |
@@ -1222,7 +1222,7 @@ | @@ -1222,7 +1222,7 @@ | ||
1222 | "drx": "Discontinuous Reception (DRX)", | 1222 | "drx": "Discontinuous Reception (DRX)", |
1223 | "edrx": "Extended Discontinuous Reception (eDRX)" | 1223 | "edrx": "Extended Discontinuous Reception (eDRX)" |
1224 | }, | 1224 | }, |
1225 | - "edrx-cycle": "eDRX cycle", | 1225 | + "edrx-cycle": "eDRX cycle in milliseconds", |
1226 | "edrx-cycle-required": "eDRX cycle is required.", | 1226 | "edrx-cycle-required": "eDRX cycle is required.", |
1227 | "edrx-cycle-pattern": "eDRX cycle must be a positive integer.", | 1227 | "edrx-cycle-pattern": "eDRX cycle must be a positive integer.", |
1228 | "lwm2m": { | 1228 | "lwm2m": { |