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/06/07 08:30:19 UTC
[plc4x] branch develop updated: feat(bacnet): implemented unique properties for program type
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 c8276d559f feat(bacnet): implemented unique properties for program type
c8276d559f is described below
commit c8276d559fa8888ab24dbd059d0d495a6daa9890
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Jun 7 10:30:06 2022 +0200
feat(bacnet): implemented unique properties for program type
- DESCRIPTION_OF_HALT
- INSTANCE_OF
- PROGRAM_CHANGE
- PROGRAM_LOCATION
- PROGRAM_STATE
- REASON_FOR_HALT
---
.../readwrite/model/BACnetConstructedData.go | 12 ++
.../BACnetConstructedDataDescriptionOfHalt.go | 211 +++++++++++++++++++++
.../model/BACnetConstructedDataInstanceOf.go | 211 +++++++++++++++++++++
.../model/BACnetConstructedDataProgramChange.go | 211 +++++++++++++++++++++
.../model/BACnetConstructedDataProgramLocation.go | 211 +++++++++++++++++++++
.../model/BACnetConstructedDataProgramState.go | 211 +++++++++++++++++++++
.../model/BACnetConstructedDataReasonForHalt.go | 211 +++++++++++++++++++++
.../resources/protocols/bacnetip/bacnetip.mspec | 26 ++-
8 files changed, 1297 insertions(+), 7 deletions(-)
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go
index abb62e9ab9..d98a7f5e41 100644
--- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go
@@ -374,6 +374,8 @@ func BACnetConstructedDataParse(readBuffer utils.ReadBuffer, tagNumber uint8, ob
_child, typeSwitchError = BACnetConstructedDataDerivativeConstantUnitsParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_DESCRIPTION: // BACnetConstructedDataDescription
_child, typeSwitchError = BACnetConstructedDataDescriptionParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
+ case true && propertyIdentifierArgument == BACnetPropertyIdentifier_DESCRIPTION_OF_HALT: // BACnetConstructedDataDescriptionOfHalt
+ _child, typeSwitchError = BACnetConstructedDataDescriptionOfHaltParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_DEVICE_TYPE: // BACnetConstructedDataDeviceType
_child, typeSwitchError = BACnetConstructedDataDeviceTypeParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_DOOR_ALARM_STATE: // BACnetConstructedDataDoorAlarmState
@@ -432,6 +434,8 @@ func BACnetConstructedDataParse(readBuffer utils.ReadBuffer, tagNumber uint8, ob
_child, typeSwitchError = BACnetConstructedDataInitialTimeoutParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_INPUT_REFERENCE: // BACnetConstructedDataInputReference
_child, typeSwitchError = BACnetConstructedDataInputReferenceParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
+ case true && propertyIdentifierArgument == BACnetPropertyIdentifier_INSTANCE_OF: // BACnetConstructedDataInstanceOf
+ _child, typeSwitchError = BACnetConstructedDataInstanceOfParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_INTEGRAL_CONSTANT_UNITS: // BACnetConstructedDataIntegralConstantUnits
_child, typeSwitchError = BACnetConstructedDataIntegralConstantUnitsParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case objectTypeArgument == BACnetObjectType_ANALOG_INPUT && propertyIdentifierArgument == BACnetPropertyIdentifier_INTERFACE_VALUE: // BACnetConstructedDataAnalogInputInterfaceValue
@@ -524,12 +528,20 @@ func BACnetConstructedDataParse(readBuffer utils.ReadBuffer, tagNumber uint8, ob
_child, typeSwitchError = BACnetConstructedDataProfileLocationParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_PROFILE_NAME: // BACnetConstructedDataProfileName
_child, typeSwitchError = BACnetConstructedDataProfileNameParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
+ case true && propertyIdentifierArgument == BACnetPropertyIdentifier_PROGRAM_CHANGE: // BACnetConstructedDataProgramChange
+ _child, typeSwitchError = BACnetConstructedDataProgramChangeParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
+ case true && propertyIdentifierArgument == BACnetPropertyIdentifier_PROGRAM_LOCATION: // BACnetConstructedDataProgramLocation
+ _child, typeSwitchError = BACnetConstructedDataProgramLocationParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
+ case true && propertyIdentifierArgument == BACnetPropertyIdentifier_PROGRAM_STATE: // BACnetConstructedDataProgramState
+ _child, typeSwitchError = BACnetConstructedDataProgramStateParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_PROPERTY_LIST: // BACnetConstructedDataPropertyList
_child, typeSwitchError = BACnetConstructedDataPropertyListParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_PROPORTIONAL_CONSTANT_UNITS: // BACnetConstructedDataProportionalConstantUnits
_child, typeSwitchError = BACnetConstructedDataProportionalConstantUnitsParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_REASON_FOR_DISABLE: // BACnetConstructedDataReasonForDisable
_child, typeSwitchError = BACnetConstructedDataReasonForDisableParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
+ case true && propertyIdentifierArgument == BACnetPropertyIdentifier_REASON_FOR_HALT: // BACnetConstructedDataReasonForHalt
+ _child, typeSwitchError = BACnetConstructedDataReasonForHaltParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_RELIABILITY: // BACnetConstructedDataReliability
_child, typeSwitchError = BACnetConstructedDataReliabilityParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument)
case true && propertyIdentifierArgument == BACnetPropertyIdentifier_RELIABILITY_EVALUATION_INHIBIT: // BACnetConstructedDataReliabilityEvaluationInhibit
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataDescriptionOfHalt.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataDescriptionOfHalt.go
new file mode 100644
index 0000000000..5a6d91d12d
--- /dev/null
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataDescriptionOfHalt.go
@@ -0,0 +1,211 @@
+/*
+ * 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/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// BACnetConstructedDataDescriptionOfHalt is the data-structure of this message
+type BACnetConstructedDataDescriptionOfHalt struct {
+ *BACnetConstructedData
+ DescriptionForHalt *BACnetApplicationTagCharacterString
+
+ // Arguments.
+ TagNumber uint8
+}
+
+// IBACnetConstructedDataDescriptionOfHalt is the corresponding interface of BACnetConstructedDataDescriptionOfHalt
+type IBACnetConstructedDataDescriptionOfHalt interface {
+ IBACnetConstructedData
+ // GetDescriptionForHalt returns DescriptionForHalt (property field)
+ GetDescriptionForHalt() *BACnetApplicationTagCharacterString
+ // GetLengthInBytes returns the length in bytes
+ GetLengthInBytes() uint16
+ // GetLengthInBits returns the length in bits
+ GetLengthInBits() uint16
+ // Serialize serializes this type
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetObjectTypeArgument() BACnetObjectType {
+ return 0
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetPropertyIdentifierArgument() BACnetPropertyIdentifier {
+ return BACnetPropertyIdentifier_DESCRIPTION_OF_HALT
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *BACnetConstructedDataDescriptionOfHalt) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) {
+ m.BACnetConstructedData.OpeningTag = openingTag
+ m.BACnetConstructedData.ClosingTag = closingTag
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetParent() *BACnetConstructedData {
+ return m.BACnetConstructedData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetDescriptionForHalt() *BACnetApplicationTagCharacterString {
+ return m.DescriptionForHalt
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewBACnetConstructedDataDescriptionOfHalt factory function for BACnetConstructedDataDescriptionOfHalt
+func NewBACnetConstructedDataDescriptionOfHalt(descriptionForHalt *BACnetApplicationTagCharacterString, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataDescriptionOfHalt {
+ _result := &BACnetConstructedDataDescriptionOfHalt{
+ DescriptionForHalt: descriptionForHalt,
+ BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber),
+ }
+ _result.Child = _result
+ return _result
+}
+
+func CastBACnetConstructedDataDescriptionOfHalt(structType interface{}) *BACnetConstructedDataDescriptionOfHalt {
+ if casted, ok := structType.(BACnetConstructedDataDescriptionOfHalt); ok {
+ return &casted
+ }
+ if casted, ok := structType.(*BACnetConstructedDataDescriptionOfHalt); ok {
+ return casted
+ }
+ if casted, ok := structType.(BACnetConstructedData); ok {
+ return CastBACnetConstructedDataDescriptionOfHalt(casted.Child)
+ }
+ if casted, ok := structType.(*BACnetConstructedData); ok {
+ return CastBACnetConstructedDataDescriptionOfHalt(casted.Child)
+ }
+ return nil
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetTypeName() string {
+ return "BACnetConstructedDataDescriptionOfHalt"
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (descriptionForHalt)
+ lengthInBits += m.DescriptionForHalt.GetLengthInBits()
+
+ return lengthInBits
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func BACnetConstructedDataDescriptionOfHaltParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataDescriptionOfHalt, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("BACnetConstructedDataDescriptionOfHalt"); pullErr != nil {
+ return nil, pullErr
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (descriptionForHalt)
+ if pullErr := readBuffer.PullContext("descriptionForHalt"); pullErr != nil {
+ return nil, pullErr
+ }
+ _descriptionForHalt, _descriptionForHaltErr := BACnetApplicationTagParse(readBuffer)
+ if _descriptionForHaltErr != nil {
+ return nil, errors.Wrap(_descriptionForHaltErr, "Error parsing 'descriptionForHalt' field")
+ }
+ descriptionForHalt := CastBACnetApplicationTagCharacterString(_descriptionForHalt)
+ if closeErr := readBuffer.CloseContext("descriptionForHalt"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BACnetConstructedDataDescriptionOfHalt"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BACnetConstructedDataDescriptionOfHalt{
+ DescriptionForHalt: CastBACnetApplicationTagCharacterString(descriptionForHalt),
+ BACnetConstructedData: &BACnetConstructedData{},
+ }
+ _child.BACnetConstructedData.Child = _child
+ return _child, nil
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BACnetConstructedDataDescriptionOfHalt"); pushErr != nil {
+ return pushErr
+ }
+
+ // Simple Field (descriptionForHalt)
+ if pushErr := writeBuffer.PushContext("descriptionForHalt"); pushErr != nil {
+ return pushErr
+ }
+ _descriptionForHaltErr := m.DescriptionForHalt.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("descriptionForHalt"); popErr != nil {
+ return popErr
+ }
+ if _descriptionForHaltErr != nil {
+ return errors.Wrap(_descriptionForHaltErr, "Error serializing 'descriptionForHalt' field")
+ }
+
+ if popErr := writeBuffer.PopContext("BACnetConstructedDataDescriptionOfHalt"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BACnetConstructedDataDescriptionOfHalt) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := m.Serialize(buffer); err != nil {
+ return err.Error()
+ }
+ return buffer.GetBox().String()
+}
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataInstanceOf.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataInstanceOf.go
new file mode 100644
index 0000000000..84960ab52b
--- /dev/null
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataInstanceOf.go
@@ -0,0 +1,211 @@
+/*
+ * 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/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// BACnetConstructedDataInstanceOf is the data-structure of this message
+type BACnetConstructedDataInstanceOf struct {
+ *BACnetConstructedData
+ InstanceOf *BACnetApplicationTagCharacterString
+
+ // Arguments.
+ TagNumber uint8
+}
+
+// IBACnetConstructedDataInstanceOf is the corresponding interface of BACnetConstructedDataInstanceOf
+type IBACnetConstructedDataInstanceOf interface {
+ IBACnetConstructedData
+ // GetInstanceOf returns InstanceOf (property field)
+ GetInstanceOf() *BACnetApplicationTagCharacterString
+ // GetLengthInBytes returns the length in bytes
+ GetLengthInBytes() uint16
+ // GetLengthInBits returns the length in bits
+ GetLengthInBits() uint16
+ // Serialize serializes this type
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *BACnetConstructedDataInstanceOf) GetObjectTypeArgument() BACnetObjectType {
+ return 0
+}
+
+func (m *BACnetConstructedDataInstanceOf) GetPropertyIdentifierArgument() BACnetPropertyIdentifier {
+ return BACnetPropertyIdentifier_INSTANCE_OF
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *BACnetConstructedDataInstanceOf) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) {
+ m.BACnetConstructedData.OpeningTag = openingTag
+ m.BACnetConstructedData.ClosingTag = closingTag
+}
+
+func (m *BACnetConstructedDataInstanceOf) GetParent() *BACnetConstructedData {
+ return m.BACnetConstructedData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *BACnetConstructedDataInstanceOf) GetInstanceOf() *BACnetApplicationTagCharacterString {
+ return m.InstanceOf
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewBACnetConstructedDataInstanceOf factory function for BACnetConstructedDataInstanceOf
+func NewBACnetConstructedDataInstanceOf(instanceOf *BACnetApplicationTagCharacterString, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataInstanceOf {
+ _result := &BACnetConstructedDataInstanceOf{
+ InstanceOf: instanceOf,
+ BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber),
+ }
+ _result.Child = _result
+ return _result
+}
+
+func CastBACnetConstructedDataInstanceOf(structType interface{}) *BACnetConstructedDataInstanceOf {
+ if casted, ok := structType.(BACnetConstructedDataInstanceOf); ok {
+ return &casted
+ }
+ if casted, ok := structType.(*BACnetConstructedDataInstanceOf); ok {
+ return casted
+ }
+ if casted, ok := structType.(BACnetConstructedData); ok {
+ return CastBACnetConstructedDataInstanceOf(casted.Child)
+ }
+ if casted, ok := structType.(*BACnetConstructedData); ok {
+ return CastBACnetConstructedDataInstanceOf(casted.Child)
+ }
+ return nil
+}
+
+func (m *BACnetConstructedDataInstanceOf) GetTypeName() string {
+ return "BACnetConstructedDataInstanceOf"
+}
+
+func (m *BACnetConstructedDataInstanceOf) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *BACnetConstructedDataInstanceOf) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (instanceOf)
+ lengthInBits += m.InstanceOf.GetLengthInBits()
+
+ return lengthInBits
+}
+
+func (m *BACnetConstructedDataInstanceOf) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func BACnetConstructedDataInstanceOfParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataInstanceOf, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("BACnetConstructedDataInstanceOf"); pullErr != nil {
+ return nil, pullErr
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (instanceOf)
+ if pullErr := readBuffer.PullContext("instanceOf"); pullErr != nil {
+ return nil, pullErr
+ }
+ _instanceOf, _instanceOfErr := BACnetApplicationTagParse(readBuffer)
+ if _instanceOfErr != nil {
+ return nil, errors.Wrap(_instanceOfErr, "Error parsing 'instanceOf' field")
+ }
+ instanceOf := CastBACnetApplicationTagCharacterString(_instanceOf)
+ if closeErr := readBuffer.CloseContext("instanceOf"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BACnetConstructedDataInstanceOf"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BACnetConstructedDataInstanceOf{
+ InstanceOf: CastBACnetApplicationTagCharacterString(instanceOf),
+ BACnetConstructedData: &BACnetConstructedData{},
+ }
+ _child.BACnetConstructedData.Child = _child
+ return _child, nil
+}
+
+func (m *BACnetConstructedDataInstanceOf) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BACnetConstructedDataInstanceOf"); pushErr != nil {
+ return pushErr
+ }
+
+ // Simple Field (instanceOf)
+ if pushErr := writeBuffer.PushContext("instanceOf"); pushErr != nil {
+ return pushErr
+ }
+ _instanceOfErr := m.InstanceOf.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("instanceOf"); popErr != nil {
+ return popErr
+ }
+ if _instanceOfErr != nil {
+ return errors.Wrap(_instanceOfErr, "Error serializing 'instanceOf' field")
+ }
+
+ if popErr := writeBuffer.PopContext("BACnetConstructedDataInstanceOf"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BACnetConstructedDataInstanceOf) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := m.Serialize(buffer); err != nil {
+ return err.Error()
+ }
+ return buffer.GetBox().String()
+}
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramChange.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramChange.go
new file mode 100644
index 0000000000..58933f7e36
--- /dev/null
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramChange.go
@@ -0,0 +1,211 @@
+/*
+ * 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/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// BACnetConstructedDataProgramChange is the data-structure of this message
+type BACnetConstructedDataProgramChange struct {
+ *BACnetConstructedData
+ ProgramChange *BACnetProgramRequestTagged
+
+ // Arguments.
+ TagNumber uint8
+}
+
+// IBACnetConstructedDataProgramChange is the corresponding interface of BACnetConstructedDataProgramChange
+type IBACnetConstructedDataProgramChange interface {
+ IBACnetConstructedData
+ // GetProgramChange returns ProgramChange (property field)
+ GetProgramChange() *BACnetProgramRequestTagged
+ // GetLengthInBytes returns the length in bytes
+ GetLengthInBytes() uint16
+ // GetLengthInBits returns the length in bits
+ GetLengthInBits() uint16
+ // Serialize serializes this type
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *BACnetConstructedDataProgramChange) GetObjectTypeArgument() BACnetObjectType {
+ return 0
+}
+
+func (m *BACnetConstructedDataProgramChange) GetPropertyIdentifierArgument() BACnetPropertyIdentifier {
+ return BACnetPropertyIdentifier_PROGRAM_CHANGE
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *BACnetConstructedDataProgramChange) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) {
+ m.BACnetConstructedData.OpeningTag = openingTag
+ m.BACnetConstructedData.ClosingTag = closingTag
+}
+
+func (m *BACnetConstructedDataProgramChange) GetParent() *BACnetConstructedData {
+ return m.BACnetConstructedData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *BACnetConstructedDataProgramChange) GetProgramChange() *BACnetProgramRequestTagged {
+ return m.ProgramChange
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewBACnetConstructedDataProgramChange factory function for BACnetConstructedDataProgramChange
+func NewBACnetConstructedDataProgramChange(programChange *BACnetProgramRequestTagged, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataProgramChange {
+ _result := &BACnetConstructedDataProgramChange{
+ ProgramChange: programChange,
+ BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber),
+ }
+ _result.Child = _result
+ return _result
+}
+
+func CastBACnetConstructedDataProgramChange(structType interface{}) *BACnetConstructedDataProgramChange {
+ if casted, ok := structType.(BACnetConstructedDataProgramChange); ok {
+ return &casted
+ }
+ if casted, ok := structType.(*BACnetConstructedDataProgramChange); ok {
+ return casted
+ }
+ if casted, ok := structType.(BACnetConstructedData); ok {
+ return CastBACnetConstructedDataProgramChange(casted.Child)
+ }
+ if casted, ok := structType.(*BACnetConstructedData); ok {
+ return CastBACnetConstructedDataProgramChange(casted.Child)
+ }
+ return nil
+}
+
+func (m *BACnetConstructedDataProgramChange) GetTypeName() string {
+ return "BACnetConstructedDataProgramChange"
+}
+
+func (m *BACnetConstructedDataProgramChange) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *BACnetConstructedDataProgramChange) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (programChange)
+ lengthInBits += m.ProgramChange.GetLengthInBits()
+
+ return lengthInBits
+}
+
+func (m *BACnetConstructedDataProgramChange) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func BACnetConstructedDataProgramChangeParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataProgramChange, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("BACnetConstructedDataProgramChange"); pullErr != nil {
+ return nil, pullErr
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (programChange)
+ if pullErr := readBuffer.PullContext("programChange"); pullErr != nil {
+ return nil, pullErr
+ }
+ _programChange, _programChangeErr := BACnetProgramRequestTaggedParse(readBuffer, uint8(uint8(0)), TagClass(TagClass_APPLICATION_TAGS))
+ if _programChangeErr != nil {
+ return nil, errors.Wrap(_programChangeErr, "Error parsing 'programChange' field")
+ }
+ programChange := CastBACnetProgramRequestTagged(_programChange)
+ if closeErr := readBuffer.CloseContext("programChange"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BACnetConstructedDataProgramChange"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BACnetConstructedDataProgramChange{
+ ProgramChange: CastBACnetProgramRequestTagged(programChange),
+ BACnetConstructedData: &BACnetConstructedData{},
+ }
+ _child.BACnetConstructedData.Child = _child
+ return _child, nil
+}
+
+func (m *BACnetConstructedDataProgramChange) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BACnetConstructedDataProgramChange"); pushErr != nil {
+ return pushErr
+ }
+
+ // Simple Field (programChange)
+ if pushErr := writeBuffer.PushContext("programChange"); pushErr != nil {
+ return pushErr
+ }
+ _programChangeErr := m.ProgramChange.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("programChange"); popErr != nil {
+ return popErr
+ }
+ if _programChangeErr != nil {
+ return errors.Wrap(_programChangeErr, "Error serializing 'programChange' field")
+ }
+
+ if popErr := writeBuffer.PopContext("BACnetConstructedDataProgramChange"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BACnetConstructedDataProgramChange) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := m.Serialize(buffer); err != nil {
+ return err.Error()
+ }
+ return buffer.GetBox().String()
+}
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramLocation.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramLocation.go
new file mode 100644
index 0000000000..69403544fc
--- /dev/null
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramLocation.go
@@ -0,0 +1,211 @@
+/*
+ * 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/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// BACnetConstructedDataProgramLocation is the data-structure of this message
+type BACnetConstructedDataProgramLocation struct {
+ *BACnetConstructedData
+ ProgramLocation *BACnetApplicationTagCharacterString
+
+ // Arguments.
+ TagNumber uint8
+}
+
+// IBACnetConstructedDataProgramLocation is the corresponding interface of BACnetConstructedDataProgramLocation
+type IBACnetConstructedDataProgramLocation interface {
+ IBACnetConstructedData
+ // GetProgramLocation returns ProgramLocation (property field)
+ GetProgramLocation() *BACnetApplicationTagCharacterString
+ // GetLengthInBytes returns the length in bytes
+ GetLengthInBytes() uint16
+ // GetLengthInBits returns the length in bits
+ GetLengthInBits() uint16
+ // Serialize serializes this type
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *BACnetConstructedDataProgramLocation) GetObjectTypeArgument() BACnetObjectType {
+ return 0
+}
+
+func (m *BACnetConstructedDataProgramLocation) GetPropertyIdentifierArgument() BACnetPropertyIdentifier {
+ return BACnetPropertyIdentifier_PROGRAM_LOCATION
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *BACnetConstructedDataProgramLocation) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) {
+ m.BACnetConstructedData.OpeningTag = openingTag
+ m.BACnetConstructedData.ClosingTag = closingTag
+}
+
+func (m *BACnetConstructedDataProgramLocation) GetParent() *BACnetConstructedData {
+ return m.BACnetConstructedData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *BACnetConstructedDataProgramLocation) GetProgramLocation() *BACnetApplicationTagCharacterString {
+ return m.ProgramLocation
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewBACnetConstructedDataProgramLocation factory function for BACnetConstructedDataProgramLocation
+func NewBACnetConstructedDataProgramLocation(programLocation *BACnetApplicationTagCharacterString, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataProgramLocation {
+ _result := &BACnetConstructedDataProgramLocation{
+ ProgramLocation: programLocation,
+ BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber),
+ }
+ _result.Child = _result
+ return _result
+}
+
+func CastBACnetConstructedDataProgramLocation(structType interface{}) *BACnetConstructedDataProgramLocation {
+ if casted, ok := structType.(BACnetConstructedDataProgramLocation); ok {
+ return &casted
+ }
+ if casted, ok := structType.(*BACnetConstructedDataProgramLocation); ok {
+ return casted
+ }
+ if casted, ok := structType.(BACnetConstructedData); ok {
+ return CastBACnetConstructedDataProgramLocation(casted.Child)
+ }
+ if casted, ok := structType.(*BACnetConstructedData); ok {
+ return CastBACnetConstructedDataProgramLocation(casted.Child)
+ }
+ return nil
+}
+
+func (m *BACnetConstructedDataProgramLocation) GetTypeName() string {
+ return "BACnetConstructedDataProgramLocation"
+}
+
+func (m *BACnetConstructedDataProgramLocation) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *BACnetConstructedDataProgramLocation) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (programLocation)
+ lengthInBits += m.ProgramLocation.GetLengthInBits()
+
+ return lengthInBits
+}
+
+func (m *BACnetConstructedDataProgramLocation) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func BACnetConstructedDataProgramLocationParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataProgramLocation, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("BACnetConstructedDataProgramLocation"); pullErr != nil {
+ return nil, pullErr
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (programLocation)
+ if pullErr := readBuffer.PullContext("programLocation"); pullErr != nil {
+ return nil, pullErr
+ }
+ _programLocation, _programLocationErr := BACnetApplicationTagParse(readBuffer)
+ if _programLocationErr != nil {
+ return nil, errors.Wrap(_programLocationErr, "Error parsing 'programLocation' field")
+ }
+ programLocation := CastBACnetApplicationTagCharacterString(_programLocation)
+ if closeErr := readBuffer.CloseContext("programLocation"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BACnetConstructedDataProgramLocation"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BACnetConstructedDataProgramLocation{
+ ProgramLocation: CastBACnetApplicationTagCharacterString(programLocation),
+ BACnetConstructedData: &BACnetConstructedData{},
+ }
+ _child.BACnetConstructedData.Child = _child
+ return _child, nil
+}
+
+func (m *BACnetConstructedDataProgramLocation) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BACnetConstructedDataProgramLocation"); pushErr != nil {
+ return pushErr
+ }
+
+ // Simple Field (programLocation)
+ if pushErr := writeBuffer.PushContext("programLocation"); pushErr != nil {
+ return pushErr
+ }
+ _programLocationErr := m.ProgramLocation.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("programLocation"); popErr != nil {
+ return popErr
+ }
+ if _programLocationErr != nil {
+ return errors.Wrap(_programLocationErr, "Error serializing 'programLocation' field")
+ }
+
+ if popErr := writeBuffer.PopContext("BACnetConstructedDataProgramLocation"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BACnetConstructedDataProgramLocation) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := m.Serialize(buffer); err != nil {
+ return err.Error()
+ }
+ return buffer.GetBox().String()
+}
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramState.go
new file mode 100644
index 0000000000..8b55416836
--- /dev/null
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataProgramState.go
@@ -0,0 +1,211 @@
+/*
+ * 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/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// BACnetConstructedDataProgramState is the data-structure of this message
+type BACnetConstructedDataProgramState struct {
+ *BACnetConstructedData
+ ProgramState *BACnetProgramStateTagged
+
+ // Arguments.
+ TagNumber uint8
+}
+
+// IBACnetConstructedDataProgramState is the corresponding interface of BACnetConstructedDataProgramState
+type IBACnetConstructedDataProgramState interface {
+ IBACnetConstructedData
+ // GetProgramState returns ProgramState (property field)
+ GetProgramState() *BACnetProgramStateTagged
+ // GetLengthInBytes returns the length in bytes
+ GetLengthInBytes() uint16
+ // GetLengthInBits returns the length in bits
+ GetLengthInBits() uint16
+ // Serialize serializes this type
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *BACnetConstructedDataProgramState) GetObjectTypeArgument() BACnetObjectType {
+ return 0
+}
+
+func (m *BACnetConstructedDataProgramState) GetPropertyIdentifierArgument() BACnetPropertyIdentifier {
+ return BACnetPropertyIdentifier_PROGRAM_STATE
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *BACnetConstructedDataProgramState) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) {
+ m.BACnetConstructedData.OpeningTag = openingTag
+ m.BACnetConstructedData.ClosingTag = closingTag
+}
+
+func (m *BACnetConstructedDataProgramState) GetParent() *BACnetConstructedData {
+ return m.BACnetConstructedData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *BACnetConstructedDataProgramState) GetProgramState() *BACnetProgramStateTagged {
+ return m.ProgramState
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewBACnetConstructedDataProgramState factory function for BACnetConstructedDataProgramState
+func NewBACnetConstructedDataProgramState(programState *BACnetProgramStateTagged, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataProgramState {
+ _result := &BACnetConstructedDataProgramState{
+ ProgramState: programState,
+ BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber),
+ }
+ _result.Child = _result
+ return _result
+}
+
+func CastBACnetConstructedDataProgramState(structType interface{}) *BACnetConstructedDataProgramState {
+ if casted, ok := structType.(BACnetConstructedDataProgramState); ok {
+ return &casted
+ }
+ if casted, ok := structType.(*BACnetConstructedDataProgramState); ok {
+ return casted
+ }
+ if casted, ok := structType.(BACnetConstructedData); ok {
+ return CastBACnetConstructedDataProgramState(casted.Child)
+ }
+ if casted, ok := structType.(*BACnetConstructedData); ok {
+ return CastBACnetConstructedDataProgramState(casted.Child)
+ }
+ return nil
+}
+
+func (m *BACnetConstructedDataProgramState) GetTypeName() string {
+ return "BACnetConstructedDataProgramState"
+}
+
+func (m *BACnetConstructedDataProgramState) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *BACnetConstructedDataProgramState) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (programState)
+ lengthInBits += m.ProgramState.GetLengthInBits()
+
+ return lengthInBits
+}
+
+func (m *BACnetConstructedDataProgramState) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func BACnetConstructedDataProgramStateParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataProgramState, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("BACnetConstructedDataProgramState"); pullErr != nil {
+ return nil, pullErr
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (programState)
+ if pullErr := readBuffer.PullContext("programState"); pullErr != nil {
+ return nil, pullErr
+ }
+ _programState, _programStateErr := BACnetProgramStateTaggedParse(readBuffer, uint8(uint8(0)), TagClass(TagClass_APPLICATION_TAGS))
+ if _programStateErr != nil {
+ return nil, errors.Wrap(_programStateErr, "Error parsing 'programState' field")
+ }
+ programState := CastBACnetProgramStateTagged(_programState)
+ if closeErr := readBuffer.CloseContext("programState"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BACnetConstructedDataProgramState"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BACnetConstructedDataProgramState{
+ ProgramState: CastBACnetProgramStateTagged(programState),
+ BACnetConstructedData: &BACnetConstructedData{},
+ }
+ _child.BACnetConstructedData.Child = _child
+ return _child, nil
+}
+
+func (m *BACnetConstructedDataProgramState) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BACnetConstructedDataProgramState"); pushErr != nil {
+ return pushErr
+ }
+
+ // Simple Field (programState)
+ if pushErr := writeBuffer.PushContext("programState"); pushErr != nil {
+ return pushErr
+ }
+ _programStateErr := m.ProgramState.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("programState"); popErr != nil {
+ return popErr
+ }
+ if _programStateErr != nil {
+ return errors.Wrap(_programStateErr, "Error serializing 'programState' field")
+ }
+
+ if popErr := writeBuffer.PopContext("BACnetConstructedDataProgramState"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BACnetConstructedDataProgramState) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := m.Serialize(buffer); err != nil {
+ return err.Error()
+ }
+ return buffer.GetBox().String()
+}
diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataReasonForHalt.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataReasonForHalt.go
new file mode 100644
index 0000000000..bd1a7cc1ce
--- /dev/null
+++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataReasonForHalt.go
@@ -0,0 +1,211 @@
+/*
+ * 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/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// BACnetConstructedDataReasonForHalt is the data-structure of this message
+type BACnetConstructedDataReasonForHalt struct {
+ *BACnetConstructedData
+ ProgramError *BACnetProgramErrorTagged
+
+ // Arguments.
+ TagNumber uint8
+}
+
+// IBACnetConstructedDataReasonForHalt is the corresponding interface of BACnetConstructedDataReasonForHalt
+type IBACnetConstructedDataReasonForHalt interface {
+ IBACnetConstructedData
+ // GetProgramError returns ProgramError (property field)
+ GetProgramError() *BACnetProgramErrorTagged
+ // GetLengthInBytes returns the length in bytes
+ GetLengthInBytes() uint16
+ // GetLengthInBits returns the length in bits
+ GetLengthInBits() uint16
+ // Serialize serializes this type
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *BACnetConstructedDataReasonForHalt) GetObjectTypeArgument() BACnetObjectType {
+ return 0
+}
+
+func (m *BACnetConstructedDataReasonForHalt) GetPropertyIdentifierArgument() BACnetPropertyIdentifier {
+ return BACnetPropertyIdentifier_REASON_FOR_HALT
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *BACnetConstructedDataReasonForHalt) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) {
+ m.BACnetConstructedData.OpeningTag = openingTag
+ m.BACnetConstructedData.ClosingTag = closingTag
+}
+
+func (m *BACnetConstructedDataReasonForHalt) GetParent() *BACnetConstructedData {
+ return m.BACnetConstructedData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *BACnetConstructedDataReasonForHalt) GetProgramError() *BACnetProgramErrorTagged {
+ return m.ProgramError
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewBACnetConstructedDataReasonForHalt factory function for BACnetConstructedDataReasonForHalt
+func NewBACnetConstructedDataReasonForHalt(programError *BACnetProgramErrorTagged, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataReasonForHalt {
+ _result := &BACnetConstructedDataReasonForHalt{
+ ProgramError: programError,
+ BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber),
+ }
+ _result.Child = _result
+ return _result
+}
+
+func CastBACnetConstructedDataReasonForHalt(structType interface{}) *BACnetConstructedDataReasonForHalt {
+ if casted, ok := structType.(BACnetConstructedDataReasonForHalt); ok {
+ return &casted
+ }
+ if casted, ok := structType.(*BACnetConstructedDataReasonForHalt); ok {
+ return casted
+ }
+ if casted, ok := structType.(BACnetConstructedData); ok {
+ return CastBACnetConstructedDataReasonForHalt(casted.Child)
+ }
+ if casted, ok := structType.(*BACnetConstructedData); ok {
+ return CastBACnetConstructedDataReasonForHalt(casted.Child)
+ }
+ return nil
+}
+
+func (m *BACnetConstructedDataReasonForHalt) GetTypeName() string {
+ return "BACnetConstructedDataReasonForHalt"
+}
+
+func (m *BACnetConstructedDataReasonForHalt) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *BACnetConstructedDataReasonForHalt) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (programError)
+ lengthInBits += m.ProgramError.GetLengthInBits()
+
+ return lengthInBits
+}
+
+func (m *BACnetConstructedDataReasonForHalt) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func BACnetConstructedDataReasonForHaltParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataReasonForHalt, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("BACnetConstructedDataReasonForHalt"); pullErr != nil {
+ return nil, pullErr
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (programError)
+ if pullErr := readBuffer.PullContext("programError"); pullErr != nil {
+ return nil, pullErr
+ }
+ _programError, _programErrorErr := BACnetProgramErrorTaggedParse(readBuffer, uint8(uint8(0)), TagClass(TagClass_APPLICATION_TAGS))
+ if _programErrorErr != nil {
+ return nil, errors.Wrap(_programErrorErr, "Error parsing 'programError' field")
+ }
+ programError := CastBACnetProgramErrorTagged(_programError)
+ if closeErr := readBuffer.CloseContext("programError"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ if closeErr := readBuffer.CloseContext("BACnetConstructedDataReasonForHalt"); closeErr != nil {
+ return nil, closeErr
+ }
+
+ // Create a partially initialized instance
+ _child := &BACnetConstructedDataReasonForHalt{
+ ProgramError: CastBACnetProgramErrorTagged(programError),
+ BACnetConstructedData: &BACnetConstructedData{},
+ }
+ _child.BACnetConstructedData.Child = _child
+ return _child, nil
+}
+
+func (m *BACnetConstructedDataReasonForHalt) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("BACnetConstructedDataReasonForHalt"); pushErr != nil {
+ return pushErr
+ }
+
+ // Simple Field (programError)
+ if pushErr := writeBuffer.PushContext("programError"); pushErr != nil {
+ return pushErr
+ }
+ _programErrorErr := m.ProgramError.Serialize(writeBuffer)
+ if popErr := writeBuffer.PopContext("programError"); popErr != nil {
+ return popErr
+ }
+ if _programErrorErr != nil {
+ return errors.Wrap(_programErrorErr, "Error serializing 'programError' field")
+ }
+
+ if popErr := writeBuffer.PopContext("BACnetConstructedDataReasonForHalt"); popErr != nil {
+ return popErr
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *BACnetConstructedDataReasonForHalt) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ buffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := m.Serialize(buffer); err != nil {
+ return err.Error()
+ }
+ return buffer.GetBox().String()
+}
diff --git a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
index 597befda84..eac1397c85 100644
--- a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
+++ b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
@@ -2726,9 +2726,11 @@
[simple BACnetEngineeringUnitsTagged('0', 'TagClass.APPLICATION_TAGS') units ]
]
[*, 'DESCRIPTION' BACnetConstructedDataDescription
- [simple BACnetApplicationTagCharacterString description]
+ [simple BACnetApplicationTagCharacterString description ]
+ ]
+ [*, 'DESCRIPTION_OF_HALT' BACnetConstructedDataDescriptionOfHalt
+ [simple BACnetApplicationTagCharacterString descriptionForHalt ]
]
- //[*, 'DESCRIPTION_OF_HALT' BACnetConstructedDataDescriptionOfHalt [validation '1 == 2' "TODO: implement me DESCRIPTION_OF_HALT BACnetConstructedDataDescriptionOfHalt"]]
//[*, 'DEVICE_ADDRESS_BINDING' BACnetConstructedDataDeviceAddressBinding [validation '1 == 2' "TODO: implement me DEVICE_ADDRESS_BINDING BACnetConstructedDataDeviceAddressBinding"]]
[*, 'DEVICE_TYPE' BACnetConstructedDataDeviceType
[simple BACnetApplicationTagCharacterString deviceType ]
@@ -2874,7 +2876,9 @@
[simple BACnetObjectPropertyReference inputReference ]
]
//[*, 'INSTALLATION_ID' BACnetConstructedDataInstallationId [validation '1 == 2' "TODO: implement me INSTALLATION_ID BACnetConstructedDataInstallationId"]]
- //[*, 'INSTANCE_OF' BACnetConstructedDataInstanceOf [validation '1 == 2' "TODO: implement me INSTANCE_OF BACnetConstructedDataInstanceOf"]]
+ [*, 'INSTANCE_OF' BACnetConstructedDataInstanceOf
+ [simple BACnetApplicationTagCharacterString instanceOf ]
+ ]
//[*, 'INSTANTANEOUS_POWER' BACnetConstructedDataInstantaneousPower [validation '1 == 2' "TODO: implement me INSTANTANEOUS_POWER BACnetConstructedDataInstantaneousPower"]]
//[*, 'INTEGRAL_CONSTANT' BACnetConstructedDataIntegralConstant [validation '1 == 2' "TODO: implement me INTEGRAL_CONSTANT BACnetConstructedDataIntegralConstant"]]
[*, 'INTEGRAL_CONSTANT_UNITS' BACnetConstructedDataIntegralConstantUnits
@@ -3143,9 +3147,15 @@
[*, 'PROFILE_NAME' BACnetConstructedDataProfileName
[simple BACnetApplicationTagCharacterString profileName ]
]
- //[*, 'PROGRAM_CHANGE' BACnetConstructedDataProgramChange [validation '1 == 2' "TODO: implement me PROGRAM_CHANGE BACnetConstructedDataProgramChange"]]
- //[*, 'PROGRAM_LOCATION' BACnetConstructedDataProgramLocation [validation '1 == 2' "TODO: implement me PROGRAM_LOCATION BACnetConstructedDataProgramLocation"]]
- //[*, 'PROGRAM_STATE' BACnetConstructedDataProgramState [validation '1 == 2' "TODO: implement me PROGRAM_STATE BACnetConstructedDataProgramState"]]
+ [*, 'PROGRAM_CHANGE' BACnetConstructedDataProgramChange
+ [simple BACnetProgramRequestTagged('0', 'TagClass.APPLICATION_TAGS') programChange ]
+ ]
+ [*, 'PROGRAM_LOCATION' BACnetConstructedDataProgramLocation
+ [simple BACnetApplicationTagCharacterString programLocation ]
+ ]
+ [*, 'PROGRAM_STATE' BACnetConstructedDataProgramState
+ [simple BACnetProgramStateTagged('0', 'TagClass.APPLICATION_TAGS') programState ]
+ ]
[*, 'PROPERTY_LIST' BACnetConstructedDataPropertyList
[array BACnetPropertyIdentifierTagged('0', 'TagClass.APPLICATION_TAGS')
propertyList
@@ -3170,7 +3180,9 @@
terminated
'STATIC_CALL("isBACnetConstructedDataClosingTag", readBuffer, false, tagNumber)' ]
]
- //[*, 'REASON_FOR_HALT' BACnetConstructedDataReasonForHalt [validation '1 == 2' "TODO: implement me REASON_FOR_HALT BACnetConstructedDataReasonForHalt"]]
+ [*, 'REASON_FOR_HALT' BACnetConstructedDataReasonForHalt
+ [simple BACnetProgramErrorTagged('0', 'TagClass.APPLICATION_TAGS') programError ]
+ ]
//[*, 'RECIPIENT_LIST' BACnetConstructedDataRecipientList [validation '1 == 2' "TODO: implement me RECIPIENT_LIST BACnetConstructedDataRecipientList"]]
//[*, 'RECORD_COUNT' BACnetConstructedDataRecordCount [validation '1 == 2' "TODO: implement me RECORD_COUNT BACnetConstructedDataRecordCount"]]
//[*, 'RECORDS_SINCE_NOTIFICATION' BACnetConstructedDataRecordsSinceNotification [validation '1 == 2' "TODO: implement me RECORDS_SINCE_NOTIFICATION BACnetConstructedDataRecordsSinceNotification"]]