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/01/13 10:42:53 UTC
[plc4x] 01/02: feat(bacnet): implemented BVLCWriteBroadcastDistributionTable
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
commit 18f7ac7c8ef0bfc5c7a75d76f0529bcbaae07194
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Jan 13 10:46:49 2022 +0100
feat(bacnet): implemented BVLCWriteBroadcastDistributionTable
---
plc4go/internal/plc4go/ads/fieldtype_string.go | 17 --
.../plc4go/bacnetip/readwrite/ParserHelper.go | 2 +
.../plc4go/bacnetip/readwrite/XmlParserHelper.go | 2 +
.../plc4go/bacnetip/readwrite/model/BVLC.go | 83 +++++----
.../model/BVLCDeleteForeignDeviceTableEntry.go | 21 ++-
.../model/BVLCDistributeBroadcastToNetwork.go | 47 ++---
.../bacnetip/readwrite/model/BVLCForwardedNPDU.go | 95 +++++-----
.../readwrite/model/BVLCOriginalBroadcastNPDU.go | 47 ++---
.../readwrite/model/BVLCOriginalUnicastNPDU.go | 47 ++---
.../model/BVLCReadBroadcastDistributionTable.go | 21 ++-
.../model/BVLCReadBroadcastDistributionTableAck.go | 21 ++-
.../readwrite/model/BVLCReadForeignDeviceTable.go | 21 ++-
.../model/BVLCReadForeignDeviceTableAck.go | 21 ++-
.../readwrite/model/BVLCRegisterForeignDevice.go | 41 ++--
.../plc4go/bacnetip/readwrite/model/BVLCResult.go | 45 +++--
.../bacnetip/readwrite/model/BVLCSecureBVLL.go | 21 ++-
.../model/BVLCWideBroadcastDistributionTable.go | 133 -------------
.../model/BVLCWriteBroadcastDistributionTable.go | 186 +++++++++++++++++++
.../BVLCWriteBroadcastDistributionTableEntry.go | 206 +++++++++++++++++++++
plc4go/internal/plc4go/modbus/fieldtype_string.go | 17 --
plc4go/internal/plc4go/s7/fieldtype_string.go | 17 --
.../plc4go/spi/testutils/steptype_string.go | 17 --
.../plc4x/java/bacnetip/RandomPackagesTest.java | 5 +-
.../resources/protocols/bacnetip/bacnetip.mspec | 34 ++--
24 files changed, 723 insertions(+), 444 deletions(-)
diff --git a/plc4go/internal/plc4go/ads/fieldtype_string.go b/plc4go/internal/plc4go/ads/fieldtype_string.go
index 4b0da39..6c2fa73 100644
--- a/plc4go/internal/plc4go/ads/fieldtype_string.go
+++ b/plc4go/internal/plc4go/ads/fieldtype_string.go
@@ -1,20 +1,3 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
// Code generated by "stringer -type FieldType"; DO NOT EDIT.
package ads
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/ParserHelper.go b/plc4go/internal/plc4go/bacnetip/readwrite/ParserHelper.go
index 8c3ae3d..e6e37e1 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/ParserHelper.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/ParserHelper.go
@@ -157,6 +157,8 @@ func (m BacnetipParserHelper) Parse(typeName string, arguments []string, io util
return nil, errors.Wrap(err, "Error parsing")
}
return model.NPDUParse(io, npduLength)
+ case "BVLCWriteBroadcastDistributionTableEntry":
+ return model.BVLCWriteBroadcastDistributionTableEntryParse(io)
}
return nil, errors.Errorf("Unsupported type %s", typeName)
}
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/XmlParserHelper.go b/plc4go/internal/plc4go/bacnetip/readwrite/XmlParserHelper.go
index e3dfa21..1c30f00 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/XmlParserHelper.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/XmlParserHelper.go
@@ -184,6 +184,8 @@ func (m BacnetipXmlParserHelper) Parse(typeName string, xmlString string, parser
}
npduLength := uint16(parsedUint0)
return model.NPDUParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)), npduLength)
+ case "BVLCWriteBroadcastDistributionTableEntry":
+ return model.BVLCWriteBroadcastDistributionTableEntryParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
}
return nil, errors.Errorf("Unsupported type %s", typeName)
}
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLC.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLC.go
index fc1252f..3dc618d 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLC.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLC.go
@@ -19,19 +19,22 @@
package model
+
import (
"fmt"
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// Constant values.
const BVLC_BACNETTYPE uint8 = 0x81
// The data-structure of this message
type BVLC struct {
+ BvlcPayloadLength uint16
Child IBVLCChild
}
@@ -50,13 +53,12 @@ type IBVLCParent interface {
type IBVLCChild interface {
Serialize(writeBuffer utils.WriteBuffer) error
- InitializeParent(parent *BVLC)
+ InitializeParent(parent *BVLCbvlcPayloadLength uint16)
GetTypeName() string
IBVLC
}
-func NewBVLC() *BVLC {
- return &BVLC{}
+func NewBVLC( bvlcPayloadLength uint16 ) *BVLC { return &BVLC{BvlcPayloadLength: bvlcPayloadLength}
}
func CastBVLC(structType interface{}) *BVLC {
@@ -90,11 +92,13 @@ func (m *BVLC) ParentLengthInBits() uint16 {
// Const Field (bacnetType)
lengthInBits += 8
// Discriminator Field (bvlcFunction)
- lengthInBits += 8
+ lengthInBits += 8;
// Implicit Field (bvlcLength)
lengthInBits += 16
+ // A virtual field doesn't have any in- or output.
+
return lengthInBits
}
@@ -119,7 +123,7 @@ func BVLCParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
// Discriminator Field (bvlcFunction) (Used as input to a switch field)
bvlcFunction, _bvlcFunctionErr := readBuffer.ReadUint8("bvlcFunction", 8)
if _bvlcFunctionErr != nil {
- return nil, errors.Wrap(_bvlcFunctionErr, "Error parsing 'bvlcFunction' field")
+ return nil, errors.Wrap(_bvlcFunctionErr, "Error parsing 'bvlcFunction' field")
}
// Implicit Field (bvlcLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
@@ -129,36 +133,40 @@ func BVLCParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
return nil, errors.Wrap(_bvlcLengthErr, "Error parsing 'bvlcLength' field")
}
+ // Virtual field
+ _bvlcPayloadLength := uint16(bvlcLength) - uint16(uint16(4))
+ bvlcPayloadLength := uint16(_bvlcPayloadLength)
+
// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
var _parent *BVLC
var typeSwitchError error
switch {
- case bvlcFunction == 0x00: // BVLCResult
- _parent, typeSwitchError = BVLCResultParse(readBuffer)
- case bvlcFunction == 0x01: // BVLCWideBroadcastDistributionTable
- _parent, typeSwitchError = BVLCWideBroadcastDistributionTableParse(readBuffer)
- case bvlcFunction == 0x02: // BVLCReadBroadcastDistributionTable
- _parent, typeSwitchError = BVLCReadBroadcastDistributionTableParse(readBuffer)
- case bvlcFunction == 0x03: // BVLCReadBroadcastDistributionTableAck
- _parent, typeSwitchError = BVLCReadBroadcastDistributionTableAckParse(readBuffer)
- case bvlcFunction == 0x04: // BVLCForwardedNPDU
- _parent, typeSwitchError = BVLCForwardedNPDUParse(readBuffer, bvlcLength)
- case bvlcFunction == 0x05: // BVLCRegisterForeignDevice
- _parent, typeSwitchError = BVLCRegisterForeignDeviceParse(readBuffer)
- case bvlcFunction == 0x06: // BVLCReadForeignDeviceTable
- _parent, typeSwitchError = BVLCReadForeignDeviceTableParse(readBuffer)
- case bvlcFunction == 0x07: // BVLCReadForeignDeviceTableAck
- _parent, typeSwitchError = BVLCReadForeignDeviceTableAckParse(readBuffer)
- case bvlcFunction == 0x08: // BVLCDeleteForeignDeviceTableEntry
- _parent, typeSwitchError = BVLCDeleteForeignDeviceTableEntryParse(readBuffer)
- case bvlcFunction == 0x09: // BVLCDistributeBroadcastToNetwork
- _parent, typeSwitchError = BVLCDistributeBroadcastToNetworkParse(readBuffer, bvlcLength)
- case bvlcFunction == 0x0A: // BVLCOriginalUnicastNPDU
- _parent, typeSwitchError = BVLCOriginalUnicastNPDUParse(readBuffer, bvlcLength)
- case bvlcFunction == 0x0B: // BVLCOriginalBroadcastNPDU
- _parent, typeSwitchError = BVLCOriginalBroadcastNPDUParse(readBuffer, bvlcLength)
- case bvlcFunction == 0x0C: // BVLCSecureBVLL
- _parent, typeSwitchError = BVLCSecureBVLLParse(readBuffer)
+case bvlcFunction == 0x00 : // BVLCResult
+ _parent, typeSwitchError = BVLCResultParse(readBuffer, )
+case bvlcFunction == 0x01 : // BVLCWriteBroadcastDistributionTable
+ _parent, typeSwitchError = BVLCWriteBroadcastDistributionTableParse(readBuffer, bvlcPayloadLength)
+case bvlcFunction == 0x02 : // BVLCReadBroadcastDistributionTable
+ _parent, typeSwitchError = BVLCReadBroadcastDistributionTableParse(readBuffer, )
+case bvlcFunction == 0x03 : // BVLCReadBroadcastDistributionTableAck
+ _parent, typeSwitchError = BVLCReadBroadcastDistributionTableAckParse(readBuffer, )
+case bvlcFunction == 0x04 : // BVLCForwardedNPDU
+ _parent, typeSwitchError = BVLCForwardedNPDUParse(readBuffer, bvlcPayloadLength)
+case bvlcFunction == 0x05 : // BVLCRegisterForeignDevice
+ _parent, typeSwitchError = BVLCRegisterForeignDeviceParse(readBuffer, )
+case bvlcFunction == 0x06 : // BVLCReadForeignDeviceTable
+ _parent, typeSwitchError = BVLCReadForeignDeviceTableParse(readBuffer, )
+case bvlcFunction == 0x07 : // BVLCReadForeignDeviceTableAck
+ _parent, typeSwitchError = BVLCReadForeignDeviceTableAckParse(readBuffer, )
+case bvlcFunction == 0x08 : // BVLCDeleteForeignDeviceTableEntry
+ _parent, typeSwitchError = BVLCDeleteForeignDeviceTableEntryParse(readBuffer, )
+case bvlcFunction == 0x09 : // BVLCDistributeBroadcastToNetwork
+ _parent, typeSwitchError = BVLCDistributeBroadcastToNetworkParse(readBuffer, bvlcPayloadLength)
+case bvlcFunction == 0x0A : // BVLCOriginalUnicastNPDU
+ _parent, typeSwitchError = BVLCOriginalUnicastNPDUParse(readBuffer, bvlcPayloadLength)
+case bvlcFunction == 0x0B : // BVLCOriginalBroadcastNPDU
+ _parent, typeSwitchError = BVLCOriginalBroadcastNPDUParse(readBuffer, bvlcPayloadLength)
+case bvlcFunction == 0x0C : // BVLCSecureBVLL
+ _parent, typeSwitchError = BVLCSecureBVLLParse(readBuffer, )
default:
// TODO: return actual type
typeSwitchError = errors.New("Unmapped type")
@@ -172,7 +180,7 @@ func BVLCParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
}
// Finish initializing
- _parent.Child.InitializeParent(_parent)
+ _parent.Child.InitializeParent(_parentbvlcPayloadLength)
return _parent, nil
}
@@ -181,7 +189,7 @@ func (m *BVLC) Serialize(writeBuffer utils.WriteBuffer) error {
}
func (m *BVLC) SerializeParent(writeBuffer utils.WriteBuffer, child IBVLC, serializeChildFunction func() error) error {
- if pushErr := writeBuffer.PushContext("BVLC"); pushErr != nil {
+ if pushErr :=writeBuffer.PushContext("BVLC"); pushErr != nil {
return pushErr
}
@@ -205,6 +213,10 @@ func (m *BVLC) SerializeParent(writeBuffer utils.WriteBuffer, child IBVLC, seria
if _bvlcLengthErr != nil {
return errors.Wrap(_bvlcLengthErr, "Error serializing 'bvlcLength' field")
}
+ // Virtual field
+ if _bvlcPayloadLengthErr := writeBuffer.WriteVirtual("bvlcPayloadLength", m.BvlcPayloadLength); _bvlcPayloadLengthErr != nil {
+ return errors.Wrap(_bvlcPayloadLengthErr, "Error serializing 'bvlcPayloadLength' field")
+ }
// Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
if _typeSwitchErr := serializeChildFunction(); _typeSwitchErr != nil {
@@ -225,3 +237,6 @@ func (m *BVLC) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go
index b9d36dc..61314a5 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go
@@ -19,11 +19,13 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCDeleteForeignDeviceTableEntry struct {
@@ -41,15 +43,14 @@ type IBVLCDeleteForeignDeviceTableEntry interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCDeleteForeignDeviceTableEntry) BvlcFunction() uint8 {
- return 0x08
-}
+return 0x08}
+
-func (m *BVLCDeleteForeignDeviceTableEntry) InitializeParent(parent *BVLC) {
+func (m *BVLCDeleteForeignDeviceTableEntry) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCDeleteForeignDeviceTableEntry() *BVLC {
- child := &BVLCDeleteForeignDeviceTableEntry{
- BVLC: NewBVLC(),
+func NewBVLCDeleteForeignDeviceTableEntry( bvlcPayloadLength uint16 ) *BVLC { child := &BVLCDeleteForeignDeviceTableEntry{
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -88,6 +89,7 @@ func (m *BVLCDeleteForeignDeviceTableEntry) LengthInBitsConditional(lastItem boo
return lengthInBits
}
+
func (m *BVLCDeleteForeignDeviceTableEntry) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -103,7 +105,7 @@ func BVLCDeleteForeignDeviceTableEntryParse(readBuffer utils.ReadBuffer) (*BVLC,
// Create a partially initialized instance
_child := &BVLCDeleteForeignDeviceTableEntry{
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -131,3 +133,6 @@ func (m *BVLCDeleteForeignDeviceTableEntry) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDistributeBroadcastToNetwork.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDistributeBroadcastToNetwork.go
index 4bcd58e..091c82f 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDistributeBroadcastToNetwork.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCDistributeBroadcastToNetwork.go
@@ -19,12 +19,14 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCDistributeBroadcastToNetwork struct {
@@ -43,16 +45,15 @@ type IBVLCDistributeBroadcastToNetwork interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCDistributeBroadcastToNetwork) BvlcFunction() uint8 {
- return 0x09
-}
+return 0x09}
-func (m *BVLCDistributeBroadcastToNetwork) InitializeParent(parent *BVLC) {
+
+func (m *BVLCDistributeBroadcastToNetwork) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCDistributeBroadcastToNetwork(npdu *NPDU) *BVLC {
- child := &BVLCDistributeBroadcastToNetwork{
+func NewBVLCDistributeBroadcastToNetwork( npdu *NPDU , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCDistributeBroadcastToNetwork{
Npdu: npdu,
- BVLC: NewBVLC(),
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -94,11 +95,12 @@ func (m *BVLCDistributeBroadcastToNetwork) LengthInBitsConditional(lastItem bool
return lengthInBits
}
+
func (m *BVLCDistributeBroadcastToNetwork) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
-func BVLCDistributeBroadcastToNetworkParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BVLC, error) {
+func BVLCDistributeBroadcastToNetworkParse(readBuffer utils.ReadBuffer, bvlcPayloadLength uint16) (*BVLC, error) {
if pullErr := readBuffer.PullContext("BVLCDistributeBroadcastToNetwork"); pullErr != nil {
return nil, pullErr
}
@@ -107,7 +109,7 @@ func BVLCDistributeBroadcastToNetworkParse(readBuffer utils.ReadBuffer, bvlcLeng
if pullErr := readBuffer.PullContext("npdu"); pullErr != nil {
return nil, pullErr
}
- _npdu, _npduErr := NPDUParse(readBuffer, uint16(bvlcLength)-uint16(uint16(4)))
+_npdu, _npduErr := NPDUParse(readBuffer , bvlcPayloadLength )
if _npduErr != nil {
return nil, errors.Wrap(_npduErr, "Error parsing 'npdu' field")
}
@@ -123,7 +125,7 @@ func BVLCDistributeBroadcastToNetworkParse(readBuffer utils.ReadBuffer, bvlcLeng
// Create a partially initialized instance
_child := &BVLCDistributeBroadcastToNetwork{
Npdu: CastNPDU(npdu),
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -135,17 +137,17 @@ func (m *BVLCDistributeBroadcastToNetwork) Serialize(writeBuffer utils.WriteBuff
return pushErr
}
- // Simple Field (npdu)
- if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
- return pushErr
- }
- _npduErr := m.Npdu.Serialize(writeBuffer)
- if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
- return popErr
- }
- if _npduErr != nil {
- return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
- }
+ // Simple Field (npdu)
+ if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
+ return pushErr
+ }
+ _npduErr := m.Npdu.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
+ return popErr
+ }
+ if _npduErr != nil {
+ return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
+ }
if popErr := writeBuffer.PopContext("BVLCDistributeBroadcastToNetwork"); popErr != nil {
return popErr
@@ -163,3 +165,6 @@ func (m *BVLCDistributeBroadcastToNetwork) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCForwardedNPDU.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCForwardedNPDU.go
index 6ea69ba..0d0765b 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCForwardedNPDU.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCForwardedNPDU.go
@@ -19,17 +19,19 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCForwardedNPDU struct {
*BVLC
- Ip []uint8
+ Ip []uint8
Port uint16
Npdu *NPDU
}
@@ -45,18 +47,17 @@ type IBVLCForwardedNPDU interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCForwardedNPDU) BvlcFunction() uint8 {
- return 0x04
-}
+return 0x04}
+
-func (m *BVLCForwardedNPDU) InitializeParent(parent *BVLC) {
+func (m *BVLCForwardedNPDU) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCForwardedNPDU(ip []uint8, port uint16, npdu *NPDU) *BVLC {
- child := &BVLCForwardedNPDU{
- Ip: ip,
+func NewBVLCForwardedNPDU( ip []uint8 , port uint16 , npdu *NPDU , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCForwardedNPDU{
+ Ip: ip,
Port: port,
Npdu: npdu,
- BVLC: NewBVLC(),
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -98,7 +99,7 @@ func (m *BVLCForwardedNPDU) LengthInBitsConditional(lastItem bool) uint16 {
}
// Simple field (port)
- lengthInBits += 16
+ lengthInBits += 16;
// Simple field (npdu)
lengthInBits += m.Npdu.LengthInBits()
@@ -106,11 +107,12 @@ func (m *BVLCForwardedNPDU) LengthInBitsConditional(lastItem bool) uint16 {
return lengthInBits
}
+
func (m *BVLCForwardedNPDU) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
-func BVLCForwardedNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BVLC, error) {
+func BVLCForwardedNPDUParse(readBuffer utils.ReadBuffer, bvlcPayloadLength uint16) (*BVLC, error) {
if pullErr := readBuffer.PullContext("BVLCForwardedNPDU"); pullErr != nil {
return nil, pullErr
}
@@ -135,7 +137,7 @@ func BVLCForwardedNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BV
}
// Simple Field (port)
- _port, _portErr := readBuffer.ReadUint16("port", 16)
+_port, _portErr := readBuffer.ReadUint16("port", 16)
if _portErr != nil {
return nil, errors.Wrap(_portErr, "Error parsing 'port' field")
}
@@ -145,7 +147,7 @@ func BVLCForwardedNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BV
if pullErr := readBuffer.PullContext("npdu"); pullErr != nil {
return nil, pullErr
}
- _npdu, _npduErr := NPDUParse(readBuffer, uint16(bvlcLength)-uint16(uint16(10)))
+_npdu, _npduErr := NPDUParse(readBuffer , uint16(bvlcPayloadLength) - uint16(uint16(6)) )
if _npduErr != nil {
return nil, errors.Wrap(_npduErr, "Error parsing 'npdu' field")
}
@@ -160,10 +162,10 @@ func BVLCForwardedNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BV
// Create a partially initialized instance
_child := &BVLCForwardedNPDU{
- Ip: ip,
+ Ip: ip,
Port: port,
Npdu: CastNPDU(npdu),
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -175,40 +177,40 @@ func (m *BVLCForwardedNPDU) Serialize(writeBuffer utils.WriteBuffer) error {
return pushErr
}
- // Array Field (ip)
- if m.Ip != nil {
- if pushErr := writeBuffer.PushContext("ip", utils.WithRenderAsList(true)); pushErr != nil {
- return pushErr
- }
- for _, _element := range m.Ip {
- _elementErr := writeBuffer.WriteUint8("", 8, _element)
- if _elementErr != nil {
- return errors.Wrap(_elementErr, "Error serializing 'ip' field")
- }
- }
- if popErr := writeBuffer.PopContext("ip", utils.WithRenderAsList(true)); popErr != nil {
- return popErr
- }
- }
-
- // Simple Field (port)
- port := uint16(m.Port)
- _portErr := writeBuffer.WriteUint16("port", 16, (port))
- if _portErr != nil {
- return errors.Wrap(_portErr, "Error serializing 'port' field")
- }
-
- // Simple Field (npdu)
- if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
+ // Array Field (ip)
+ if m.Ip != nil {
+ if pushErr := writeBuffer.PushContext("ip", utils.WithRenderAsList(true)); pushErr != nil {
return pushErr
}
- _npduErr := m.Npdu.Serialize(writeBuffer)
- if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
- return popErr
+ for _, _element := range m.Ip {
+ _elementErr := writeBuffer.WriteUint8("", 8, _element)
+ if _elementErr != nil {
+ return errors.Wrap(_elementErr, "Error serializing 'ip' field")
+ }
}
- if _npduErr != nil {
- return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
+ if popErr := writeBuffer.PopContext("ip", utils.WithRenderAsList(true)); popErr != nil {
+ return popErr
}
+ }
+
+ // Simple Field (port)
+ port := uint16(m.Port)
+ _portErr := writeBuffer.WriteUint16("port", 16, (port))
+ if _portErr != nil {
+ return errors.Wrap(_portErr, "Error serializing 'port' field")
+ }
+
+ // Simple Field (npdu)
+ if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
+ return pushErr
+ }
+ _npduErr := m.Npdu.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
+ return popErr
+ }
+ if _npduErr != nil {
+ return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
+ }
if popErr := writeBuffer.PopContext("BVLCForwardedNPDU"); popErr != nil {
return popErr
@@ -226,3 +228,6 @@ func (m *BVLCForwardedNPDU) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalBroadcastNPDU.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalBroadcastNPDU.go
index 6498899..ccec798 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalBroadcastNPDU.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalBroadcastNPDU.go
@@ -19,12 +19,14 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCOriginalBroadcastNPDU struct {
@@ -43,16 +45,15 @@ type IBVLCOriginalBroadcastNPDU interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCOriginalBroadcastNPDU) BvlcFunction() uint8 {
- return 0x0B
-}
+return 0x0B}
-func (m *BVLCOriginalBroadcastNPDU) InitializeParent(parent *BVLC) {
+
+func (m *BVLCOriginalBroadcastNPDU) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCOriginalBroadcastNPDU(npdu *NPDU) *BVLC {
- child := &BVLCOriginalBroadcastNPDU{
+func NewBVLCOriginalBroadcastNPDU( npdu *NPDU , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCOriginalBroadcastNPDU{
Npdu: npdu,
- BVLC: NewBVLC(),
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -94,11 +95,12 @@ func (m *BVLCOriginalBroadcastNPDU) LengthInBitsConditional(lastItem bool) uint1
return lengthInBits
}
+
func (m *BVLCOriginalBroadcastNPDU) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
-func BVLCOriginalBroadcastNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BVLC, error) {
+func BVLCOriginalBroadcastNPDUParse(readBuffer utils.ReadBuffer, bvlcPayloadLength uint16) (*BVLC, error) {
if pullErr := readBuffer.PullContext("BVLCOriginalBroadcastNPDU"); pullErr != nil {
return nil, pullErr
}
@@ -107,7 +109,7 @@ func BVLCOriginalBroadcastNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint
if pullErr := readBuffer.PullContext("npdu"); pullErr != nil {
return nil, pullErr
}
- _npdu, _npduErr := NPDUParse(readBuffer, uint16(bvlcLength)-uint16(uint16(4)))
+_npdu, _npduErr := NPDUParse(readBuffer , bvlcPayloadLength )
if _npduErr != nil {
return nil, errors.Wrap(_npduErr, "Error parsing 'npdu' field")
}
@@ -123,7 +125,7 @@ func BVLCOriginalBroadcastNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint
// Create a partially initialized instance
_child := &BVLCOriginalBroadcastNPDU{
Npdu: CastNPDU(npdu),
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -135,17 +137,17 @@ func (m *BVLCOriginalBroadcastNPDU) Serialize(writeBuffer utils.WriteBuffer) err
return pushErr
}
- // Simple Field (npdu)
- if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
- return pushErr
- }
- _npduErr := m.Npdu.Serialize(writeBuffer)
- if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
- return popErr
- }
- if _npduErr != nil {
- return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
- }
+ // Simple Field (npdu)
+ if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
+ return pushErr
+ }
+ _npduErr := m.Npdu.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
+ return popErr
+ }
+ if _npduErr != nil {
+ return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
+ }
if popErr := writeBuffer.PopContext("BVLCOriginalBroadcastNPDU"); popErr != nil {
return popErr
@@ -163,3 +165,6 @@ func (m *BVLCOriginalBroadcastNPDU) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalUnicastNPDU.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalUnicastNPDU.go
index e0d4096..40c2245 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalUnicastNPDU.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCOriginalUnicastNPDU.go
@@ -19,12 +19,14 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCOriginalUnicastNPDU struct {
@@ -43,16 +45,15 @@ type IBVLCOriginalUnicastNPDU interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCOriginalUnicastNPDU) BvlcFunction() uint8 {
- return 0x0A
-}
+return 0x0A}
-func (m *BVLCOriginalUnicastNPDU) InitializeParent(parent *BVLC) {
+
+func (m *BVLCOriginalUnicastNPDU) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCOriginalUnicastNPDU(npdu *NPDU) *BVLC {
- child := &BVLCOriginalUnicastNPDU{
+func NewBVLCOriginalUnicastNPDU( npdu *NPDU , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCOriginalUnicastNPDU{
Npdu: npdu,
- BVLC: NewBVLC(),
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -94,11 +95,12 @@ func (m *BVLCOriginalUnicastNPDU) LengthInBitsConditional(lastItem bool) uint16
return lengthInBits
}
+
func (m *BVLCOriginalUnicastNPDU) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
-func BVLCOriginalUnicastNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16) (*BVLC, error) {
+func BVLCOriginalUnicastNPDUParse(readBuffer utils.ReadBuffer, bvlcPayloadLength uint16) (*BVLC, error) {
if pullErr := readBuffer.PullContext("BVLCOriginalUnicastNPDU"); pullErr != nil {
return nil, pullErr
}
@@ -107,7 +109,7 @@ func BVLCOriginalUnicastNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16
if pullErr := readBuffer.PullContext("npdu"); pullErr != nil {
return nil, pullErr
}
- _npdu, _npduErr := NPDUParse(readBuffer, uint16(bvlcLength)-uint16(uint16(4)))
+_npdu, _npduErr := NPDUParse(readBuffer , bvlcPayloadLength )
if _npduErr != nil {
return nil, errors.Wrap(_npduErr, "Error parsing 'npdu' field")
}
@@ -123,7 +125,7 @@ func BVLCOriginalUnicastNPDUParse(readBuffer utils.ReadBuffer, bvlcLength uint16
// Create a partially initialized instance
_child := &BVLCOriginalUnicastNPDU{
Npdu: CastNPDU(npdu),
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -135,17 +137,17 @@ func (m *BVLCOriginalUnicastNPDU) Serialize(writeBuffer utils.WriteBuffer) error
return pushErr
}
- // Simple Field (npdu)
- if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
- return pushErr
- }
- _npduErr := m.Npdu.Serialize(writeBuffer)
- if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
- return popErr
- }
- if _npduErr != nil {
- return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
- }
+ // Simple Field (npdu)
+ if pushErr := writeBuffer.PushContext("npdu"); pushErr != nil {
+ return pushErr
+ }
+ _npduErr := m.Npdu.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("npdu"); popErr != nil {
+ return popErr
+ }
+ if _npduErr != nil {
+ return errors.Wrap(_npduErr, "Error serializing 'npdu' field")
+ }
if popErr := writeBuffer.PopContext("BVLCOriginalUnicastNPDU"); popErr != nil {
return popErr
@@ -163,3 +165,6 @@ func (m *BVLCOriginalUnicastNPDU) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTable.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTable.go
index d5c1ef8..63eb1eb 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTable.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTable.go
@@ -19,11 +19,13 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCReadBroadcastDistributionTable struct {
@@ -41,15 +43,14 @@ type IBVLCReadBroadcastDistributionTable interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCReadBroadcastDistributionTable) BvlcFunction() uint8 {
- return 0x02
-}
+return 0x02}
+
-func (m *BVLCReadBroadcastDistributionTable) InitializeParent(parent *BVLC) {
+func (m *BVLCReadBroadcastDistributionTable) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCReadBroadcastDistributionTable() *BVLC {
- child := &BVLCReadBroadcastDistributionTable{
- BVLC: NewBVLC(),
+func NewBVLCReadBroadcastDistributionTable( bvlcPayloadLength uint16 ) *BVLC { child := &BVLCReadBroadcastDistributionTable{
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -88,6 +89,7 @@ func (m *BVLCReadBroadcastDistributionTable) LengthInBitsConditional(lastItem bo
return lengthInBits
}
+
func (m *BVLCReadBroadcastDistributionTable) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -103,7 +105,7 @@ func BVLCReadBroadcastDistributionTableParse(readBuffer utils.ReadBuffer) (*BVLC
// Create a partially initialized instance
_child := &BVLCReadBroadcastDistributionTable{
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -131,3 +133,6 @@ func (m *BVLCReadBroadcastDistributionTable) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTableAck.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTableAck.go
index 70fa2c2..402528c 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTableAck.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadBroadcastDistributionTableAck.go
@@ -19,11 +19,13 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCReadBroadcastDistributionTableAck struct {
@@ -41,15 +43,14 @@ type IBVLCReadBroadcastDistributionTableAck interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCReadBroadcastDistributionTableAck) BvlcFunction() uint8 {
- return 0x03
-}
+return 0x03}
+
-func (m *BVLCReadBroadcastDistributionTableAck) InitializeParent(parent *BVLC) {
+func (m *BVLCReadBroadcastDistributionTableAck) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCReadBroadcastDistributionTableAck() *BVLC {
- child := &BVLCReadBroadcastDistributionTableAck{
- BVLC: NewBVLC(),
+func NewBVLCReadBroadcastDistributionTableAck( bvlcPayloadLength uint16 ) *BVLC { child := &BVLCReadBroadcastDistributionTableAck{
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -88,6 +89,7 @@ func (m *BVLCReadBroadcastDistributionTableAck) LengthInBitsConditional(lastItem
return lengthInBits
}
+
func (m *BVLCReadBroadcastDistributionTableAck) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -103,7 +105,7 @@ func BVLCReadBroadcastDistributionTableAckParse(readBuffer utils.ReadBuffer) (*B
// Create a partially initialized instance
_child := &BVLCReadBroadcastDistributionTableAck{
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -131,3 +133,6 @@ func (m *BVLCReadBroadcastDistributionTableAck) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTable.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTable.go
index 158a8a8..4d0df01 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTable.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTable.go
@@ -19,11 +19,13 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCReadForeignDeviceTable struct {
@@ -41,15 +43,14 @@ type IBVLCReadForeignDeviceTable interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCReadForeignDeviceTable) BvlcFunction() uint8 {
- return 0x06
-}
+return 0x06}
+
-func (m *BVLCReadForeignDeviceTable) InitializeParent(parent *BVLC) {
+func (m *BVLCReadForeignDeviceTable) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCReadForeignDeviceTable() *BVLC {
- child := &BVLCReadForeignDeviceTable{
- BVLC: NewBVLC(),
+func NewBVLCReadForeignDeviceTable( bvlcPayloadLength uint16 ) *BVLC { child := &BVLCReadForeignDeviceTable{
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -88,6 +89,7 @@ func (m *BVLCReadForeignDeviceTable) LengthInBitsConditional(lastItem bool) uint
return lengthInBits
}
+
func (m *BVLCReadForeignDeviceTable) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -103,7 +105,7 @@ func BVLCReadForeignDeviceTableParse(readBuffer utils.ReadBuffer) (*BVLC, error)
// Create a partially initialized instance
_child := &BVLCReadForeignDeviceTable{
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -131,3 +133,6 @@ func (m *BVLCReadForeignDeviceTable) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTableAck.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTableAck.go
index fac1255..a5f5559 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTableAck.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCReadForeignDeviceTableAck.go
@@ -19,11 +19,13 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCReadForeignDeviceTableAck struct {
@@ -41,15 +43,14 @@ type IBVLCReadForeignDeviceTableAck interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCReadForeignDeviceTableAck) BvlcFunction() uint8 {
- return 0x07
-}
+return 0x07}
+
-func (m *BVLCReadForeignDeviceTableAck) InitializeParent(parent *BVLC) {
+func (m *BVLCReadForeignDeviceTableAck) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCReadForeignDeviceTableAck() *BVLC {
- child := &BVLCReadForeignDeviceTableAck{
- BVLC: NewBVLC(),
+func NewBVLCReadForeignDeviceTableAck( bvlcPayloadLength uint16 ) *BVLC { child := &BVLCReadForeignDeviceTableAck{
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -88,6 +89,7 @@ func (m *BVLCReadForeignDeviceTableAck) LengthInBitsConditional(lastItem bool) u
return lengthInBits
}
+
func (m *BVLCReadForeignDeviceTableAck) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -103,7 +105,7 @@ func BVLCReadForeignDeviceTableAckParse(readBuffer utils.ReadBuffer) (*BVLC, err
// Create a partially initialized instance
_child := &BVLCReadForeignDeviceTableAck{
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -131,3 +133,6 @@ func (m *BVLCReadForeignDeviceTableAck) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go
index fc7c1d8..b70d598 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go
@@ -19,12 +19,14 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCRegisterForeignDevice struct {
@@ -43,16 +45,15 @@ type IBVLCRegisterForeignDevice interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCRegisterForeignDevice) BvlcFunction() uint8 {
- return 0x05
-}
+return 0x05}
-func (m *BVLCRegisterForeignDevice) InitializeParent(parent *BVLC) {
+
+func (m *BVLCRegisterForeignDevice) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCRegisterForeignDevice(ttl uint16) *BVLC {
- child := &BVLCRegisterForeignDevice{
- Ttl: ttl,
- BVLC: NewBVLC(),
+func NewBVLCRegisterForeignDevice( ttl uint16 , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCRegisterForeignDevice{
+ Ttl: ttl,
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -89,11 +90,12 @@ func (m *BVLCRegisterForeignDevice) LengthInBitsConditional(lastItem bool) uint1
lengthInBits := uint16(m.ParentLengthInBits())
// Simple field (ttl)
- lengthInBits += 16
+ lengthInBits += 16;
return lengthInBits
}
+
func (m *BVLCRegisterForeignDevice) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -104,7 +106,7 @@ func BVLCRegisterForeignDeviceParse(readBuffer utils.ReadBuffer) (*BVLC, error)
}
// Simple Field (ttl)
- _ttl, _ttlErr := readBuffer.ReadUint16("ttl", 16)
+_ttl, _ttlErr := readBuffer.ReadUint16("ttl", 16)
if _ttlErr != nil {
return nil, errors.Wrap(_ttlErr, "Error parsing 'ttl' field")
}
@@ -116,8 +118,8 @@ func BVLCRegisterForeignDeviceParse(readBuffer utils.ReadBuffer) (*BVLC, error)
// Create a partially initialized instance
_child := &BVLCRegisterForeignDevice{
- Ttl: ttl,
- BVLC: &BVLC{},
+ Ttl: ttl,
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -129,12 +131,12 @@ func (m *BVLCRegisterForeignDevice) Serialize(writeBuffer utils.WriteBuffer) err
return pushErr
}
- // Simple Field (ttl)
- ttl := uint16(m.Ttl)
- _ttlErr := writeBuffer.WriteUint16("ttl", 16, (ttl))
- if _ttlErr != nil {
- return errors.Wrap(_ttlErr, "Error serializing 'ttl' field")
- }
+ // Simple Field (ttl)
+ ttl := uint16(m.Ttl)
+ _ttlErr := writeBuffer.WriteUint16("ttl", 16, (ttl))
+ if _ttlErr != nil {
+ return errors.Wrap(_ttlErr, "Error serializing 'ttl' field")
+ }
if popErr := writeBuffer.PopContext("BVLCRegisterForeignDevice"); popErr != nil {
return popErr
@@ -152,3 +154,6 @@ func (m *BVLCRegisterForeignDevice) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCResult.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCResult.go
index 147b9d1..a859775 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCResult.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCResult.go
@@ -19,12 +19,14 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
"github.com/pkg/errors"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCResult struct {
@@ -43,16 +45,15 @@ type IBVLCResult interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCResult) BvlcFunction() uint8 {
- return 0x00
-}
+return 0x00}
-func (m *BVLCResult) InitializeParent(parent *BVLC) {
+
+func (m *BVLCResult) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCResult(code BVLCResultCode) *BVLC {
- child := &BVLCResult{
+func NewBVLCResult( code BVLCResultCode , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCResult{
Code: code,
- BVLC: NewBVLC(),
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -94,6 +95,7 @@ func (m *BVLCResult) LengthInBitsConditional(lastItem bool) uint16 {
return lengthInBits
}
+
func (m *BVLCResult) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -107,7 +109,7 @@ func BVLCResultParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
if pullErr := readBuffer.PullContext("code"); pullErr != nil {
return nil, pullErr
}
- _code, _codeErr := BVLCResultCodeParse(readBuffer)
+_code, _codeErr := BVLCResultCodeParse(readBuffer)
if _codeErr != nil {
return nil, errors.Wrap(_codeErr, "Error parsing 'code' field")
}
@@ -123,7 +125,7 @@ func BVLCResultParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
// Create a partially initialized instance
_child := &BVLCResult{
Code: code,
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -135,17 +137,17 @@ func (m *BVLCResult) Serialize(writeBuffer utils.WriteBuffer) error {
return pushErr
}
- // Simple Field (code)
- if pushErr := writeBuffer.PushContext("code"); pushErr != nil {
- return pushErr
- }
- _codeErr := m.Code.Serialize(writeBuffer)
- if popErr := writeBuffer.PopContext("code"); popErr != nil {
- return popErr
- }
- if _codeErr != nil {
- return errors.Wrap(_codeErr, "Error serializing 'code' field")
- }
+ // Simple Field (code)
+ if pushErr := writeBuffer.PushContext("code"); pushErr != nil {
+ return pushErr
+ }
+ _codeErr := m.Code.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("code"); popErr != nil {
+ return popErr
+ }
+ if _codeErr != nil {
+ return errors.Wrap(_codeErr, "Error serializing 'code' field")
+ }
if popErr := writeBuffer.PopContext("BVLCResult"); popErr != nil {
return popErr
@@ -163,3 +165,6 @@ func (m *BVLCResult) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCSecureBVLL.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCSecureBVLL.go
index c39b9c9..4514f03 100644
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCSecureBVLL.go
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCSecureBVLL.go
@@ -19,11 +19,13 @@
package model
+
import (
"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
)
-// Code generated by code-generation. DO NOT EDIT.
+ // Code generated by code-generation. DO NOT EDIT.
+
// The data-structure of this message
type BVLCSecureBVLL struct {
@@ -41,15 +43,14 @@ type IBVLCSecureBVLL interface {
// Accessors for discriminator values.
///////////////////////////////////////////////////////////
func (m *BVLCSecureBVLL) BvlcFunction() uint8 {
- return 0x0C
-}
+return 0x0C}
+
-func (m *BVLCSecureBVLL) InitializeParent(parent *BVLC) {
+func (m *BVLCSecureBVLL) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
}
-func NewBVLCSecureBVLL() *BVLC {
- child := &BVLCSecureBVLL{
- BVLC: NewBVLC(),
+func NewBVLCSecureBVLL( bvlcPayloadLength uint16 ) *BVLC { child := &BVLCSecureBVLL{
+ BVLC: NewBVLC(bvlcPayloadLength),
}
child.Child = child
return child.BVLC
@@ -88,6 +89,7 @@ func (m *BVLCSecureBVLL) LengthInBitsConditional(lastItem bool) uint16 {
return lengthInBits
}
+
func (m *BVLCSecureBVLL) LengthInBytes() uint16 {
return m.LengthInBits() / 8
}
@@ -103,7 +105,7 @@ func BVLCSecureBVLLParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
// Create a partially initialized instance
_child := &BVLCSecureBVLL{
- BVLC: &BVLC{},
+ BVLC: &BVLC{},
}
_child.BVLC.Child = _child
return _child.BVLC, nil
@@ -131,3 +133,6 @@ func (m *BVLCSecureBVLL) String() string {
m.Serialize(buffer)
return buffer.GetBox().String()
}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWideBroadcastDistributionTable.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWideBroadcastDistributionTable.go
deleted file mode 100644
index 855503f..0000000
--- a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWideBroadcastDistributionTable.go
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package model
-
-import (
- "github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
-)
-
-// Code generated by code-generation. DO NOT EDIT.
-
-// The data-structure of this message
-type BVLCWideBroadcastDistributionTable struct {
- *BVLC
-}
-
-// The corresponding interface
-type IBVLCWideBroadcastDistributionTable interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(writeBuffer utils.WriteBuffer) error
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *BVLCWideBroadcastDistributionTable) BvlcFunction() uint8 {
- return 0x01
-}
-
-func (m *BVLCWideBroadcastDistributionTable) InitializeParent(parent *BVLC) {
-}
-
-func NewBVLCWideBroadcastDistributionTable() *BVLC {
- child := &BVLCWideBroadcastDistributionTable{
- BVLC: NewBVLC(),
- }
- child.Child = child
- return child.BVLC
-}
-
-func CastBVLCWideBroadcastDistributionTable(structType interface{}) *BVLCWideBroadcastDistributionTable {
- castFunc := func(typ interface{}) *BVLCWideBroadcastDistributionTable {
- if casted, ok := typ.(BVLCWideBroadcastDistributionTable); ok {
- return &casted
- }
- if casted, ok := typ.(*BVLCWideBroadcastDistributionTable); ok {
- return casted
- }
- if casted, ok := typ.(BVLC); ok {
- return CastBVLCWideBroadcastDistributionTable(casted.Child)
- }
- if casted, ok := typ.(*BVLC); ok {
- return CastBVLCWideBroadcastDistributionTable(casted.Child)
- }
- return nil
- }
- return castFunc(structType)
-}
-
-func (m *BVLCWideBroadcastDistributionTable) GetTypeName() string {
- return "BVLCWideBroadcastDistributionTable"
-}
-
-func (m *BVLCWideBroadcastDistributionTable) LengthInBits() uint16 {
- return m.LengthInBitsConditional(false)
-}
-
-func (m *BVLCWideBroadcastDistributionTable) LengthInBitsConditional(lastItem bool) uint16 {
- lengthInBits := uint16(m.ParentLengthInBits())
-
- return lengthInBits
-}
-
-func (m *BVLCWideBroadcastDistributionTable) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func BVLCWideBroadcastDistributionTableParse(readBuffer utils.ReadBuffer) (*BVLC, error) {
- if pullErr := readBuffer.PullContext("BVLCWideBroadcastDistributionTable"); pullErr != nil {
- return nil, pullErr
- }
-
- if closeErr := readBuffer.CloseContext("BVLCWideBroadcastDistributionTable"); closeErr != nil {
- return nil, closeErr
- }
-
- // Create a partially initialized instance
- _child := &BVLCWideBroadcastDistributionTable{
- BVLC: &BVLC{},
- }
- _child.BVLC.Child = _child
- return _child.BVLC, nil
-}
-
-func (m *BVLCWideBroadcastDistributionTable) Serialize(writeBuffer utils.WriteBuffer) error {
- ser := func() error {
- if pushErr := writeBuffer.PushContext("BVLCWideBroadcastDistributionTable"); pushErr != nil {
- return pushErr
- }
-
- if popErr := writeBuffer.PopContext("BVLCWideBroadcastDistributionTable"); popErr != nil {
- return popErr
- }
- return nil
- }
- return m.SerializeParent(writeBuffer, m, ser)
-}
-
-func (m *BVLCWideBroadcastDistributionTable) String() string {
- if m == nil {
- return "<nil>"
- }
- buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
- m.Serialize(buffer)
- return buffer.GetBox().String()
-}
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWriteBroadcastDistributionTable.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWriteBroadcastDistributionTable.go
new file mode 100644
index 0000000..290fdd3
--- /dev/null
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWriteBroadcastDistributionTable.go
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package model
+
+
+import (
+ "github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
+ "github.com/pkg/errors"
+)
+
+ // Code generated by code-generation. DO NOT EDIT.
+
+
+// The data-structure of this message
+type BVLCWriteBroadcastDistributionTable struct {
+ *BVLC
+ Table []*BVLCWriteBroadcastDistributionTableEntry
+}
+
+// The corresponding interface
+type IBVLCWriteBroadcastDistributionTable interface {
+ LengthInBytes() uint16
+ LengthInBits() uint16
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+// Accessors for discriminator values.
+///////////////////////////////////////////////////////////
+func (m *BVLCWriteBroadcastDistributionTable) BvlcFunction() uint8 {
+return 0x01}
+
+
+func (m *BVLCWriteBroadcastDistributionTable) InitializeParent(parent *BVLCbvlcPayloadLength uint16) {
+}
+
+func NewBVLCWriteBroadcastDistributionTable( table []*BVLCWriteBroadcastDistributionTableEntry , bvlcPayloadLength uint16 ) *BVLC { child := &BVLCWriteBroadcastDistributionTable{
+ Table: table,
+ BVLC: NewBVLC(bvlcPayloadLength),
+ }
+ child.Child = child
+ return child.BVLC
+}
+
+func CastBVLCWriteBroadcastDistributionTable(structType interface{}) *BVLCWriteBroadcastDistributionTable {
+ castFunc := func(typ interface{}) *BVLCWriteBroadcastDistributionTable {
+ if casted, ok := typ.(BVLCWriteBroadcastDistributionTable); ok {
+ return &casted
+ }
+ if casted, ok := typ.(*BVLCWriteBroadcastDistributionTable); ok {
+ return casted
+ }
+ if casted, ok := typ.(BVLC); ok {
+ return CastBVLCWriteBroadcastDistributionTable(casted.Child)
+ }
+ if casted, ok := typ.(*BVLC); ok {
+ return CastBVLCWriteBroadcastDistributionTable(casted.Child)
+ }
+ return nil
+ }
+ return castFunc(structType)
+}
+
+func (m *BVLCWriteBroadcastDistributionTable) GetTypeName() string {
+ return "BVLCWriteBroadcastDistributionTable"
+}
+
+func (m *BVLCWriteBroadcastDistributionTable) LengthInBits() uint16 {
+ return m.LengthInBitsConditional(false)
+}
+
+func (m *BVLCWriteBroadcastDistributionTable) LengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.ParentLengthInBits())
+
+ // Array field
+ if len(m.Table) > 0 {
+ for _, element := range m.Table {
+ lengthInBits += element.LengthInBits()
+ }
+ }
+
+ return lengthInBits
+}
+
+
+func (m *BVLCWriteBroadcastDistributionTable) LengthInBytes() uint16 {
+ return m.LengthInBits() / 8
+}
+
+func BVLCWriteBroadcastDistributionTableParse(readBuffer utils.ReadBuffer, bvlcPayloadLength uint16) (*BVLC, error) {
+ if pullErr := readBuffer.PullContext("BVLCWriteBroadcastDistributionTable"); pullErr != nil {
+ return nil, pullErr
+ }
+
+ // Array field (table)
+ if pullErr := readBuffer.PullContext("table", utils.WithRenderAsList(true)); pullErr != nil {
+ return nil, pullErr
+ }
+ // Length array
+ table := make([]*BVLCWriteBroadcastDistributionTableEntry, 0)
+ {
+ _tableLength := bvlcPayloadLength
+ _tableEndPos := readBuffer.GetPos() + uint16(_tableLength)
+ for ;readBuffer.GetPos() < _tableEndPos; {
+ _item, _err := BVLCWriteBroadcastDistributionTableEntryParse(readBuffer)
+ if _err != nil {
+ return nil, errors.Wrap(_err, "Error parsing 'table' field")
+ }
+ table = append(table, _item)
+ }
+ }
+ if closeErr := readBuffer.CloseContext("table", utils.WithRenderAsList(true)); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BVLCWriteBroadcastDistributionTable"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BVLCWriteBroadcastDistributionTable{
+ Table: table,
+ BVLC: &BVLC{},
+ }
+ _child.BVLC.Child = _child
+ return _child.BVLC, nil
+}
+
+func (m *BVLCWriteBroadcastDistributionTable) Serialize(writeBuffer utils.WriteBuffer) error {
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BVLCWriteBroadcastDistributionTable"); pushErr != nil {
+ return pushErr
+ }
+
+ // Array Field (table)
+ if m.Table != nil {
+ if pushErr := writeBuffer.PushContext("table", utils.WithRenderAsList(true)); pushErr != nil {
+ return pushErr
+ }
+ for _, _element := range m.Table {
+ _elementErr := _element.Serialize(writeBuffer)
+ if _elementErr != nil {
+ return errors.Wrap(_elementErr, "Error serializing 'table' field")
+ }
+ }
+ if popErr := writeBuffer.PopContext("table", utils.WithRenderAsList(true)); popErr != nil {
+ return popErr
+ }
+ }
+
+ if popErr := writeBuffer.PopContext("BVLCWriteBroadcastDistributionTable"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BVLCWriteBroadcastDistributionTable) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ m.Serialize(buffer)
+ return buffer.GetBox().String()
+}
+
+
+
diff --git a/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWriteBroadcastDistributionTableEntry.go b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWriteBroadcastDistributionTableEntry.go
new file mode 100644
index 0000000..93a8d30
--- /dev/null
+++ b/plc4go/internal/plc4go/bacnetip/readwrite/model/BVLCWriteBroadcastDistributionTableEntry.go
@@ -0,0 +1,206 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package model
+
+import (
+ "github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// The data-structure of this message
+type BVLCWriteBroadcastDistributionTableEntry struct {
+ Ip []uint8
+ Port uint16
+ BroadcastDistributionMap []uint8
+}
+
+// The corresponding interface
+type IBVLCWriteBroadcastDistributionTableEntry interface {
+ LengthInBytes() uint16
+ LengthInBits() uint16
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+func NewBVLCWriteBroadcastDistributionTableEntry(ip []uint8, port uint16, broadcastDistributionMap []uint8) *BVLCWriteBroadcastDistributionTableEntry {
+ return &BVLCWriteBroadcastDistributionTableEntry{Ip: ip, Port: port, BroadcastDistributionMap: broadcastDistributionMap}
+}
+
+func CastBVLCWriteBroadcastDistributionTableEntry(structType interface{}) *BVLCWriteBroadcastDistributionTableEntry {
+ castFunc := func(typ interface{}) *BVLCWriteBroadcastDistributionTableEntry {
+ if casted, ok := typ.(BVLCWriteBroadcastDistributionTableEntry); ok {
+ return &casted
+ }
+ if casted, ok := typ.(*BVLCWriteBroadcastDistributionTableEntry); ok {
+ return casted
+ }
+ return nil
+ }
+ return castFunc(structType)
+}
+
+func (m *BVLCWriteBroadcastDistributionTableEntry) GetTypeName() string {
+ return "BVLCWriteBroadcastDistributionTableEntry"
+}
+
+func (m *BVLCWriteBroadcastDistributionTableEntry) LengthInBits() uint16 {
+ return m.LengthInBitsConditional(false)
+}
+
+func (m *BVLCWriteBroadcastDistributionTableEntry) LengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(0)
+
+ // Array field
+ if len(m.Ip) > 0 {
+ lengthInBits += 8 * uint16(len(m.Ip))
+ }
+
+ // Simple field (port)
+ lengthInBits += 16
+
+ // Array field
+ if len(m.BroadcastDistributionMap) > 0 {
+ lengthInBits += 8 * uint16(len(m.BroadcastDistributionMap))
+ }
+
+ return lengthInBits
+}
+
+func (m *BVLCWriteBroadcastDistributionTableEntry) LengthInBytes() uint16 {
+ return m.LengthInBits() / 8
+}
+
+func BVLCWriteBroadcastDistributionTableEntryParse(readBuffer utils.ReadBuffer) (*BVLCWriteBroadcastDistributionTableEntry, error) {
+ if pullErr := readBuffer.PullContext("BVLCWriteBroadcastDistributionTableEntry"); pullErr != nil {
+ return nil, pullErr
+ }
+
+ // Array field (ip)
+ if pullErr := readBuffer.PullContext("ip", utils.WithRenderAsList(true)); pullErr != nil {
+ return nil, pullErr
+ }
+ // Count array
+ ip := make([]uint8, uint16(4))
+ {
+ for curItem := uint16(0); curItem < uint16(uint16(4)); curItem++ {
+ _item, _err := readBuffer.ReadUint8("", 8)
+ if _err != nil {
+ return nil, errors.Wrap(_err, "Error parsing 'ip' field")
+ }
+ ip[curItem] = _item
+ }
+ }
+ if closeErr := readBuffer.CloseContext("ip", utils.WithRenderAsList(true)); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Simple Field (port)
+ _port, _portErr := readBuffer.ReadUint16("port", 16)
+ if _portErr != nil {
+ return nil, errors.Wrap(_portErr, "Error parsing 'port' field")
+ }
+ port := _port
+
+ // Array field (broadcastDistributionMap)
+ if pullErr := readBuffer.PullContext("broadcastDistributionMap", utils.WithRenderAsList(true)); pullErr != nil {
+ return nil, pullErr
+ }
+ // Count array
+ broadcastDistributionMap := make([]uint8, uint16(4))
+ {
+ for curItem := uint16(0); curItem < uint16(uint16(4)); curItem++ {
+ _item, _err := readBuffer.ReadUint8("", 8)
+ if _err != nil {
+ return nil, errors.Wrap(_err, "Error parsing 'broadcastDistributionMap' field")
+ }
+ broadcastDistributionMap[curItem] = _item
+ }
+ }
+ if closeErr := readBuffer.CloseContext("broadcastDistributionMap", utils.WithRenderAsList(true)); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BVLCWriteBroadcastDistributionTableEntry"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create the instance
+ return NewBVLCWriteBroadcastDistributionTableEntry(ip, port, broadcastDistributionMap), nil
+}
+
+func (m *BVLCWriteBroadcastDistributionTableEntry) Serialize(writeBuffer utils.WriteBuffer) error {
+ if pushErr := writeBuffer.PushContext("BVLCWriteBroadcastDistributionTableEntry"); pushErr != nil {
+ return pushErr
+ }
+
+ // Array Field (ip)
+ if m.Ip != nil {
+ if pushErr := writeBuffer.PushContext("ip", utils.WithRenderAsList(true)); pushErr != nil {
+ return pushErr
+ }
+ for _, _element := range m.Ip {
+ _elementErr := writeBuffer.WriteUint8("", 8, _element)
+ if _elementErr != nil {
+ return errors.Wrap(_elementErr, "Error serializing 'ip' field")
+ }
+ }
+ if popErr := writeBuffer.PopContext("ip", utils.WithRenderAsList(true)); popErr != nil {
+ return popErr
+ }
+ }
+
+ // Simple Field (port)
+ port := uint16(m.Port)
+ _portErr := writeBuffer.WriteUint16("port", 16, (port))
+ if _portErr != nil {
+ return errors.Wrap(_portErr, "Error serializing 'port' field")
+ }
+
+ // Array Field (broadcastDistributionMap)
+ if m.BroadcastDistributionMap != nil {
+ if pushErr := writeBuffer.PushContext("broadcastDistributionMap", utils.WithRenderAsList(true)); pushErr != nil {
+ return pushErr
+ }
+ for _, _element := range m.BroadcastDistributionMap {
+ _elementErr := writeBuffer.WriteUint8("", 8, _element)
+ if _elementErr != nil {
+ return errors.Wrap(_elementErr, "Error serializing 'broadcastDistributionMap' field")
+ }
+ }
+ if popErr := writeBuffer.PopContext("broadcastDistributionMap", utils.WithRenderAsList(true)); popErr != nil {
+ return popErr
+ }
+ }
+
+ if popErr := writeBuffer.PopContext("BVLCWriteBroadcastDistributionTableEntry"); popErr != nil {
+ return popErr
+ }
+ return nil
+}
+
+func (m *BVLCWriteBroadcastDistributionTableEntry) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ m.Serialize(buffer)
+ return buffer.GetBox().String()
+}
diff --git a/plc4go/internal/plc4go/modbus/fieldtype_string.go b/plc4go/internal/plc4go/modbus/fieldtype_string.go
index ec3ec50..4ef728b 100644
--- a/plc4go/internal/plc4go/modbus/fieldtype_string.go
+++ b/plc4go/internal/plc4go/modbus/fieldtype_string.go
@@ -1,20 +1,3 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
// Code generated by "stringer -type FieldType"; DO NOT EDIT.
package modbus
diff --git a/plc4go/internal/plc4go/s7/fieldtype_string.go b/plc4go/internal/plc4go/s7/fieldtype_string.go
index 3045fc1..02ae83f 100644
--- a/plc4go/internal/plc4go/s7/fieldtype_string.go
+++ b/plc4go/internal/plc4go/s7/fieldtype_string.go
@@ -1,20 +1,3 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
// Code generated by "stringer -type FieldType"; DO NOT EDIT.
package s7
diff --git a/plc4go/internal/plc4go/spi/testutils/steptype_string.go b/plc4go/internal/plc4go/spi/testutils/steptype_string.go
index c99ce3e..8506728 100644
--- a/plc4go/internal/plc4go/spi/testutils/steptype_string.go
+++ b/plc4go/internal/plc4go/spi/testutils/steptype_string.go
@@ -1,20 +1,3 @@
-// Licensed to Apache Software Foundation (ASF) under one or more contributor
-// license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright
-// ownership. Apache Software Foundation (ASF) licenses this file to you under
-// the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
// Code generated by "stringer -type StepType"; DO NOT EDIT.
package testutils
diff --git a/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java b/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java
index d6d8aae..2e64cd5 100644
--- a/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java
+++ b/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java
@@ -318,12 +318,11 @@ public class RandomPackagesTest {
return List.of(pcapEvaluator.parseEmAll());
}
- @Disabled("mostly llc so we don't use that here for now")
@TestFactory
@DisplayName("BBMD_Results")
Collection<DynamicNode> BBMD_Results() throws Exception {
- TestPcapEvaluator pcapEvaluator = pcapEvaluator("BBMD_Results.pcap");
- return null;
+ TestPcapEvaluator pcapEvaluator = pcapEvaluator("BBMD_Results.pcap", BACNET_BPF_FILTER);
+ return List.of(pcapEvaluator.parseEmAll());
}
@TestFactory
diff --git a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
index 1ee9069..63a7827 100644
--- a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
+++ b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
@@ -18,25 +18,29 @@
*/
[discriminatedType BVLC byteOrder='BIG_ENDIAN'
- [const uint 8 bacnetType 0x81 ]
- [discriminator uint 8 bvlcFunction ]
- [implicit uint 16 bvlcLength 'lengthInBytes']
+ [const uint 8 bacnetType 0x81 ]
+ [discriminator uint 8 bvlcFunction ]
+ [implicit uint 16 bvlcLength 'lengthInBytes' ]
+ [virtual uint 16 bvlcPayloadLength 'bvlcLength-4' ]
[typeSwitch bvlcFunction
['0x00' BVLCResult
[simple BVLCResultCode
code
]
]
- ['0x01' BVLCWideBroadcastDistributionTable
+ ['0x01' BVLCWriteBroadcastDistributionTable(uint 16 bvlcPayloadLength)
+ [array BVLCWriteBroadcastDistributionTableEntry
+ table
+ length 'bvlcPayloadLength' ]
]
['0x02' BVLCReadBroadcastDistributionTable
]
['0x03' BVLCReadBroadcastDistributionTableAck
]
- ['0x04' BVLCForwardedNPDU(uint 16 bvlcLength)
+ ['0x04' BVLCForwardedNPDU(uint 16 bvlcPayloadLength)
[array uint 8 ip count '4' ]
[simple uint 16 port ]
- [simple NPDU('bvlcLength - 10')
+ [simple NPDU('bvlcPayloadLength - 6')
npdu
]
]
@@ -49,18 +53,18 @@
]
['0x08' BVLCDeleteForeignDeviceTableEntry
]
- ['0x09' BVLCDistributeBroadcastToNetwork(uint 16 bvlcLength)
- [simple NPDU('bvlcLength - 4')
+ ['0x09' BVLCDistributeBroadcastToNetwork(uint 16 bvlcPayloadLength)
+ [simple NPDU('bvlcPayloadLength')
npdu
]
]
- ['0x0A' BVLCOriginalUnicastNPDU(uint 16 bvlcLength)
- [simple NPDU('bvlcLength - 4')
+ ['0x0A' BVLCOriginalUnicastNPDU(uint 16 bvlcPayloadLength)
+ [simple NPDU('bvlcPayloadLength')
npdu
]
]
- ['0x0B' BVLCOriginalBroadcastNPDU(uint 16 bvlcLength)
- [simple NPDU('bvlcLength - 4')
+ ['0x0B' BVLCOriginalBroadcastNPDU(uint 16 bvlcPayloadLength)
+ [simple NPDU('bvlcPayloadLength')
npdu
]
]
@@ -69,6 +73,12 @@
]
]
+[type BVLCWriteBroadcastDistributionTableEntry
+ [array uint 8 ip count '4' ]
+ [simple uint 16 port ]
+ [array uint 8 broadcastDistributionMap count '4' ]
+]
+
[type NPDU(uint 16 npduLength)
[simple uint 8 protocolVersionNumber]
[simple bit messageTypeFieldPresent]