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/07/01 08:39:32 UTC
[plc4x] 05/05: chore(plc4go): Minor updates to the cbus protocol
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
commit dc938b7a858167559e3be2c715690d56705f4531
Author: christoferdutz <ch...@c-ware.de>
AuthorDate: Fri Jul 1 10:39:16 2022 +0200
chore(plc4go): Minor updates to the cbus protocol
---
.../protocols/cbus/readwrite/model/CBusHeader.go | 1 +
.../readwrite/model/CBusPointToPointCommand.go | 23 ++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/plc4go/protocols/cbus/readwrite/model/CBusHeader.go b/plc4go/protocols/cbus/readwrite/model/CBusHeader.go
index 80b131597..c0ed9f05e 100644
--- a/plc4go/protocols/cbus/readwrite/model/CBusHeader.go
+++ b/plc4go/protocols/cbus/readwrite/model/CBusHeader.go
@@ -175,6 +175,7 @@ func CBusHeaderParse(readBuffer utils.ReadBuffer) (CBusHeader, error) {
if closeErr := readBuffer.CloseContext("destinationAddressType"); closeErr != nil {
return nil, errors.Wrap(closeErr, "Error closing for destinationAddressType")
}
+ dpReservedManagement := _dpReservedManagement
if closeErr := readBuffer.CloseContext("CBusHeader"); closeErr != nil {
return nil, errors.Wrap(closeErr, "Error closing for CBusHeader")
diff --git a/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommand.go b/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommand.go
index 196f85cf2..78dd58dcc 100644
--- a/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommand.go
+++ b/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommand.go
@@ -31,6 +31,7 @@ import (
// Constant values.
const CBusPointToPointCommand_CR byte = 0xD
+const CBusPointToPointCommand_LF byte = 0xA
// CBusPointToPointCommand is the corresponding interface of CBusPointToPointCommand
type CBusPointToPointCommand interface {
@@ -145,6 +146,10 @@ func (m *_CBusPointToPointCommand) GetCr() byte {
return CBusPointToPointCommand_CR
}
+func (m *_CBusPointToPointCommand) GetLf() byte {
+ return CBusPointToPointCommand_LF
+}
+
///////////////////////
///////////////////////
///////////////////////////////////////////////////////////
@@ -191,6 +196,9 @@ func (m *_CBusPointToPointCommand) GetParentLengthInBits() uint16 {
// Const Field (cr)
lengthInBits += 8
+ // Const Field (lf)
+ lengthInBits += 8
+
return lengthInBits
}
@@ -319,6 +327,15 @@ func CBusPointToPointCommandParse(readBuffer utils.ReadBuffer, srchk bool) (CBus
return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", CBusPointToPointCommand_CR) + " but got " + fmt.Sprintf("%d", cr))
}
+ // Const Field (lf)
+ lf, _lfErr := readBuffer.ReadByte("lf")
+ if _lfErr != nil {
+ return nil, errors.Wrap(_lfErr, "Error parsing 'lf' field")
+ }
+ if lf != CBusPointToPointCommand_LF {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", CBusPointToPointCommand_LF) + " but got " + fmt.Sprintf("%d", lf))
+ }
+
if closeErr := readBuffer.CloseContext("CBusPointToPointCommand"); closeErr != nil {
return nil, errors.Wrap(closeErr, "Error closing for CBusPointToPointCommand")
}
@@ -397,6 +414,12 @@ func (pm *_CBusPointToPointCommand) SerializeParent(writeBuffer utils.WriteBuffe
return errors.Wrap(_crErr, "Error serializing 'cr' field")
}
+ // Const Field (lf)
+ _lfErr := writeBuffer.WriteByte("lf", 0xA)
+ if _lfErr != nil {
+ return errors.Wrap(_lfErr, "Error serializing 'lf' field")
+ }
+
if popErr := writeBuffer.PopContext("CBusPointToPointCommand"); popErr != nil {
return errors.Wrap(popErr, "Error popping for CBusPointToPointCommand")
}