fixed duplicated read/observe requests

This commit is contained in:
YevhenBondarenko 2021-07-15 20:35:13 +03:00 committed by Andrew Shvayka
parent 559aa282ca
commit 050f0d9b07

View File

@ -422,6 +422,7 @@ public class DefaultLwM2MUplinkMsgHandler extends LwM2MExecutorAwareService impl
private void sendReadRequests(LwM2mClient lwM2MClient, Lwm2mDeviceProfileTransportConfiguration profile, Set<String> supportedObjects) { private void sendReadRequests(LwM2mClient lwM2MClient, Lwm2mDeviceProfileTransportConfiguration profile, Set<String> supportedObjects) {
Set<String> targetIds = new HashSet<>(profile.getObserveAttr().getAttribute()); Set<String> targetIds = new HashSet<>(profile.getObserveAttr().getAttribute());
targetIds.addAll(profile.getObserveAttr().getTelemetry()); targetIds.addAll(profile.getObserveAttr().getTelemetry());
targetIds = diffSets(targetIds, profile.getObserveAttr().getObserve());
targetIds = targetIds.stream().filter(target -> isSupportedTargetId(supportedObjects, target)).collect(Collectors.toSet()); targetIds = targetIds.stream().filter(target -> isSupportedTargetId(supportedObjects, target)).collect(Collectors.toSet());
CountDownLatch latch = new CountDownLatch(targetIds.size()); CountDownLatch latch = new CountDownLatch(targetIds.size());