|
|
|
@ -220,7 +220,7 @@ public class DefaultCoapClientContext implements CoapClientContext { |
|
|
|
private void onUplink(TbCoapClientState client, boolean notifyOtherServers, long uplinkTs) { |
|
|
|
PowerMode powerMode = client.getPowerMode(); |
|
|
|
PowerSavingConfiguration profileSettings = null; |
|
|
|
if (powerMode == null) { |
|
|
|
if (powerMode == null && client.getProfileId() != null) { |
|
|
|
var clientProfile = getProfile(client.getProfileId()); |
|
|
|
if (clientProfile.isPresent()) { |
|
|
|
profileSettings = clientProfile.get().getClientSettings(); |
|
|
|
@ -726,7 +726,7 @@ public class DefaultCoapClientContext implements CoapClientContext { |
|
|
|
private boolean isDownlinkAllowed(TbCoapClientState client) { |
|
|
|
PowerMode powerMode = client.getPowerMode(); |
|
|
|
PowerSavingConfiguration profileSettings = null; |
|
|
|
if (powerMode == null) { |
|
|
|
if (powerMode == null && client.getProfileId() != null) { |
|
|
|
var clientProfile = getProfile(client.getProfileId()); |
|
|
|
if (clientProfile.isPresent()) { |
|
|
|
profileSettings = clientProfile.get().getClientSettings(); |
|
|
|
@ -775,11 +775,12 @@ public class DefaultCoapClientContext implements CoapClientContext { |
|
|
|
private PowerMode getPowerMode(TbCoapClientState client) { |
|
|
|
PowerMode powerMode = client.getPowerMode(); |
|
|
|
if (powerMode == null) { |
|
|
|
Optional<CoapDeviceProfileTransportConfiguration> deviceProfile = getProfile(client.getProfileId()); |
|
|
|
if (deviceProfile.isPresent()) { |
|
|
|
powerMode = deviceProfile.get().getClientSettings().getPowerMode(); |
|
|
|
} else { |
|
|
|
powerMode = PowerMode.PSM; |
|
|
|
powerMode = PowerMode.PSM; |
|
|
|
if (client.getProfileId() != null) { |
|
|
|
Optional<CoapDeviceProfileTransportConfiguration> deviceProfile = getProfile(client.getProfileId()); |
|
|
|
if (deviceProfile.isPresent()) { |
|
|
|
powerMode = deviceProfile.get().getClientSettings().getPowerMode(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return powerMode; |
|
|
|
|