You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/09/05 14:33:06 UTC

[plc4x] branch develop updated: feat(plc4go): added fmt.Stringer to plc_message

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

sruehl 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 7df405186 feat(plc4go): added fmt.Stringer to plc_message
7df405186 is described below

commit 7df4051865ec1b68fb99282debaf938267ac8264
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon Sep 5 16:33:00 2022 +0200

    feat(plc4go): added fmt.Stringer to plc_message
---
 plc4go/pkg/api/model/plc_message.go  |  3 +++
 plc4go/pkg/api/values/plc_value.go   |  7 ++++++-
 plc4go/spi/values/PlcValueAdapter.go | 12 ++++++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/plc4go/pkg/api/model/plc_message.go b/plc4go/pkg/api/model/plc_message.go
index 834323281..29d9a101b 100644
--- a/plc4go/pkg/api/model/plc_message.go
+++ b/plc4go/pkg/api/model/plc_message.go
@@ -19,6 +19,9 @@
 
 package model
 
+import "fmt"
+
 type PlcMessage interface {
+	fmt.Stringer
 	IsAPlcMessage() bool
 }
diff --git a/plc4go/pkg/api/values/plc_value.go b/plc4go/pkg/api/values/plc_value.go
index 8de4570c2..8b157ac0e 100644
--- a/plc4go/pkg/api/values/plc_value.go
+++ b/plc4go/pkg/api/values/plc_value.go
@@ -19,9 +19,14 @@
 
 package values
 
-import "time"
+import (
+	"fmt"
+	"time"
+)
 
 type PlcValue interface {
+	fmt.Stringer
+
 	////
 	// Simple Types
 
diff --git a/plc4go/spi/values/PlcValueAdapter.go b/plc4go/spi/values/PlcValueAdapter.go
index 1e127f74d..828e9f79f 100644
--- a/plc4go/spi/values/PlcValueAdapter.go
+++ b/plc4go/spi/values/PlcValueAdapter.go
@@ -241,6 +241,10 @@ func (m PlcValueAdapter) GetPlcValueType() apiValues.PlcValueType {
 	panic("GetPlcValueType not implemented")
 }
 
+func (m PlcValueAdapter) String() string {
+	return "not implemented"
+}
+
 type PlcSimpleValueAdapter struct {
 	PlcValueAdapter
 }
@@ -253,6 +257,10 @@ func (m PlcSimpleValueAdapter) GetLength() uint32 {
 	return 1
 }
 
+func (m PlcSimpleValueAdapter) String() string {
+	return "not implemented"
+}
+
 type PlcSimpleNumericValueAdapter struct {
 	PlcSimpleValueAdapter
 }
@@ -308,3 +316,7 @@ func (m PlcSimpleNumericValueAdapter) IsFloat64() bool {
 func (m PlcSimpleNumericValueAdapter) IsString() bool {
 	return true
 }
+
+func (m PlcSimpleNumericValueAdapter) String() string {
+	return "not implemented"
+}