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

[plc4x] branch develop updated: refactor(api) PLC4Go API refactoring

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

cdutz 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 142481333f refactor(api) PLC4Go API refactoring
142481333f is described below

commit 142481333f54fd743d012d8520e6f4b088a608a9
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Nov 30 18:57:56 2022 +0100

    refactor(api) PLC4Go API refactoring
    
    - Fixed something the renaming of some variables broke
---
 plc4go/internal/ads/model/Configuration.go | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/plc4go/internal/ads/model/Configuration.go b/plc4go/internal/ads/model/Configuration.go
index b760e5f190..fdda44e38d 100644
--- a/plc4go/internal/ads/model/Configuration.go
+++ b/plc4go/internal/ads/model/Configuration.go
@@ -38,9 +38,9 @@ type Configuration struct {
 func ParseFromOptions(options map[string][]string) (Configuration, error) {
 	configuration := Configuration{}
 
-	sourceAmsNetId := getFromOptions(options, "SourceAmsNetId")
+	sourceAmsNetId := getFromOptions(options, "sourceAmsNetId")
 	if sourceAmsNetId == "" {
-		return Configuration{}, errors.New("Required parameter SourceAmsNetId missing")
+		return Configuration{}, errors.New("Required parameter sourceAmsNetId missing")
 	}
 	split := strings.Split(sourceAmsNetId, ".")
 	octet1, err := strconv.ParseUint(split[0], 10, 8)
@@ -75,18 +75,18 @@ func ParseFromOptions(options map[string][]string) (Configuration, error) {
 		uint8(octet5),
 		uint8(octet6),
 	)
-	sourceAmsPort := getFromOptions(options, "SourceAmsPort")
+	sourceAmsPort := getFromOptions(options, "sourceAmsPort")
 	if sourceAmsPort == "" {
-		return Configuration{}, errors.New("Required parameter SourceAmsPort missing")
+		return Configuration{}, errors.New("Required parameter sourceAmsPort missing")
 	}
 	parsedUint, err := strconv.ParseUint(sourceAmsPort, 10, 16)
 	if err != nil {
-		return Configuration{}, errors.Wrap(err, "error parsing SourceAmsPort")
+		return Configuration{}, errors.Wrap(err, "error parsing sourceAmsPort")
 	}
 	configuration.SourceAmsPort = uint16(parsedUint)
-	targetAmsNetId := getFromOptions(options, "TargetAmsNetId")
+	targetAmsNetId := getFromOptions(options, "targetAmsNetId")
 	if sourceAmsNetId == "" {
-		return Configuration{}, errors.New("Required parameter TargetAmsNetId missing")
+		return Configuration{}, errors.New("Required parameter targetAmsNetId missing")
 	}
 	split = strings.Split(targetAmsNetId, ".")
 	octet1, err = strconv.ParseUint(split[0], 10, 8)
@@ -121,13 +121,13 @@ func ParseFromOptions(options map[string][]string) (Configuration, error) {
 		uint8(octet5),
 		uint8(octet6),
 	)
-	targetAmsPort := getFromOptions(options, "TargetAmsPort")
+	targetAmsPort := getFromOptions(options, "targetAmsPort")
 	if targetAmsPort == "" {
-		return Configuration{}, errors.New("Required parameter TargetAmsPort missing")
+		return Configuration{}, errors.New("Required parameter targetAmsPort missing")
 	}
 	parsedUint, err = strconv.ParseUint(targetAmsPort, 10, 16)
 	if err != nil {
-		return Configuration{}, errors.Wrap(err, "error parsing TargetAmsPort")
+		return Configuration{}, errors.Wrap(err, "error parsing targetAmsPort")
 	}
 	configuration.TargetAmsPort = uint16(parsedUint)