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/08/17 14:35:25 UTC

[plc4x] branch develop updated: fix(plc4go/cbus): don't misreport fields which are meant for sal or mmi

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 23df43ea1 fix(plc4go/cbus): don't misreport fields which are meant for sal or mmi
23df43ea1 is described below

commit 23df43ea1e02503d1a9f2b2c68d7efc2de995f26
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Aug 17 16:35:18 2022 +0200

    fix(plc4go/cbus): don't misreport fields which are meant for sal or mmi
---
 plc4go/internal/cbus/Subscriber.go | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/plc4go/internal/cbus/Subscriber.go b/plc4go/internal/cbus/Subscriber.go
index aebaf1993..2b1457c42 100644
--- a/plc4go/internal/cbus/Subscriber.go
+++ b/plc4go/internal/cbus/Subscriber.go
@@ -106,11 +106,9 @@ func (m *Subscriber) handleMonitoredMMI(calReply readWriteModel.CALReply) bool {
 		plcValues := map[string]values.PlcValue{}
 
 		for _, fieldName := range subscriptionRequest.GetFieldNames() {
-			field, ok := subscriptionRequest.GetField(fieldName).(MMIMonitorField)
+			field, ok := subscriptionRequest.GetField(fieldName).(*mmiMonitorField)
 			if !ok {
-				log.Warn().Msgf("Unusable field for subscription %s", field)
-				responseCodes[fieldName] = apiModel.PlcResponseCode_INVALID_ADDRESS
-				plcValues[fieldName] = nil
+				log.Debug().Msgf("Unusable field for mmi subscription %s", field)
 				continue
 			}
 			if unitAddress := field.GetUnitAddress(); unitAddress != nil {
@@ -223,9 +221,7 @@ func (m *Subscriber) handleMonitoredSal(sal readWriteModel.MonitoredSAL) bool {
 		for _, fieldName := range subscriptionRequest.GetFieldNames() {
 			field, ok := subscriptionRequest.GetField(fieldName).(SALMonitorField)
 			if !ok {
-				log.Warn().Msgf("Unusable field for subscription %s", field)
-				responseCodes[fieldName] = apiModel.PlcResponseCode_INVALID_ADDRESS
-				plcValues[fieldName] = nil
+				log.Debug().Msgf("Unusable field for sal subscription %s", field)
 				continue
 			}