Skip to content

Commit c4e5b25

Browse files
authored
fix: fixed parsing of byte array in channel descriptor (#5756)
* fix: fixed parsing of byte array in channel descriptor Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com> * fix: copyright Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com> --------- Signed-off-by: SimoneFiorani <simone.fiorani@abinsula.com>
1 parent 93939d5 commit c4e5b25

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

kura/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/drivers/assets/LegacyChannelModel.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Eurotech and/or its affiliates and others
3-
*
2+
* Copyright (c) 2024, 2025 Eurotech and/or its affiliates and others
3+
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
66
* which is available at https://www.eclipse.org/legal/epl-2.0/
7-
*
7+
*
88
* SPDX-License-Identifier: EPL-2.0
9-
*
9+
*
1010
* Contributors:
1111
* Eurotech
12-
*******************************************************************************/
12+
******************************************************************************/
1313

1414
package org.eclipse.kura.web.client.ui.drivers.assets;
1515

@@ -78,7 +78,7 @@ private void detectSubtype() {
7878
}
7979
}
8080

81-
if (scaleOffsetType != null && valueType != null) {
81+
if (isScalarType(valueType) && scaleOffsetType != null && valueType != null) {
8282
subType = scaleOffsetType == ScaleOffsetType.DEFINED_BY_VALUE_TYPE
8383
? GwtConfigParameterType.valueOf(valueType.name())
8484
: GwtConfigParameterType.valueOf(scaleOffsetType.name());
@@ -87,6 +87,11 @@ private void detectSubtype() {
8787
this.subtype = subType;
8888
}
8989

90+
private boolean isScalarType(DataType valueType) {
91+
return valueType != null && valueType != DataType.BOOLEAN && valueType != DataType.STRING
92+
&& valueType != DataType.BYTE_ARRAY;
93+
}
94+
9095
private String getId(AssetConstants assetConstant) {
9196
return this.channelName + AssetConstants.CHANNEL_PROPERTY_SEPARATOR.value() + assetConstant.value();
9297
}

0 commit comments

Comments
 (0)