You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by hu...@apache.org on 2022/09/11 17:16:10 UTC

[plc4x] branch develop updated: chore(plc4j/profinet): escape the device name and type within the connection string

This is an automated email from the ASF dual-hosted git repository.

hutcheb pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2bdd36fe4 chore(plc4j/profinet): escape the device name and type within the connection string
2bdd36fe4 is described below

commit 2bdd36fe49acdb9b796c1045fb0ee3746084aedd
Author: Ben Hutcheson <be...@gmail.com>
AuthorDate: Sun Sep 11 11:15:59 2022 -0600

    chore(plc4j/profinet): escape the device name and type within the connection string
---
 .../apache/plc4x/java/profinet/discovery/ProfinetPlcDiscoverer.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/discovery/ProfinetPlcDiscoverer.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/discovery/ProfinetPlcDiscoverer.java
index 8df6bca59..5701f7c9c 100644
--- a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/discovery/ProfinetPlcDiscoverer.java
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/discovery/ProfinetPlcDiscoverer.java
@@ -145,13 +145,13 @@ public class ProfinetPlcDiscoverer implements PlcDiscoverer {
                                                 String deviceTypeName = "unknown";
                                                 if (blocks.containsKey(DEVICE_TYPE_NAME)) {
                                                     PnDcp_Block_DevicePropertiesDeviceVendor block = (PnDcp_Block_DevicePropertiesDeviceVendor) blocks.get(DEVICE_TYPE_NAME);
-                                                    deviceTypeName = new String(block.getDeviceVendorValue());
+                                                    deviceTypeName = new String(block.getDeviceVendorValue()).replace(" ", "%20");
                                                 }
 
                                                 String deviceName = "unknown";
                                                 if (blocks.containsKey(DEVICE_NAME_OF_STATION)) {
                                                     PnDcp_Block_DevicePropertiesNameOfStation block = (PnDcp_Block_DevicePropertiesNameOfStation) blocks.get(DEVICE_NAME_OF_STATION);
-                                                    deviceName = new String(block.getNameOfStation());
+                                                    deviceName = new String(block.getNameOfStation()).replace(" ", "%20");
                                                 }
 
                                                 String role = "unknown";