You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/11/09 12:11:49 UTC
[plc4x] 01/04: - Deleted the files in model in order to replace
them with ones with different case name
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/plc4go
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit ef3dd71654154747696de1cb6fa984e33194197f
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Sun Nov 8 12:50:48 2020 +0100
- Deleted the files in model in order to replace them with ones with different case name
---
.../plc4go/knxnetip/readwrite/model/APCI.go | 114 -
.../plc4go/knxnetip/readwrite/model/CEMI.go | 328 --
.../readwrite/model/CEMIAdditionalInformation.go | 202 -
.../CEMIAdditionalInformationBusmonitorInfo.go | 322 --
.../CEMIAdditionalInformationRelativeTimestamp.go | 181 -
.../knxnetip/readwrite/model/CEMIBusmonInd.go | 237 -
.../plc4go/knxnetip/readwrite/model/CEMIDataCon.go | 237 -
.../knxnetip/readwrite/model/CEMIDataFrame.go | 613 ---
.../plc4go/knxnetip/readwrite/model/CEMIDataInd.go | 237 -
.../plc4go/knxnetip/readwrite/model/CEMIDataReq.go | 237 -
.../plc4go/knxnetip/readwrite/model/CEMIFrame.go | 382 --
.../knxnetip/readwrite/model/CEMIFrameAck.go | 143 -
.../knxnetip/readwrite/model/CEMIFrameData.go | 486 --
.../knxnetip/readwrite/model/CEMIFrameDataExt.go | 514 ---
.../readwrite/model/CEMIFramePollingData.go | 143 -
.../readwrite/model/CEMIFramePollingDataExt.go | 143 -
.../knxnetip/readwrite/model/CEMIMPropReadCon.go | 300 --
.../knxnetip/readwrite/model/CEMIMPropReadReq.go | 272 --
.../knxnetip/readwrite/model/CEMIPollDataCon.go | 131 -
.../knxnetip/readwrite/model/CEMIPollDataReq.go | 131 -
.../knxnetip/readwrite/model/CEMIPriority.go | 78 -
.../plc4go/knxnetip/readwrite/model/CEMIRawCon.go | 131 -
.../plc4go/knxnetip/readwrite/model/CEMIRawInd.go | 131 -
.../plc4go/knxnetip/readwrite/model/CEMIRawReq.go | 131 -
.../knxnetip/readwrite/model/ConnectionRequest.go | 213 -
.../model/ConnectionRequestInformation.go | 218 -
...ConnectionRequestInformationDeviceManagement.go | 131 -
...ConnectionRequestInformationTunnelConnection.go | 186 -
.../knxnetip/readwrite/model/ConnectionResponse.go | 262 --
.../readwrite/model/ConnectionResponseDataBlock.go | 218 -
.../ConnectionResponseDataBlockDeviceManagement.go | 131 -
.../ConnectionResponseDataBlockTunnelConnection.go | 159 -
.../readwrite/model/ConnectionStateRequest.go | 213 -
.../readwrite/model/ConnectionStateResponse.go | 188 -
.../knxnetip/readwrite/model/DIBDeviceInfo.go | 391 --
.../knxnetip/readwrite/model/DIBSuppSvcFamilies.go | 199 -
.../knxnetip/readwrite/model/DescriptionRequest.go | 159 -
.../readwrite/model/DescriptionResponse.go | 186 -
.../readwrite/model/DeviceConfigurationAck.go | 159 -
.../model/DeviceConfigurationAckDataBlock.go | 205 -
.../readwrite/model/DeviceConfigurationRequest.go | 186 -
.../model/DeviceConfigurationRequestDataBlock.go | 205 -
.../knxnetip/readwrite/model/DeviceStatus.go | 163 -
.../knxnetip/readwrite/model/DisconnectRequest.go | 213 -
.../knxnetip/readwrite/model/DisconnectResponse.go | 188 -
.../readwrite/model/HPAIControlEndpoint.go | 204 -
.../knxnetip/readwrite/model/HPAIDataEndpoint.go | 204 -
.../readwrite/model/HPAIDiscoveryEndpoint.go | 204 -
.../knxnetip/readwrite/model/HostProtocolCode.go | 72 -
.../plc4go/knxnetip/readwrite/model/IPAddress.go | 155 -
.../plc4go/knxnetip/readwrite/model/KNXAddress.go | 189 -
.../knxnetip/readwrite/model/KNXGroupAddress.go | 200 -
.../readwrite/model/KNXGroupAddress2Level.go | 188 -
.../readwrite/model/KNXGroupAddress3Level.go | 216 -
.../readwrite/model/KNXGroupAddressFreeLevel.go | 160 -
.../knxnetip/readwrite/model/KNXNetIPMessage.go | 452 --
.../knxnetip/readwrite/model/KnxDatapoint.go | 4821 --------------------
.../knxnetip/readwrite/model/KnxDatapointType.go | 4377 ------------------
.../plc4go/knxnetip/readwrite/model/KnxLayer.go | 75 -
.../knxnetip/readwrite/model/KnxNetIpCore.go | 160 -
.../readwrite/model/KnxNetIpDeviceManagement.go | 160 -
.../knxnetip/readwrite/model/KnxNetIpTunneling.go | 160 -
.../knxnetip/readwrite/model/KnxNetObjectServer.go | 160 -
.../model/KnxNetRemoteConfigurationAndDiagnosis.go | 160 -
.../readwrite/model/KnxNetRemoteLogging.go | 160 -
.../knxnetip/readwrite/model/KnxStaticHelper.go | 50 -
.../plc4go/knxnetip/readwrite/model/MACAddress.go | 155 -
.../model/ProjectInstallationIdentifier.go | 163 -
.../knxnetip/readwrite/model/RelativeTimestamp.go | 137 -
.../knxnetip/readwrite/model/RoutingIndication.go | 131 -
.../knxnetip/readwrite/model/SearchRequest.go | 159 -
.../knxnetip/readwrite/model/SearchResponse.go | 213 -
.../plc4go/knxnetip/readwrite/model/ServiceId.go | 258 --
.../plc4go/knxnetip/readwrite/model/Status.go | 102 -
.../plc4go/knxnetip/readwrite/model/TPCI.go | 78 -
.../knxnetip/readwrite/model/TunnelingRequest.go | 186 -
.../readwrite/model/TunnelingRequestDataBlock.go | 205 -
.../knxnetip/readwrite/model/TunnelingResponse.go | 159 -
.../readwrite/model/TunnelingResponseDataBlock.go | 205 -
.../knxnetip/readwrite/model/UnknownMessage.go | 178 -
80 files changed, 24853 deletions(-)
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/APCI.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/APCI.go
deleted file mode 100644
index 195e7d2..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/APCI.go
+++ /dev/null
@@ -1,114 +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 (
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-type APCI uint8
-
-type IAPCI interface {
- Serialize(io utils.WriteBuffer) error
-}
-
-const(
- APCI_GROUP_VALUE_READ_PDU APCI = 0x0
- APCI_GROUP_VALUE_RESPONSE_PDU APCI = 0x1
- APCI_GROUP_VALUE_WRITE_PDU APCI = 0x2
- APCI_INDIVIDUAL_ADDRESS_WRITE_PDU APCI = 0x3
- APCI_INDIVIDUAL_ADDRESS_READ_PDU APCI = 0x4
- APCI_INDIVIDUAL_ADDRESS_RESPONSE_PDU APCI = 0x5
- APCI_ADC_READ_PDU APCI = 0x6
- APCI_ADC_RESPONSE_PDU APCI = 0x7
- APCI_MEMORY_READ_PDU APCI = 0x8
- APCI_MEMORY_RESPONSE_PDU APCI = 0x9
- APCI_MEMORY_WRITE_PDU APCI = 0xA
- APCI_USER_MESSAGE_PDU APCI = 0xB
- APCI_DEVICE_DESCRIPTOR_READ_PDU APCI = 0xC
- APCI_DEVICE_DESCRIPTOR_RESPONSE_PDU APCI = 0xD
- APCI_RESTART_PDU APCI = 0xE
- APCI_OTHER_PDU APCI = 0xF
-)
-
-func APCIValueOf(value uint8) APCI {
- switch value {
- case 0x0:
- return APCI_GROUP_VALUE_READ_PDU
- case 0x1:
- return APCI_GROUP_VALUE_RESPONSE_PDU
- case 0x2:
- return APCI_GROUP_VALUE_WRITE_PDU
- case 0x3:
- return APCI_INDIVIDUAL_ADDRESS_WRITE_PDU
- case 0x4:
- return APCI_INDIVIDUAL_ADDRESS_READ_PDU
- case 0x5:
- return APCI_INDIVIDUAL_ADDRESS_RESPONSE_PDU
- case 0x6:
- return APCI_ADC_READ_PDU
- case 0x7:
- return APCI_ADC_RESPONSE_PDU
- case 0x8:
- return APCI_MEMORY_READ_PDU
- case 0x9:
- return APCI_MEMORY_RESPONSE_PDU
- case 0xA:
- return APCI_MEMORY_WRITE_PDU
- case 0xB:
- return APCI_USER_MESSAGE_PDU
- case 0xC:
- return APCI_DEVICE_DESCRIPTOR_READ_PDU
- case 0xD:
- return APCI_DEVICE_DESCRIPTOR_RESPONSE_PDU
- case 0xE:
- return APCI_RESTART_PDU
- case 0xF:
- return APCI_OTHER_PDU
- }
- return 0
-}
-
-func CastAPCI(structType interface{}) APCI {
- castFunc := func(typ interface{}) APCI {
- if sAPCI, ok := typ.(APCI); ok {
- return sAPCI
- }
- return 0
- }
- return castFunc(structType)
-}
-
-func (m APCI) LengthInBits() uint16 {
- return 4
-}
-
-func (m APCI) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func APCIParse(io *utils.ReadBuffer) (APCI, error) {
- // TODO: Implement ...
- return 0, nil
-}
-
-func (e APCI) Serialize(io utils.WriteBuffer) error {
- // TODO: Implement ...
- return nil
-}
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMI.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMI.go
deleted file mode 100644
index ee47a22..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMI.go
+++ /dev/null
@@ -1,328 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "reflect"
- "strings"
-)
-
-// The data-structure of this message
-type CEMI struct {
- Child ICEMIChild
- ICEMI
- ICEMIParent
-}
-
-// The corresponding interface
-type ICEMI interface {
- MessageCode() uint8
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-type ICEMIParent interface {
- SerializeParent(io utils.WriteBuffer, child ICEMI, serializeChildFunction func() error) error
-}
-
-type ICEMIChild interface {
- Serialize(io utils.WriteBuffer) error
- InitializeParent(parent *CEMI)
- ICEMI
-}
-
-func NewCEMI() *CEMI {
- return &CEMI{}
-}
-
-func CastCEMI(structType interface{}) CEMI {
- castFunc := func(typ interface{}) CEMI {
- if casted, ok := typ.(CEMI); ok {
- return casted
- }
- if casted, ok := typ.(*CEMI); ok {
- return *casted
- }
- return CEMI{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMI) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Discriminator Field (messageCode)
- lengthInBits += 8
-
- // Length of sub-type elements will be added by sub-type...
- lengthInBits += m.Child.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMI) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIParse(io *utils.ReadBuffer, size uint8) (*CEMI, error) {
-
- // Discriminator Field (messageCode) (Used as input to a switch field)
- messageCode, _messageCodeErr := io.ReadUint8(8)
- if _messageCodeErr != nil {
- return nil, errors.New("Error parsing 'messageCode' field " + _messageCodeErr.Error())
- }
-
- // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
- var _parent *CEMI
- var typeSwitchError error
- switch {
- case messageCode == 0x11:
- _parent, typeSwitchError = CEMIDataReqParse(io)
- case messageCode == 0x2E:
- _parent, typeSwitchError = CEMIDataConParse(io)
- case messageCode == 0x29:
- _parent, typeSwitchError = CEMIDataIndParse(io)
- case messageCode == 0x10:
- _parent, typeSwitchError = CEMIRawReqParse(io)
- case messageCode == 0x2F:
- _parent, typeSwitchError = CEMIRawConParse(io)
- case messageCode == 0x2D:
- _parent, typeSwitchError = CEMIRawIndParse(io)
- case messageCode == 0x13:
- _parent, typeSwitchError = CEMIPollDataReqParse(io)
- case messageCode == 0x25:
- _parent, typeSwitchError = CEMIPollDataConParse(io)
- case messageCode == 0x2B:
- _parent, typeSwitchError = CEMIBusmonIndParse(io)
- case messageCode == 0xFC:
- _parent, typeSwitchError = CEMIMPropReadReqParse(io)
- case messageCode == 0xFB:
- _parent, typeSwitchError = CEMIMPropReadConParse(io)
- }
- if typeSwitchError != nil {
- return nil, errors.New("Error parsing sub-type for type-switch. " + typeSwitchError.Error())
- }
-
- // Finish initializing
- _parent.Child.InitializeParent(_parent)
- return _parent, nil
-}
-
-func (m *CEMI) Serialize(io utils.WriteBuffer) error {
- return m.Child.Serialize(io)
-}
-
-func (m *CEMI) SerializeParent(io utils.WriteBuffer, child ICEMI, serializeChildFunction func() error) error {
-
- // Discriminator Field (messageCode) (Used as input to a switch field)
- messageCode := uint8(child.MessageCode())
- _messageCodeErr := io.WriteUint8(8, (messageCode))
- if _messageCodeErr != nil {
- return errors.New("Error serializing 'messageCode' field " + _messageCodeErr.Error())
- }
-
- // Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
- _typeSwitchErr := serializeChildFunction()
- if _typeSwitchErr != nil {
- return errors.New("Error serializing sub-type field " + _typeSwitchErr.Error())
- }
-
- return nil
-}
-
-func (m *CEMI) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- default:
- switch start.Attr[0].Value {
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIDataReq":
- var dt *CEMIDataReq
- if m.Child != nil {
- dt = m.Child.(*CEMIDataReq)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIDataCon":
- var dt *CEMIDataCon
- if m.Child != nil {
- dt = m.Child.(*CEMIDataCon)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIDataInd":
- var dt *CEMIDataInd
- if m.Child != nil {
- dt = m.Child.(*CEMIDataInd)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIRawReq":
- var dt *CEMIRawReq
- if m.Child != nil {
- dt = m.Child.(*CEMIRawReq)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIRawCon":
- var dt *CEMIRawCon
- if m.Child != nil {
- dt = m.Child.(*CEMIRawCon)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIRawInd":
- var dt *CEMIRawInd
- if m.Child != nil {
- dt = m.Child.(*CEMIRawInd)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIPollDataReq":
- var dt *CEMIPollDataReq
- if m.Child != nil {
- dt = m.Child.(*CEMIPollDataReq)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIPollDataCon":
- var dt *CEMIPollDataCon
- if m.Child != nil {
- dt = m.Child.(*CEMIPollDataCon)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIBusmonInd":
- var dt *CEMIBusmonInd
- if m.Child != nil {
- dt = m.Child.(*CEMIBusmonInd)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIMPropReadReq":
- var dt *CEMIMPropReadReq
- if m.Child != nil {
- dt = m.Child.(*CEMIMPropReadReq)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIMPropReadCon":
- var dt *CEMIMPropReadCon
- if m.Child != nil {
- dt = m.Child.(*CEMIMPropReadCon)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- }
- }
- }
- }
-}
-
-func (m *CEMI) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := reflect.TypeOf(m.Child).String()
- className = "org.apache.plc4x.java.knxnetip.readwrite." + className[strings.LastIndex(className, ".") + 1:]
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- marshaller, ok := m.Child.(xml.Marshaler)
- if !ok {
- return errors.New("child is not castable to Marshaler")
- }
- marshaller.MarshalXML(e, start)
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformation.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformation.go
deleted file mode 100644
index 07425ba..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformation.go
+++ /dev/null
@@ -1,202 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "reflect"
- "strings"
-)
-
-// The data-structure of this message
-type CEMIAdditionalInformation struct {
- Child ICEMIAdditionalInformationChild
- ICEMIAdditionalInformation
- ICEMIAdditionalInformationParent
-}
-
-// The corresponding interface
-type ICEMIAdditionalInformation interface {
- AdditionalInformationType() uint8
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-type ICEMIAdditionalInformationParent interface {
- SerializeParent(io utils.WriteBuffer, child ICEMIAdditionalInformation, serializeChildFunction func() error) error
-}
-
-type ICEMIAdditionalInformationChild interface {
- Serialize(io utils.WriteBuffer) error
- InitializeParent(parent *CEMIAdditionalInformation)
- ICEMIAdditionalInformation
-}
-
-func NewCEMIAdditionalInformation() *CEMIAdditionalInformation {
- return &CEMIAdditionalInformation{}
-}
-
-func CastCEMIAdditionalInformation(structType interface{}) CEMIAdditionalInformation {
- castFunc := func(typ interface{}) CEMIAdditionalInformation {
- if casted, ok := typ.(CEMIAdditionalInformation); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIAdditionalInformation); ok {
- return *casted
- }
- return CEMIAdditionalInformation{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIAdditionalInformation) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Discriminator Field (additionalInformationType)
- lengthInBits += 8
-
- // Length of sub-type elements will be added by sub-type...
- lengthInBits += m.Child.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIAdditionalInformation) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIAdditionalInformationParse(io *utils.ReadBuffer) (*CEMIAdditionalInformation, error) {
-
- // Discriminator Field (additionalInformationType) (Used as input to a switch field)
- additionalInformationType, _additionalInformationTypeErr := io.ReadUint8(8)
- if _additionalInformationTypeErr != nil {
- return nil, errors.New("Error parsing 'additionalInformationType' field " + _additionalInformationTypeErr.Error())
- }
-
- // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
- var _parent *CEMIAdditionalInformation
- var typeSwitchError error
- switch {
- case additionalInformationType == 0x03:
- _parent, typeSwitchError = CEMIAdditionalInformationBusmonitorInfoParse(io)
- case additionalInformationType == 0x04:
- _parent, typeSwitchError = CEMIAdditionalInformationRelativeTimestampParse(io)
- }
- if typeSwitchError != nil {
- return nil, errors.New("Error parsing sub-type for type-switch. " + typeSwitchError.Error())
- }
-
- // Finish initializing
- _parent.Child.InitializeParent(_parent)
- return _parent, nil
-}
-
-func (m *CEMIAdditionalInformation) Serialize(io utils.WriteBuffer) error {
- return m.Child.Serialize(io)
-}
-
-func (m *CEMIAdditionalInformation) SerializeParent(io utils.WriteBuffer, child ICEMIAdditionalInformation, serializeChildFunction func() error) error {
-
- // Discriminator Field (additionalInformationType) (Used as input to a switch field)
- additionalInformationType := uint8(child.AdditionalInformationType())
- _additionalInformationTypeErr := io.WriteUint8(8, (additionalInformationType))
- if _additionalInformationTypeErr != nil {
- return errors.New("Error serializing 'additionalInformationType' field " + _additionalInformationTypeErr.Error())
- }
-
- // Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
- _typeSwitchErr := serializeChildFunction()
- if _typeSwitchErr != nil {
- return errors.New("Error serializing sub-type field " + _typeSwitchErr.Error())
- }
-
- return nil
-}
-
-func (m *CEMIAdditionalInformation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- default:
- switch start.Attr[0].Value {
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationBusmonitorInfo":
- var dt *CEMIAdditionalInformationBusmonitorInfo
- if m.Child != nil {
- dt = m.Child.(*CEMIAdditionalInformationBusmonitorInfo)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationRelativeTimestamp":
- var dt *CEMIAdditionalInformationRelativeTimestamp
- if m.Child != nil {
- dt = m.Child.(*CEMIAdditionalInformationRelativeTimestamp)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- }
- }
- }
- }
-}
-
-func (m *CEMIAdditionalInformation) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := reflect.TypeOf(m.Child).String()
- className = "org.apache.plc4x.java.knxnetip.readwrite." + className[strings.LastIndex(className, ".") + 1:]
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- marshaller, ok := m.Child.(xml.Marshaler)
- if !ok {
- return errors.New("child is not castable to Marshaler")
- }
- marshaller.MarshalXML(e, start)
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go
deleted file mode 100644
index c431e49..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go
+++ /dev/null
@@ -1,322 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "strconv"
-)
-
-// Constant values.
-const CEMIAdditionalInformationBusmonitorInfo_LEN uint8 = 1
-
-// The data-structure of this message
-type CEMIAdditionalInformationBusmonitorInfo struct {
- FrameErrorFlag bool
- BitErrorFlag bool
- ParityErrorFlag bool
- UnknownFlag bool
- LostFlag bool
- SequenceNumber uint8
- Parent *CEMIAdditionalInformation
- ICEMIAdditionalInformationBusmonitorInfo
-}
-
-// The corresponding interface
-type ICEMIAdditionalInformationBusmonitorInfo interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIAdditionalInformationBusmonitorInfo) AdditionalInformationType() uint8 {
- return 0x03
-}
-
-
-func (m *CEMIAdditionalInformationBusmonitorInfo) InitializeParent(parent *CEMIAdditionalInformation) {
-}
-
-func NewCEMIAdditionalInformationBusmonitorInfo(frameErrorFlag bool, bitErrorFlag bool, parityErrorFlag bool, unknownFlag bool, lostFlag bool, sequenceNumber uint8, ) *CEMIAdditionalInformation {
- child := &CEMIAdditionalInformationBusmonitorInfo{
- FrameErrorFlag: frameErrorFlag,
- BitErrorFlag: bitErrorFlag,
- ParityErrorFlag: parityErrorFlag,
- UnknownFlag: unknownFlag,
- LostFlag: lostFlag,
- SequenceNumber: sequenceNumber,
- Parent: NewCEMIAdditionalInformation(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIAdditionalInformationBusmonitorInfo(structType interface{}) CEMIAdditionalInformationBusmonitorInfo {
- castFunc := func(typ interface{}) CEMIAdditionalInformationBusmonitorInfo {
- if casted, ok := typ.(CEMIAdditionalInformationBusmonitorInfo); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIAdditionalInformationBusmonitorInfo); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIAdditionalInformation); ok {
- return CastCEMIAdditionalInformationBusmonitorInfo(casted.Child)
- }
- if casted, ok := typ.(*CEMIAdditionalInformation); ok {
- return CastCEMIAdditionalInformationBusmonitorInfo(casted.Child)
- }
- return CEMIAdditionalInformationBusmonitorInfo{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIAdditionalInformationBusmonitorInfo) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Const Field (len)
- lengthInBits += 8
-
- // Simple field (frameErrorFlag)
- lengthInBits += 1
-
- // Simple field (bitErrorFlag)
- lengthInBits += 1
-
- // Simple field (parityErrorFlag)
- lengthInBits += 1
-
- // Simple field (unknownFlag)
- lengthInBits += 1
-
- // Simple field (lostFlag)
- lengthInBits += 1
-
- // Simple field (sequenceNumber)
- lengthInBits += 3
-
- return lengthInBits
-}
-
-func (m *CEMIAdditionalInformationBusmonitorInfo) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIAdditionalInformationBusmonitorInfoParse(io *utils.ReadBuffer) (*CEMIAdditionalInformation, error) {
-
- // Const Field (len)
- len, _lenErr := io.ReadUint8(8)
- if _lenErr != nil {
- return nil, errors.New("Error parsing 'len' field " + _lenErr.Error())
- }
- if len != CEMIAdditionalInformationBusmonitorInfo_LEN {
- return nil, errors.New("Expected constant value " + strconv.Itoa(int(CEMIAdditionalInformationBusmonitorInfo_LEN)) + " but got " + strconv.Itoa(int(len)))
- }
-
- // Simple Field (frameErrorFlag)
- frameErrorFlag, _frameErrorFlagErr := io.ReadBit()
- if _frameErrorFlagErr != nil {
- return nil, errors.New("Error parsing 'frameErrorFlag' field " + _frameErrorFlagErr.Error())
- }
-
- // Simple Field (bitErrorFlag)
- bitErrorFlag, _bitErrorFlagErr := io.ReadBit()
- if _bitErrorFlagErr != nil {
- return nil, errors.New("Error parsing 'bitErrorFlag' field " + _bitErrorFlagErr.Error())
- }
-
- // Simple Field (parityErrorFlag)
- parityErrorFlag, _parityErrorFlagErr := io.ReadBit()
- if _parityErrorFlagErr != nil {
- return nil, errors.New("Error parsing 'parityErrorFlag' field " + _parityErrorFlagErr.Error())
- }
-
- // Simple Field (unknownFlag)
- unknownFlag, _unknownFlagErr := io.ReadBit()
- if _unknownFlagErr != nil {
- return nil, errors.New("Error parsing 'unknownFlag' field " + _unknownFlagErr.Error())
- }
-
- // Simple Field (lostFlag)
- lostFlag, _lostFlagErr := io.ReadBit()
- if _lostFlagErr != nil {
- return nil, errors.New("Error parsing 'lostFlag' field " + _lostFlagErr.Error())
- }
-
- // Simple Field (sequenceNumber)
- sequenceNumber, _sequenceNumberErr := io.ReadUint8(3)
- if _sequenceNumberErr != nil {
- return nil, errors.New("Error parsing 'sequenceNumber' field " + _sequenceNumberErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIAdditionalInformationBusmonitorInfo{
- FrameErrorFlag: frameErrorFlag,
- BitErrorFlag: bitErrorFlag,
- ParityErrorFlag: parityErrorFlag,
- UnknownFlag: unknownFlag,
- LostFlag: lostFlag,
- SequenceNumber: sequenceNumber,
- Parent: &CEMIAdditionalInformation{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIAdditionalInformationBusmonitorInfo) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Const Field (len)
- _lenErr := io.WriteUint8(8, 1)
- if _lenErr != nil {
- return errors.New("Error serializing 'len' field " + _lenErr.Error())
- }
-
- // Simple Field (frameErrorFlag)
- frameErrorFlag := bool(m.FrameErrorFlag)
- _frameErrorFlagErr := io.WriteBit((frameErrorFlag))
- if _frameErrorFlagErr != nil {
- return errors.New("Error serializing 'frameErrorFlag' field " + _frameErrorFlagErr.Error())
- }
-
- // Simple Field (bitErrorFlag)
- bitErrorFlag := bool(m.BitErrorFlag)
- _bitErrorFlagErr := io.WriteBit((bitErrorFlag))
- if _bitErrorFlagErr != nil {
- return errors.New("Error serializing 'bitErrorFlag' field " + _bitErrorFlagErr.Error())
- }
-
- // Simple Field (parityErrorFlag)
- parityErrorFlag := bool(m.ParityErrorFlag)
- _parityErrorFlagErr := io.WriteBit((parityErrorFlag))
- if _parityErrorFlagErr != nil {
- return errors.New("Error serializing 'parityErrorFlag' field " + _parityErrorFlagErr.Error())
- }
-
- // Simple Field (unknownFlag)
- unknownFlag := bool(m.UnknownFlag)
- _unknownFlagErr := io.WriteBit((unknownFlag))
- if _unknownFlagErr != nil {
- return errors.New("Error serializing 'unknownFlag' field " + _unknownFlagErr.Error())
- }
-
- // Simple Field (lostFlag)
- lostFlag := bool(m.LostFlag)
- _lostFlagErr := io.WriteBit((lostFlag))
- if _lostFlagErr != nil {
- return errors.New("Error serializing 'lostFlag' field " + _lostFlagErr.Error())
- }
-
- // Simple Field (sequenceNumber)
- sequenceNumber := uint8(m.SequenceNumber)
- _sequenceNumberErr := io.WriteUint8(3, (sequenceNumber))
- if _sequenceNumberErr != nil {
- return errors.New("Error serializing 'sequenceNumber' field " + _sequenceNumberErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIAdditionalInformationBusmonitorInfo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "frameErrorFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.FrameErrorFlag = data
- case "bitErrorFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.BitErrorFlag = data
- case "parityErrorFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ParityErrorFlag = data
- case "unknownFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.UnknownFlag = data
- case "lostFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.LostFlag = data
- case "sequenceNumber":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.SequenceNumber = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIAdditionalInformationBusmonitorInfo) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.FrameErrorFlag, xml.StartElement{Name: xml.Name{Local: "frameErrorFlag"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.BitErrorFlag, xml.StartElement{Name: xml.Name{Local: "bitErrorFlag"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ParityErrorFlag, xml.StartElement{Name: xml.Name{Local: "parityErrorFlag"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.UnknownFlag, xml.StartElement{Name: xml.Name{Local: "unknownFlag"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.LostFlag, xml.StartElement{Name: xml.Name{Local: "lostFlag"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.SequenceNumber, xml.StartElement{Name: xml.Name{Local: "sequenceNumber"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go
deleted file mode 100644
index 546bdd4..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go
+++ /dev/null
@@ -1,181 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "strconv"
-)
-
-// Constant values.
-const CEMIAdditionalInformationRelativeTimestamp_LEN uint8 = 2
-
-// The data-structure of this message
-type CEMIAdditionalInformationRelativeTimestamp struct {
- RelativeTimestamp *RelativeTimestamp
- Parent *CEMIAdditionalInformation
- ICEMIAdditionalInformationRelativeTimestamp
-}
-
-// The corresponding interface
-type ICEMIAdditionalInformationRelativeTimestamp interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIAdditionalInformationRelativeTimestamp) AdditionalInformationType() uint8 {
- return 0x04
-}
-
-
-func (m *CEMIAdditionalInformationRelativeTimestamp) InitializeParent(parent *CEMIAdditionalInformation) {
-}
-
-func NewCEMIAdditionalInformationRelativeTimestamp(relativeTimestamp *RelativeTimestamp, ) *CEMIAdditionalInformation {
- child := &CEMIAdditionalInformationRelativeTimestamp{
- RelativeTimestamp: relativeTimestamp,
- Parent: NewCEMIAdditionalInformation(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIAdditionalInformationRelativeTimestamp(structType interface{}) CEMIAdditionalInformationRelativeTimestamp {
- castFunc := func(typ interface{}) CEMIAdditionalInformationRelativeTimestamp {
- if casted, ok := typ.(CEMIAdditionalInformationRelativeTimestamp); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIAdditionalInformationRelativeTimestamp); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIAdditionalInformation); ok {
- return CastCEMIAdditionalInformationRelativeTimestamp(casted.Child)
- }
- if casted, ok := typ.(*CEMIAdditionalInformation); ok {
- return CastCEMIAdditionalInformationRelativeTimestamp(casted.Child)
- }
- return CEMIAdditionalInformationRelativeTimestamp{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIAdditionalInformationRelativeTimestamp) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Const Field (len)
- lengthInBits += 8
-
- // Simple field (relativeTimestamp)
- lengthInBits += m.RelativeTimestamp.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIAdditionalInformationRelativeTimestamp) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIAdditionalInformationRelativeTimestampParse(io *utils.ReadBuffer) (*CEMIAdditionalInformation, error) {
-
- // Const Field (len)
- len, _lenErr := io.ReadUint8(8)
- if _lenErr != nil {
- return nil, errors.New("Error parsing 'len' field " + _lenErr.Error())
- }
- if len != CEMIAdditionalInformationRelativeTimestamp_LEN {
- return nil, errors.New("Expected constant value " + strconv.Itoa(int(CEMIAdditionalInformationRelativeTimestamp_LEN)) + " but got " + strconv.Itoa(int(len)))
- }
-
- // Simple Field (relativeTimestamp)
- relativeTimestamp, _relativeTimestampErr := RelativeTimestampParse(io)
- if _relativeTimestampErr != nil {
- return nil, errors.New("Error parsing 'relativeTimestamp' field " + _relativeTimestampErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIAdditionalInformationRelativeTimestamp{
- RelativeTimestamp: relativeTimestamp,
- Parent: &CEMIAdditionalInformation{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIAdditionalInformationRelativeTimestamp) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Const Field (len)
- _lenErr := io.WriteUint8(8, 2)
- if _lenErr != nil {
- return errors.New("Error serializing 'len' field " + _lenErr.Error())
- }
-
- // Simple Field (relativeTimestamp)
- _relativeTimestampErr := m.RelativeTimestamp.Serialize(io)
- if _relativeTimestampErr != nil {
- return errors.New("Error serializing 'relativeTimestamp' field " + _relativeTimestampErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIAdditionalInformationRelativeTimestamp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "relativeTimestamp":
- var data *RelativeTimestamp
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.RelativeTimestamp = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIAdditionalInformationRelativeTimestamp) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.RelativeTimestamp, xml.StartElement{Name: xml.Name{Local: "relativeTimestamp"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIBusmonInd.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIBusmonInd.go
deleted file mode 100644
index ca5203b..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIBusmonInd.go
+++ /dev/null
@@ -1,237 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIBusmonInd struct {
- AdditionalInformationLength uint8
- AdditionalInformation []*CEMIAdditionalInformation
- CemiFrame *CEMIFrame
- Parent *CEMI
- ICEMIBusmonInd
-}
-
-// The corresponding interface
-type ICEMIBusmonInd interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIBusmonInd) MessageCode() uint8 {
- return 0x2B
-}
-
-
-func (m *CEMIBusmonInd) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIBusmonInd(additionalInformationLength uint8, additionalInformation []*CEMIAdditionalInformation, cemiFrame *CEMIFrame, ) *CEMI {
- child := &CEMIBusmonInd{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiFrame: cemiFrame,
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIBusmonInd(structType interface{}) CEMIBusmonInd {
- castFunc := func(typ interface{}) CEMIBusmonInd {
- if casted, ok := typ.(CEMIBusmonInd); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIBusmonInd); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIBusmonInd(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIBusmonInd(casted.Child)
- }
- return CEMIBusmonInd{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIBusmonInd) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (additionalInformationLength)
- lengthInBits += 8
-
- // Array field
- if len(m.AdditionalInformation) > 0 {
- for _, element := range m.AdditionalInformation {
- lengthInBits += element.LengthInBits()
- }
- }
-
- // Simple field (cemiFrame)
- lengthInBits += m.CemiFrame.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIBusmonInd) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIBusmonIndParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength, _additionalInformationLengthErr := io.ReadUint8(8)
- if _additionalInformationLengthErr != nil {
- return nil, errors.New("Error parsing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array field (additionalInformation)
- // Length array
- additionalInformation := make([]*CEMIAdditionalInformation, 0)
- _additionalInformationLength := additionalInformationLength
- _additionalInformationEndPos := io.GetPos() + uint16(_additionalInformationLength)
- for ;io.GetPos() < _additionalInformationEndPos; {
- _item, _err := CEMIAdditionalInformationParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'additionalInformation' field " + _err.Error())
- }
- additionalInformation = append(additionalInformation, _item)
- }
-
- // Simple Field (cemiFrame)
- cemiFrame, _cemiFrameErr := CEMIFrameParse(io)
- if _cemiFrameErr != nil {
- return nil, errors.New("Error parsing 'cemiFrame' field " + _cemiFrameErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIBusmonInd{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiFrame: cemiFrame,
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIBusmonInd) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength := uint8(m.AdditionalInformationLength)
- _additionalInformationLengthErr := io.WriteUint8(8, (additionalInformationLength))
- if _additionalInformationLengthErr != nil {
- return errors.New("Error serializing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array Field (additionalInformation)
- if m.AdditionalInformation != nil {
- for _, _element := range m.AdditionalInformation {
- _elementErr := _element.Serialize(io)
- if _elementErr != nil {
- return errors.New("Error serializing 'additionalInformation' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (cemiFrame)
- _cemiFrameErr := m.CemiFrame.Serialize(io)
- if _cemiFrameErr != nil {
- return errors.New("Error serializing 'cemiFrame' field " + _cemiFrameErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIBusmonInd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "additionalInformationLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.AdditionalInformationLength = data
- case "additionalInformation":
- var _values []*CEMIAdditionalInformation
- var dt *CEMIAdditionalInformation
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- _values = append(_values, dt)
- m.AdditionalInformation = _values
- case "cemiFrame":
- var dt *CEMIFrame
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- m.CemiFrame = dt
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIBusmonInd) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.AdditionalInformationLength, xml.StartElement{Name: xml.Name{Local: "additionalInformationLength"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.AdditionalInformation, xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.CemiFrame, xml.StartElement{Name: xml.Name{Local: "cemiFrame"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataCon.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataCon.go
deleted file mode 100644
index ae56a59..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataCon.go
+++ /dev/null
@@ -1,237 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIDataCon struct {
- AdditionalInformationLength uint8
- AdditionalInformation []*CEMIAdditionalInformation
- CemiDataFrame *CEMIDataFrame
- Parent *CEMI
- ICEMIDataCon
-}
-
-// The corresponding interface
-type ICEMIDataCon interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIDataCon) MessageCode() uint8 {
- return 0x2E
-}
-
-
-func (m *CEMIDataCon) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIDataCon(additionalInformationLength uint8, additionalInformation []*CEMIAdditionalInformation, cemiDataFrame *CEMIDataFrame, ) *CEMI {
- child := &CEMIDataCon{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiDataFrame: cemiDataFrame,
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIDataCon(structType interface{}) CEMIDataCon {
- castFunc := func(typ interface{}) CEMIDataCon {
- if casted, ok := typ.(CEMIDataCon); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIDataCon); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIDataCon(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIDataCon(casted.Child)
- }
- return CEMIDataCon{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIDataCon) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (additionalInformationLength)
- lengthInBits += 8
-
- // Array field
- if len(m.AdditionalInformation) > 0 {
- for _, element := range m.AdditionalInformation {
- lengthInBits += element.LengthInBits()
- }
- }
-
- // Simple field (cemiDataFrame)
- lengthInBits += m.CemiDataFrame.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIDataCon) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIDataConParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength, _additionalInformationLengthErr := io.ReadUint8(8)
- if _additionalInformationLengthErr != nil {
- return nil, errors.New("Error parsing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array field (additionalInformation)
- // Length array
- additionalInformation := make([]*CEMIAdditionalInformation, 0)
- _additionalInformationLength := additionalInformationLength
- _additionalInformationEndPos := io.GetPos() + uint16(_additionalInformationLength)
- for ;io.GetPos() < _additionalInformationEndPos; {
- _item, _err := CEMIAdditionalInformationParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'additionalInformation' field " + _err.Error())
- }
- additionalInformation = append(additionalInformation, _item)
- }
-
- // Simple Field (cemiDataFrame)
- cemiDataFrame, _cemiDataFrameErr := CEMIDataFrameParse(io)
- if _cemiDataFrameErr != nil {
- return nil, errors.New("Error parsing 'cemiDataFrame' field " + _cemiDataFrameErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIDataCon{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiDataFrame: cemiDataFrame,
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIDataCon) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength := uint8(m.AdditionalInformationLength)
- _additionalInformationLengthErr := io.WriteUint8(8, (additionalInformationLength))
- if _additionalInformationLengthErr != nil {
- return errors.New("Error serializing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array Field (additionalInformation)
- if m.AdditionalInformation != nil {
- for _, _element := range m.AdditionalInformation {
- _elementErr := _element.Serialize(io)
- if _elementErr != nil {
- return errors.New("Error serializing 'additionalInformation' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (cemiDataFrame)
- _cemiDataFrameErr := m.CemiDataFrame.Serialize(io)
- if _cemiDataFrameErr != nil {
- return errors.New("Error serializing 'cemiDataFrame' field " + _cemiDataFrameErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIDataCon) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "additionalInformationLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.AdditionalInformationLength = data
- case "additionalInformation":
- var _values []*CEMIAdditionalInformation
- var dt *CEMIAdditionalInformation
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- _values = append(_values, dt)
- m.AdditionalInformation = _values
- case "cemiDataFrame":
- var data *CEMIDataFrame
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.CemiDataFrame = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIDataCon) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.AdditionalInformationLength, xml.StartElement{Name: xml.Name{Local: "additionalInformationLength"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.AdditionalInformation, xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.CemiDataFrame, xml.StartElement{Name: xml.Name{Local: "cemiDataFrame"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataFrame.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataFrame.go
deleted file mode 100644
index 00b427c..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataFrame.go
+++ /dev/null
@@ -1,613 +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 (
- "encoding/base64"
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIDataFrame struct {
- StandardFrame bool
- Polling bool
- NotRepeated bool
- NotAckFrame bool
- Priority CEMIPriority
- AcknowledgeRequested bool
- ErrorFlag bool
- GroupDestinationAddress bool
- HopCount uint8
- ExtendedFrameFormat uint8
- SourceAddress *KNXAddress
- DestinationAddress []int8
- DataLength uint8
- Tcpi TPCI
- Counter uint8
- Apci APCI
- DataFirstByte int8
- Data []int8
- ICEMIDataFrame
-}
-
-// The corresponding interface
-type ICEMIDataFrame interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-func NewCEMIDataFrame(standardFrame bool, polling bool, notRepeated bool, notAckFrame bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool, groupDestinationAddress bool, hopCount uint8, extendedFrameFormat uint8, sourceAddress *KNXAddress, destinationAddress []int8, dataLength uint8, tcpi TPCI, counter uint8, apci APCI, dataFirstByte int8, data []int8) *CEMIDataFrame {
- return &CEMIDataFrame{StandardFrame: standardFrame, Polling: polling, NotRepeated: notRepeated, NotAckFrame: notAckFrame, Priority: priority, AcknowledgeRequested: acknowledgeRequested, ErrorFlag: errorFlag, GroupDestinationAddress: groupDestinationAddress, HopCount: hopCount, ExtendedFrameFormat: extendedFrameFormat, SourceAddress: sourceAddress, DestinationAddress: destinationAddress, DataLength: dataLength, Tcpi: tcpi, Counter: counter, Apci: apci, DataFirstByte: dataFirstByte, Da [...]
-}
-
-func CastCEMIDataFrame(structType interface{}) CEMIDataFrame {
- castFunc := func(typ interface{}) CEMIDataFrame {
- if casted, ok := typ.(CEMIDataFrame); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIDataFrame); ok {
- return *casted
- }
- return CEMIDataFrame{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIDataFrame) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (standardFrame)
- lengthInBits += 1
-
- // Simple field (polling)
- lengthInBits += 1
-
- // Simple field (notRepeated)
- lengthInBits += 1
-
- // Simple field (notAckFrame)
- lengthInBits += 1
-
- // Enum Field (priority)
- lengthInBits += 2
-
- // Simple field (acknowledgeRequested)
- lengthInBits += 1
-
- // Simple field (errorFlag)
- lengthInBits += 1
-
- // Simple field (groupDestinationAddress)
- lengthInBits += 1
-
- // Simple field (hopCount)
- lengthInBits += 3
-
- // Simple field (extendedFrameFormat)
- lengthInBits += 4
-
- // Simple field (sourceAddress)
- lengthInBits += m.SourceAddress.LengthInBits()
-
- // Array field
- if len(m.DestinationAddress) > 0 {
- lengthInBits += 8 * uint16(len(m.DestinationAddress))
- }
-
- // Simple field (dataLength)
- lengthInBits += 8
-
- // Enum Field (tcpi)
- lengthInBits += 2
-
- // Simple field (counter)
- lengthInBits += 4
-
- // Enum Field (apci)
- lengthInBits += 4
-
- // Simple field (dataFirstByte)
- lengthInBits += 6
-
- // Array field
- if len(m.Data) > 0 {
- lengthInBits += 8 * uint16(len(m.Data))
- }
-
- return lengthInBits
-}
-
-func (m *CEMIDataFrame) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIDataFrameParse(io *utils.ReadBuffer) (*CEMIDataFrame, error) {
-
- // Simple Field (standardFrame)
- standardFrame, _standardFrameErr := io.ReadBit()
- if _standardFrameErr != nil {
- return nil, errors.New("Error parsing 'standardFrame' field " + _standardFrameErr.Error())
- }
-
- // Simple Field (polling)
- polling, _pollingErr := io.ReadBit()
- if _pollingErr != nil {
- return nil, errors.New("Error parsing 'polling' field " + _pollingErr.Error())
- }
-
- // Simple Field (notRepeated)
- notRepeated, _notRepeatedErr := io.ReadBit()
- if _notRepeatedErr != nil {
- return nil, errors.New("Error parsing 'notRepeated' field " + _notRepeatedErr.Error())
- }
-
- // Simple Field (notAckFrame)
- notAckFrame, _notAckFrameErr := io.ReadBit()
- if _notAckFrameErr != nil {
- return nil, errors.New("Error parsing 'notAckFrame' field " + _notAckFrameErr.Error())
- }
-
- // Enum field (priority)
- priority, _priorityErr := CEMIPriorityParse(io)
- if _priorityErr != nil {
- return nil, errors.New("Error parsing 'priority' field " + _priorityErr.Error())
- }
-
- // Simple Field (acknowledgeRequested)
- acknowledgeRequested, _acknowledgeRequestedErr := io.ReadBit()
- if _acknowledgeRequestedErr != nil {
- return nil, errors.New("Error parsing 'acknowledgeRequested' field " + _acknowledgeRequestedErr.Error())
- }
-
- // Simple Field (errorFlag)
- errorFlag, _errorFlagErr := io.ReadBit()
- if _errorFlagErr != nil {
- return nil, errors.New("Error parsing 'errorFlag' field " + _errorFlagErr.Error())
- }
-
- // Simple Field (groupDestinationAddress)
- groupDestinationAddress, _groupDestinationAddressErr := io.ReadBit()
- if _groupDestinationAddressErr != nil {
- return nil, errors.New("Error parsing 'groupDestinationAddress' field " + _groupDestinationAddressErr.Error())
- }
-
- // Simple Field (hopCount)
- hopCount, _hopCountErr := io.ReadUint8(3)
- if _hopCountErr != nil {
- return nil, errors.New("Error parsing 'hopCount' field " + _hopCountErr.Error())
- }
-
- // Simple Field (extendedFrameFormat)
- extendedFrameFormat, _extendedFrameFormatErr := io.ReadUint8(4)
- if _extendedFrameFormatErr != nil {
- return nil, errors.New("Error parsing 'extendedFrameFormat' field " + _extendedFrameFormatErr.Error())
- }
-
- // Simple Field (sourceAddress)
- sourceAddress, _sourceAddressErr := KNXAddressParse(io)
- if _sourceAddressErr != nil {
- return nil, errors.New("Error parsing 'sourceAddress' field " + _sourceAddressErr.Error())
- }
-
- // Array field (destinationAddress)
- // Count array
- destinationAddress := make([]int8, uint16(2))
- for curItem := uint16(0); curItem < uint16(uint16(2)); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'destinationAddress' field " + _err.Error())
- }
- destinationAddress[curItem] = _item
- }
-
- // Simple Field (dataLength)
- dataLength, _dataLengthErr := io.ReadUint8(8)
- if _dataLengthErr != nil {
- return nil, errors.New("Error parsing 'dataLength' field " + _dataLengthErr.Error())
- }
-
- // Enum field (tcpi)
- tcpi, _tcpiErr := TPCIParse(io)
- if _tcpiErr != nil {
- return nil, errors.New("Error parsing 'tcpi' field " + _tcpiErr.Error())
- }
-
- // Simple Field (counter)
- counter, _counterErr := io.ReadUint8(4)
- if _counterErr != nil {
- return nil, errors.New("Error parsing 'counter' field " + _counterErr.Error())
- }
-
- // Enum field (apci)
- apci, _apciErr := APCIParse(io)
- if _apciErr != nil {
- return nil, errors.New("Error parsing 'apci' field " + _apciErr.Error())
- }
-
- // Simple Field (dataFirstByte)
- dataFirstByte, _dataFirstByteErr := io.ReadInt8(6)
- if _dataFirstByteErr != nil {
- return nil, errors.New("Error parsing 'dataFirstByte' field " + _dataFirstByteErr.Error())
- }
-
- // Array field (data)
- // Count array
- data := make([]int8, uint16(dataLength) - uint16(uint16(1)))
- for curItem := uint16(0); curItem < uint16(uint16(dataLength) - uint16(uint16(1))); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'data' field " + _err.Error())
- }
- data[curItem] = _item
- }
-
- // Create the instance
- return NewCEMIDataFrame(standardFrame, polling, notRepeated, notAckFrame, priority, acknowledgeRequested, errorFlag, groupDestinationAddress, hopCount, extendedFrameFormat, sourceAddress, destinationAddress, dataLength, tcpi, counter, apci, dataFirstByte, data), nil
-}
-
-func (m *CEMIDataFrame) Serialize(io utils.WriteBuffer) error {
-
- // Simple Field (standardFrame)
- standardFrame := bool(m.StandardFrame)
- _standardFrameErr := io.WriteBit((standardFrame))
- if _standardFrameErr != nil {
- return errors.New("Error serializing 'standardFrame' field " + _standardFrameErr.Error())
- }
-
- // Simple Field (polling)
- polling := bool(m.Polling)
- _pollingErr := io.WriteBit((polling))
- if _pollingErr != nil {
- return errors.New("Error serializing 'polling' field " + _pollingErr.Error())
- }
-
- // Simple Field (notRepeated)
- notRepeated := bool(m.NotRepeated)
- _notRepeatedErr := io.WriteBit((notRepeated))
- if _notRepeatedErr != nil {
- return errors.New("Error serializing 'notRepeated' field " + _notRepeatedErr.Error())
- }
-
- // Simple Field (notAckFrame)
- notAckFrame := bool(m.NotAckFrame)
- _notAckFrameErr := io.WriteBit((notAckFrame))
- if _notAckFrameErr != nil {
- return errors.New("Error serializing 'notAckFrame' field " + _notAckFrameErr.Error())
- }
-
- // Enum field (priority)
- priority := CastCEMIPriority(m.Priority)
- _priorityErr := priority.Serialize(io)
- if _priorityErr != nil {
- return errors.New("Error serializing 'priority' field " + _priorityErr.Error())
- }
-
- // Simple Field (acknowledgeRequested)
- acknowledgeRequested := bool(m.AcknowledgeRequested)
- _acknowledgeRequestedErr := io.WriteBit((acknowledgeRequested))
- if _acknowledgeRequestedErr != nil {
- return errors.New("Error serializing 'acknowledgeRequested' field " + _acknowledgeRequestedErr.Error())
- }
-
- // Simple Field (errorFlag)
- errorFlag := bool(m.ErrorFlag)
- _errorFlagErr := io.WriteBit((errorFlag))
- if _errorFlagErr != nil {
- return errors.New("Error serializing 'errorFlag' field " + _errorFlagErr.Error())
- }
-
- // Simple Field (groupDestinationAddress)
- groupDestinationAddress := bool(m.GroupDestinationAddress)
- _groupDestinationAddressErr := io.WriteBit((groupDestinationAddress))
- if _groupDestinationAddressErr != nil {
- return errors.New("Error serializing 'groupDestinationAddress' field " + _groupDestinationAddressErr.Error())
- }
-
- // Simple Field (hopCount)
- hopCount := uint8(m.HopCount)
- _hopCountErr := io.WriteUint8(3, (hopCount))
- if _hopCountErr != nil {
- return errors.New("Error serializing 'hopCount' field " + _hopCountErr.Error())
- }
-
- // Simple Field (extendedFrameFormat)
- extendedFrameFormat := uint8(m.ExtendedFrameFormat)
- _extendedFrameFormatErr := io.WriteUint8(4, (extendedFrameFormat))
- if _extendedFrameFormatErr != nil {
- return errors.New("Error serializing 'extendedFrameFormat' field " + _extendedFrameFormatErr.Error())
- }
-
- // Simple Field (sourceAddress)
- _sourceAddressErr := m.SourceAddress.Serialize(io)
- if _sourceAddressErr != nil {
- return errors.New("Error serializing 'sourceAddress' field " + _sourceAddressErr.Error())
- }
-
- // Array Field (destinationAddress)
- if m.DestinationAddress != nil {
- for _, _element := range m.DestinationAddress {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'destinationAddress' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (dataLength)
- dataLength := uint8(m.DataLength)
- _dataLengthErr := io.WriteUint8(8, (dataLength))
- if _dataLengthErr != nil {
- return errors.New("Error serializing 'dataLength' field " + _dataLengthErr.Error())
- }
-
- // Enum field (tcpi)
- tcpi := CastTPCI(m.Tcpi)
- _tcpiErr := tcpi.Serialize(io)
- if _tcpiErr != nil {
- return errors.New("Error serializing 'tcpi' field " + _tcpiErr.Error())
- }
-
- // Simple Field (counter)
- counter := uint8(m.Counter)
- _counterErr := io.WriteUint8(4, (counter))
- if _counterErr != nil {
- return errors.New("Error serializing 'counter' field " + _counterErr.Error())
- }
-
- // Enum field (apci)
- apci := CastAPCI(m.Apci)
- _apciErr := apci.Serialize(io)
- if _apciErr != nil {
- return errors.New("Error serializing 'apci' field " + _apciErr.Error())
- }
-
- // Simple Field (dataFirstByte)
- dataFirstByte := int8(m.DataFirstByte)
- _dataFirstByteErr := io.WriteInt8(6, (dataFirstByte))
- if _dataFirstByteErr != nil {
- return errors.New("Error serializing 'dataFirstByte' field " + _dataFirstByteErr.Error())
- }
-
- // Array Field (data)
- if m.Data != nil {
- for _, _element := range m.Data {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'data' field " + _elementErr.Error())
- }
- }
- }
-
- return nil
-}
-
-func (m *CEMIDataFrame) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "standardFrame":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.StandardFrame = data
- case "polling":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Polling = data
- case "notRepeated":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.NotRepeated = data
- case "notAckFrame":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.NotAckFrame = data
- case "priority":
- var data CEMIPriority
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Priority = data
- case "acknowledgeRequested":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.AcknowledgeRequested = data
- case "errorFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ErrorFlag = data
- case "groupDestinationAddress":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.GroupDestinationAddress = data
- case "hopCount":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.HopCount = data
- case "extendedFrameFormat":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ExtendedFrameFormat = data
- case "sourceAddress":
- var data *KNXAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.SourceAddress = data
- case "destinationAddress":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.DestinationAddress = utils.ByteToInt8(_decoded[0:_len])
- case "dataLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DataLength = data
- case "tcpi":
- var data TPCI
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Tcpi = data
- case "counter":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Counter = data
- case "apci":
- var data APCI
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Apci = data
- case "dataFirstByte":
- var data int8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DataFirstByte = data
- case "data":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.Data = utils.ByteToInt8(_decoded[0:_len])
- }
- }
- }
-}
-
-func (m *CEMIDataFrame) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := "org.apache.plc4x.java.knxnetip.readwrite.CEMIDataFrame"
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.StandardFrame, xml.StartElement{Name: xml.Name{Local: "standardFrame"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Polling, xml.StartElement{Name: xml.Name{Local: "polling"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.NotRepeated, xml.StartElement{Name: xml.Name{Local: "notRepeated"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.NotAckFrame, xml.StartElement{Name: xml.Name{Local: "notAckFrame"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Priority, xml.StartElement{Name: xml.Name{Local: "priority"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.AcknowledgeRequested, xml.StartElement{Name: xml.Name{Local: "acknowledgeRequested"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ErrorFlag, xml.StartElement{Name: xml.Name{Local: "errorFlag"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.GroupDestinationAddress, xml.StartElement{Name: xml.Name{Local: "groupDestinationAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.HopCount, xml.StartElement{Name: xml.Name{Local: "hopCount"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ExtendedFrameFormat, xml.StartElement{Name: xml.Name{Local: "extendedFrameFormat"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.SourceAddress, xml.StartElement{Name: xml.Name{Local: "sourceAddress"}}); err != nil {
- return err
- }
- _encodedDestinationAddress := make([]byte, base64.StdEncoding.EncodedLen(len(m.DestinationAddress)))
- base64.StdEncoding.Encode(_encodedDestinationAddress, utils.Int8ToByte(m.DestinationAddress))
- if err := e.EncodeElement(_encodedDestinationAddress, xml.StartElement{Name: xml.Name{Local: "destinationAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DataLength, xml.StartElement{Name: xml.Name{Local: "dataLength"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Tcpi, xml.StartElement{Name: xml.Name{Local: "tcpi"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Counter, xml.StartElement{Name: xml.Name{Local: "counter"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Apci, xml.StartElement{Name: xml.Name{Local: "apci"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DataFirstByte, xml.StartElement{Name: xml.Name{Local: "dataFirstByte"}}); err != nil {
- return err
- }
- _encodedData := make([]byte, base64.StdEncoding.EncodedLen(len(m.Data)))
- base64.StdEncoding.Encode(_encodedData, utils.Int8ToByte(m.Data))
- if err := e.EncodeElement(_encodedData, xml.StartElement{Name: xml.Name{Local: "data"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataInd.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataInd.go
deleted file mode 100644
index 0a042e5..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataInd.go
+++ /dev/null
@@ -1,237 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIDataInd struct {
- AdditionalInformationLength uint8
- AdditionalInformation []*CEMIAdditionalInformation
- CemiDataFrame *CEMIDataFrame
- Parent *CEMI
- ICEMIDataInd
-}
-
-// The corresponding interface
-type ICEMIDataInd interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIDataInd) MessageCode() uint8 {
- return 0x29
-}
-
-
-func (m *CEMIDataInd) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIDataInd(additionalInformationLength uint8, additionalInformation []*CEMIAdditionalInformation, cemiDataFrame *CEMIDataFrame, ) *CEMI {
- child := &CEMIDataInd{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiDataFrame: cemiDataFrame,
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIDataInd(structType interface{}) CEMIDataInd {
- castFunc := func(typ interface{}) CEMIDataInd {
- if casted, ok := typ.(CEMIDataInd); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIDataInd); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIDataInd(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIDataInd(casted.Child)
- }
- return CEMIDataInd{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIDataInd) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (additionalInformationLength)
- lengthInBits += 8
-
- // Array field
- if len(m.AdditionalInformation) > 0 {
- for _, element := range m.AdditionalInformation {
- lengthInBits += element.LengthInBits()
- }
- }
-
- // Simple field (cemiDataFrame)
- lengthInBits += m.CemiDataFrame.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIDataInd) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIDataIndParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength, _additionalInformationLengthErr := io.ReadUint8(8)
- if _additionalInformationLengthErr != nil {
- return nil, errors.New("Error parsing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array field (additionalInformation)
- // Length array
- additionalInformation := make([]*CEMIAdditionalInformation, 0)
- _additionalInformationLength := additionalInformationLength
- _additionalInformationEndPos := io.GetPos() + uint16(_additionalInformationLength)
- for ;io.GetPos() < _additionalInformationEndPos; {
- _item, _err := CEMIAdditionalInformationParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'additionalInformation' field " + _err.Error())
- }
- additionalInformation = append(additionalInformation, _item)
- }
-
- // Simple Field (cemiDataFrame)
- cemiDataFrame, _cemiDataFrameErr := CEMIDataFrameParse(io)
- if _cemiDataFrameErr != nil {
- return nil, errors.New("Error parsing 'cemiDataFrame' field " + _cemiDataFrameErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIDataInd{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiDataFrame: cemiDataFrame,
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIDataInd) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength := uint8(m.AdditionalInformationLength)
- _additionalInformationLengthErr := io.WriteUint8(8, (additionalInformationLength))
- if _additionalInformationLengthErr != nil {
- return errors.New("Error serializing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array Field (additionalInformation)
- if m.AdditionalInformation != nil {
- for _, _element := range m.AdditionalInformation {
- _elementErr := _element.Serialize(io)
- if _elementErr != nil {
- return errors.New("Error serializing 'additionalInformation' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (cemiDataFrame)
- _cemiDataFrameErr := m.CemiDataFrame.Serialize(io)
- if _cemiDataFrameErr != nil {
- return errors.New("Error serializing 'cemiDataFrame' field " + _cemiDataFrameErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIDataInd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "additionalInformationLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.AdditionalInformationLength = data
- case "additionalInformation":
- var _values []*CEMIAdditionalInformation
- var dt *CEMIAdditionalInformation
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- _values = append(_values, dt)
- m.AdditionalInformation = _values
- case "cemiDataFrame":
- var data *CEMIDataFrame
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.CemiDataFrame = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIDataInd) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.AdditionalInformationLength, xml.StartElement{Name: xml.Name{Local: "additionalInformationLength"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.AdditionalInformation, xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.CemiDataFrame, xml.StartElement{Name: xml.Name{Local: "cemiDataFrame"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataReq.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataReq.go
deleted file mode 100644
index 1bb1226..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIDataReq.go
+++ /dev/null
@@ -1,237 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIDataReq struct {
- AdditionalInformationLength uint8
- AdditionalInformation []*CEMIAdditionalInformation
- CemiDataFrame *CEMIDataFrame
- Parent *CEMI
- ICEMIDataReq
-}
-
-// The corresponding interface
-type ICEMIDataReq interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIDataReq) MessageCode() uint8 {
- return 0x11
-}
-
-
-func (m *CEMIDataReq) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIDataReq(additionalInformationLength uint8, additionalInformation []*CEMIAdditionalInformation, cemiDataFrame *CEMIDataFrame, ) *CEMI {
- child := &CEMIDataReq{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiDataFrame: cemiDataFrame,
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIDataReq(structType interface{}) CEMIDataReq {
- castFunc := func(typ interface{}) CEMIDataReq {
- if casted, ok := typ.(CEMIDataReq); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIDataReq); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIDataReq(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIDataReq(casted.Child)
- }
- return CEMIDataReq{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIDataReq) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (additionalInformationLength)
- lengthInBits += 8
-
- // Array field
- if len(m.AdditionalInformation) > 0 {
- for _, element := range m.AdditionalInformation {
- lengthInBits += element.LengthInBits()
- }
- }
-
- // Simple field (cemiDataFrame)
- lengthInBits += m.CemiDataFrame.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIDataReq) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIDataReqParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength, _additionalInformationLengthErr := io.ReadUint8(8)
- if _additionalInformationLengthErr != nil {
- return nil, errors.New("Error parsing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array field (additionalInformation)
- // Length array
- additionalInformation := make([]*CEMIAdditionalInformation, 0)
- _additionalInformationLength := additionalInformationLength
- _additionalInformationEndPos := io.GetPos() + uint16(_additionalInformationLength)
- for ;io.GetPos() < _additionalInformationEndPos; {
- _item, _err := CEMIAdditionalInformationParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'additionalInformation' field " + _err.Error())
- }
- additionalInformation = append(additionalInformation, _item)
- }
-
- // Simple Field (cemiDataFrame)
- cemiDataFrame, _cemiDataFrameErr := CEMIDataFrameParse(io)
- if _cemiDataFrameErr != nil {
- return nil, errors.New("Error parsing 'cemiDataFrame' field " + _cemiDataFrameErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIDataReq{
- AdditionalInformationLength: additionalInformationLength,
- AdditionalInformation: additionalInformation,
- CemiDataFrame: cemiDataFrame,
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIDataReq) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (additionalInformationLength)
- additionalInformationLength := uint8(m.AdditionalInformationLength)
- _additionalInformationLengthErr := io.WriteUint8(8, (additionalInformationLength))
- if _additionalInformationLengthErr != nil {
- return errors.New("Error serializing 'additionalInformationLength' field " + _additionalInformationLengthErr.Error())
- }
-
- // Array Field (additionalInformation)
- if m.AdditionalInformation != nil {
- for _, _element := range m.AdditionalInformation {
- _elementErr := _element.Serialize(io)
- if _elementErr != nil {
- return errors.New("Error serializing 'additionalInformation' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (cemiDataFrame)
- _cemiDataFrameErr := m.CemiDataFrame.Serialize(io)
- if _cemiDataFrameErr != nil {
- return errors.New("Error serializing 'cemiDataFrame' field " + _cemiDataFrameErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIDataReq) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "additionalInformationLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.AdditionalInformationLength = data
- case "additionalInformation":
- var _values []*CEMIAdditionalInformation
- var dt *CEMIAdditionalInformation
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- _values = append(_values, dt)
- m.AdditionalInformation = _values
- case "cemiDataFrame":
- var data *CEMIDataFrame
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.CemiDataFrame = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIDataReq) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.AdditionalInformationLength, xml.StartElement{Name: xml.Name{Local: "additionalInformationLength"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.AdditionalInformation, xml.StartElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "additionalInformation"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.CemiDataFrame, xml.StartElement{Name: xml.Name{Local: "cemiDataFrame"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrame.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrame.go
deleted file mode 100644
index 400daed..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrame.go
+++ /dev/null
@@ -1,382 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "reflect"
- "strings"
-)
-
-// The data-structure of this message
-type CEMIFrame struct {
- Repeated bool
- Priority CEMIPriority
- AcknowledgeRequested bool
- ErrorFlag bool
- Child ICEMIFrameChild
- ICEMIFrame
- ICEMIFrameParent
-}
-
-// The corresponding interface
-type ICEMIFrame interface {
- NotAckFrame() bool
- Polling() bool
- StandardFrame() bool
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-type ICEMIFrameParent interface {
- SerializeParent(io utils.WriteBuffer, child ICEMIFrame, serializeChildFunction func() error) error
-}
-
-type ICEMIFrameChild interface {
- Serialize(io utils.WriteBuffer) error
- InitializeParent(parent *CEMIFrame, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool)
- ICEMIFrame
-}
-
-func NewCEMIFrame(repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) *CEMIFrame {
- return &CEMIFrame{Repeated: repeated, Priority: priority, AcknowledgeRequested: acknowledgeRequested, ErrorFlag: errorFlag}
-}
-
-func CastCEMIFrame(structType interface{}) CEMIFrame {
- castFunc := func(typ interface{}) CEMIFrame {
- if casted, ok := typ.(CEMIFrame); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIFrame); ok {
- return *casted
- }
- return CEMIFrame{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIFrame) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Discriminator Field (standardFrame)
- lengthInBits += 1
-
- // Discriminator Field (polling)
- lengthInBits += 1
-
- // Simple field (repeated)
- lengthInBits += 1
-
- // Discriminator Field (notAckFrame)
- lengthInBits += 1
-
- // Enum Field (priority)
- lengthInBits += 2
-
- // Simple field (acknowledgeRequested)
- lengthInBits += 1
-
- // Simple field (errorFlag)
- lengthInBits += 1
-
- // Length of sub-type elements will be added by sub-type...
- lengthInBits += m.Child.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *CEMIFrame) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIFrameParse(io *utils.ReadBuffer) (*CEMIFrame, error) {
-
- // Discriminator Field (standardFrame) (Used as input to a switch field)
- standardFrame, _standardFrameErr := io.ReadBit()
- if _standardFrameErr != nil {
- return nil, errors.New("Error parsing 'standardFrame' field " + _standardFrameErr.Error())
- }
-
- // Discriminator Field (polling) (Used as input to a switch field)
- polling, _pollingErr := io.ReadBit()
- if _pollingErr != nil {
- return nil, errors.New("Error parsing 'polling' field " + _pollingErr.Error())
- }
-
- // Simple Field (repeated)
- repeated, _repeatedErr := io.ReadBit()
- if _repeatedErr != nil {
- return nil, errors.New("Error parsing 'repeated' field " + _repeatedErr.Error())
- }
-
- // Discriminator Field (notAckFrame) (Used as input to a switch field)
- notAckFrame, _notAckFrameErr := io.ReadBit()
- if _notAckFrameErr != nil {
- return nil, errors.New("Error parsing 'notAckFrame' field " + _notAckFrameErr.Error())
- }
-
- // Enum field (priority)
- priority, _priorityErr := CEMIPriorityParse(io)
- if _priorityErr != nil {
- return nil, errors.New("Error parsing 'priority' field " + _priorityErr.Error())
- }
-
- // Simple Field (acknowledgeRequested)
- acknowledgeRequested, _acknowledgeRequestedErr := io.ReadBit()
- if _acknowledgeRequestedErr != nil {
- return nil, errors.New("Error parsing 'acknowledgeRequested' field " + _acknowledgeRequestedErr.Error())
- }
-
- // Simple Field (errorFlag)
- errorFlag, _errorFlagErr := io.ReadBit()
- if _errorFlagErr != nil {
- return nil, errors.New("Error parsing 'errorFlag' field " + _errorFlagErr.Error())
- }
-
- // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
- var _parent *CEMIFrame
- var typeSwitchError error
- switch {
- case notAckFrame == false:
- _parent, typeSwitchError = CEMIFrameAckParse(io)
- case notAckFrame == true && standardFrame == true && polling == false:
- _parent, typeSwitchError = CEMIFrameDataParse(io)
- case notAckFrame == true && standardFrame == true && polling == true:
- _parent, typeSwitchError = CEMIFramePollingDataParse(io)
- case notAckFrame == true && standardFrame == false && polling == false:
- _parent, typeSwitchError = CEMIFrameDataExtParse(io)
- case notAckFrame == true && standardFrame == false && polling == true:
- _parent, typeSwitchError = CEMIFramePollingDataExtParse(io)
- }
- if typeSwitchError != nil {
- return nil, errors.New("Error parsing sub-type for type-switch. " + typeSwitchError.Error())
- }
-
- // Finish initializing
- _parent.Child.InitializeParent(_parent, repeated, priority, acknowledgeRequested, errorFlag)
- return _parent, nil
-}
-
-func (m *CEMIFrame) Serialize(io utils.WriteBuffer) error {
- return m.Child.Serialize(io)
-}
-
-func (m *CEMIFrame) SerializeParent(io utils.WriteBuffer, child ICEMIFrame, serializeChildFunction func() error) error {
-
- // Discriminator Field (standardFrame) (Used as input to a switch field)
- standardFrame := bool(child.StandardFrame())
- _standardFrameErr := io.WriteBit((standardFrame))
- if _standardFrameErr != nil {
- return errors.New("Error serializing 'standardFrame' field " + _standardFrameErr.Error())
- }
-
- // Discriminator Field (polling) (Used as input to a switch field)
- polling := bool(child.Polling())
- _pollingErr := io.WriteBit((polling))
- if _pollingErr != nil {
- return errors.New("Error serializing 'polling' field " + _pollingErr.Error())
- }
-
- // Simple Field (repeated)
- repeated := bool(m.Repeated)
- _repeatedErr := io.WriteBit((repeated))
- if _repeatedErr != nil {
- return errors.New("Error serializing 'repeated' field " + _repeatedErr.Error())
- }
-
- // Discriminator Field (notAckFrame) (Used as input to a switch field)
- notAckFrame := bool(child.NotAckFrame())
- _notAckFrameErr := io.WriteBit((notAckFrame))
- if _notAckFrameErr != nil {
- return errors.New("Error serializing 'notAckFrame' field " + _notAckFrameErr.Error())
- }
-
- // Enum field (priority)
- priority := CastCEMIPriority(m.Priority)
- _priorityErr := priority.Serialize(io)
- if _priorityErr != nil {
- return errors.New("Error serializing 'priority' field " + _priorityErr.Error())
- }
-
- // Simple Field (acknowledgeRequested)
- acknowledgeRequested := bool(m.AcknowledgeRequested)
- _acknowledgeRequestedErr := io.WriteBit((acknowledgeRequested))
- if _acknowledgeRequestedErr != nil {
- return errors.New("Error serializing 'acknowledgeRequested' field " + _acknowledgeRequestedErr.Error())
- }
-
- // Simple Field (errorFlag)
- errorFlag := bool(m.ErrorFlag)
- _errorFlagErr := io.WriteBit((errorFlag))
- if _errorFlagErr != nil {
- return errors.New("Error serializing 'errorFlag' field " + _errorFlagErr.Error())
- }
-
- // Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
- _typeSwitchErr := serializeChildFunction()
- if _typeSwitchErr != nil {
- return errors.New("Error serializing sub-type field " + _typeSwitchErr.Error())
- }
-
- return nil
-}
-
-func (m *CEMIFrame) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "repeated":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Repeated = data
- case "priority":
- var data CEMIPriority
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Priority = data
- case "acknowledgeRequested":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.AcknowledgeRequested = data
- case "errorFlag":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ErrorFlag = data
- default:
- switch start.Attr[0].Value {
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIFrameAck":
- var dt *CEMIFrameAck
- if m.Child != nil {
- dt = m.Child.(*CEMIFrameAck)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIFrameData":
- var dt *CEMIFrameData
- if m.Child != nil {
- dt = m.Child.(*CEMIFrameData)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIFramePollingData":
- var dt *CEMIFramePollingData
- if m.Child != nil {
- dt = m.Child.(*CEMIFramePollingData)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIFrameDataExt":
- var dt *CEMIFrameDataExt
- if m.Child != nil {
- dt = m.Child.(*CEMIFrameDataExt)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.CEMIFramePollingDataExt":
- var dt *CEMIFramePollingDataExt
- if m.Child != nil {
- dt = m.Child.(*CEMIFramePollingDataExt)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- }
- }
- }
- }
-}
-
-func (m *CEMIFrame) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := reflect.TypeOf(m.Child).String()
- className = "org.apache.plc4x.java.knxnetip.readwrite." + className[strings.LastIndex(className, ".") + 1:]
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Repeated, xml.StartElement{Name: xml.Name{Local: "repeated"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Priority, xml.StartElement{Name: xml.Name{Local: "priority"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.AcknowledgeRequested, xml.StartElement{Name: xml.Name{Local: "acknowledgeRequested"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ErrorFlag, xml.StartElement{Name: xml.Name{Local: "errorFlag"}}); err != nil {
- return err
- }
- marshaller, ok := m.Child.(xml.Marshaler)
- if !ok {
- return errors.New("child is not castable to Marshaler")
- }
- marshaller.MarshalXML(e, start)
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameAck.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameAck.go
deleted file mode 100644
index bc90b17..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameAck.go
+++ /dev/null
@@ -1,143 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIFrameAck struct {
- Parent *CEMIFrame
- ICEMIFrameAck
-}
-
-// The corresponding interface
-type ICEMIFrameAck interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIFrameAck) NotAckFrame() bool {
- return false
-}
-
-func (m *CEMIFrameAck) StandardFrame() bool {
- return false
-}
-
-func (m *CEMIFrameAck) Polling() bool {
- return false
-}
-
-
-func (m *CEMIFrameAck) InitializeParent(parent *CEMIFrame, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) {
- m.Parent.Repeated = repeated
- m.Parent.Priority = priority
- m.Parent.AcknowledgeRequested = acknowledgeRequested
- m.Parent.ErrorFlag = errorFlag
-}
-
-func NewCEMIFrameAck(repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) *CEMIFrame {
- child := &CEMIFrameAck{
- Parent: NewCEMIFrame(repeated, priority, acknowledgeRequested, errorFlag),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIFrameAck(structType interface{}) CEMIFrameAck {
- castFunc := func(typ interface{}) CEMIFrameAck {
- if casted, ok := typ.(CEMIFrameAck); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIFrameAck); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIFrame); ok {
- return CastCEMIFrameAck(casted.Child)
- }
- if casted, ok := typ.(*CEMIFrame); ok {
- return CastCEMIFrameAck(casted.Child)
- }
- return CEMIFrameAck{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIFrameAck) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIFrameAck) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIFrameAckParse(io *utils.ReadBuffer) (*CEMIFrame, error) {
-
- // Create a partially initialized instance
- _child := &CEMIFrameAck{
- Parent: &CEMIFrame{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIFrameAck) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIFrameAck) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIFrameAck) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameData.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameData.go
deleted file mode 100644
index f7a89d5..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameData.go
+++ /dev/null
@@ -1,486 +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 (
- "encoding/base64"
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIFrameData struct {
- SourceAddress *KNXAddress
- DestinationAddress []int8
- GroupAddress bool
- HopCount uint8
- DataLength uint8
- Tcpi TPCI
- Counter uint8
- Apci APCI
- DataFirstByte int8
- Data []int8
- Crc uint8
- Parent *CEMIFrame
- ICEMIFrameData
-}
-
-// The corresponding interface
-type ICEMIFrameData interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIFrameData) NotAckFrame() bool {
- return true
-}
-
-func (m *CEMIFrameData) StandardFrame() bool {
- return true
-}
-
-func (m *CEMIFrameData) Polling() bool {
- return false
-}
-
-
-func (m *CEMIFrameData) InitializeParent(parent *CEMIFrame, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) {
- m.Parent.Repeated = repeated
- m.Parent.Priority = priority
- m.Parent.AcknowledgeRequested = acknowledgeRequested
- m.Parent.ErrorFlag = errorFlag
-}
-
-func NewCEMIFrameData(sourceAddress *KNXAddress, destinationAddress []int8, groupAddress bool, hopCount uint8, dataLength uint8, tcpi TPCI, counter uint8, apci APCI, dataFirstByte int8, data []int8, crc uint8, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) *CEMIFrame {
- child := &CEMIFrameData{
- SourceAddress: sourceAddress,
- DestinationAddress: destinationAddress,
- GroupAddress: groupAddress,
- HopCount: hopCount,
- DataLength: dataLength,
- Tcpi: tcpi,
- Counter: counter,
- Apci: apci,
- DataFirstByte: dataFirstByte,
- Data: data,
- Crc: crc,
- Parent: NewCEMIFrame(repeated, priority, acknowledgeRequested, errorFlag),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIFrameData(structType interface{}) CEMIFrameData {
- castFunc := func(typ interface{}) CEMIFrameData {
- if casted, ok := typ.(CEMIFrameData); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIFrameData); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIFrame); ok {
- return CastCEMIFrameData(casted.Child)
- }
- if casted, ok := typ.(*CEMIFrame); ok {
- return CastCEMIFrameData(casted.Child)
- }
- return CEMIFrameData{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIFrameData) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (sourceAddress)
- lengthInBits += m.SourceAddress.LengthInBits()
-
- // Array field
- if len(m.DestinationAddress) > 0 {
- lengthInBits += 8 * uint16(len(m.DestinationAddress))
- }
-
- // Simple field (groupAddress)
- lengthInBits += 1
-
- // Simple field (hopCount)
- lengthInBits += 3
-
- // Simple field (dataLength)
- lengthInBits += 4
-
- // Enum Field (tcpi)
- lengthInBits += 2
-
- // Simple field (counter)
- lengthInBits += 4
-
- // Enum Field (apci)
- lengthInBits += 4
-
- // Simple field (dataFirstByte)
- lengthInBits += 6
-
- // Array field
- if len(m.Data) > 0 {
- lengthInBits += 8 * uint16(len(m.Data))
- }
-
- // Simple field (crc)
- lengthInBits += 8
-
- return lengthInBits
-}
-
-func (m *CEMIFrameData) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIFrameDataParse(io *utils.ReadBuffer) (*CEMIFrame, error) {
-
- // Simple Field (sourceAddress)
- sourceAddress, _sourceAddressErr := KNXAddressParse(io)
- if _sourceAddressErr != nil {
- return nil, errors.New("Error parsing 'sourceAddress' field " + _sourceAddressErr.Error())
- }
-
- // Array field (destinationAddress)
- // Count array
- destinationAddress := make([]int8, uint16(2))
- for curItem := uint16(0); curItem < uint16(uint16(2)); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'destinationAddress' field " + _err.Error())
- }
- destinationAddress[curItem] = _item
- }
-
- // Simple Field (groupAddress)
- groupAddress, _groupAddressErr := io.ReadBit()
- if _groupAddressErr != nil {
- return nil, errors.New("Error parsing 'groupAddress' field " + _groupAddressErr.Error())
- }
-
- // Simple Field (hopCount)
- hopCount, _hopCountErr := io.ReadUint8(3)
- if _hopCountErr != nil {
- return nil, errors.New("Error parsing 'hopCount' field " + _hopCountErr.Error())
- }
-
- // Simple Field (dataLength)
- dataLength, _dataLengthErr := io.ReadUint8(4)
- if _dataLengthErr != nil {
- return nil, errors.New("Error parsing 'dataLength' field " + _dataLengthErr.Error())
- }
-
- // Enum field (tcpi)
- tcpi, _tcpiErr := TPCIParse(io)
- if _tcpiErr != nil {
- return nil, errors.New("Error parsing 'tcpi' field " + _tcpiErr.Error())
- }
-
- // Simple Field (counter)
- counter, _counterErr := io.ReadUint8(4)
- if _counterErr != nil {
- return nil, errors.New("Error parsing 'counter' field " + _counterErr.Error())
- }
-
- // Enum field (apci)
- apci, _apciErr := APCIParse(io)
- if _apciErr != nil {
- return nil, errors.New("Error parsing 'apci' field " + _apciErr.Error())
- }
-
- // Simple Field (dataFirstByte)
- dataFirstByte, _dataFirstByteErr := io.ReadInt8(6)
- if _dataFirstByteErr != nil {
- return nil, errors.New("Error parsing 'dataFirstByte' field " + _dataFirstByteErr.Error())
- }
-
- // Array field (data)
- // Count array
- data := make([]int8, uint16(dataLength) - uint16(uint16(1)))
- for curItem := uint16(0); curItem < uint16(uint16(dataLength) - uint16(uint16(1))); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'data' field " + _err.Error())
- }
- data[curItem] = _item
- }
-
- // Simple Field (crc)
- crc, _crcErr := io.ReadUint8(8)
- if _crcErr != nil {
- return nil, errors.New("Error parsing 'crc' field " + _crcErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIFrameData{
- SourceAddress: sourceAddress,
- DestinationAddress: destinationAddress,
- GroupAddress: groupAddress,
- HopCount: hopCount,
- DataLength: dataLength,
- Tcpi: tcpi,
- Counter: counter,
- Apci: apci,
- DataFirstByte: dataFirstByte,
- Data: data,
- Crc: crc,
- Parent: &CEMIFrame{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIFrameData) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (sourceAddress)
- _sourceAddressErr := m.SourceAddress.Serialize(io)
- if _sourceAddressErr != nil {
- return errors.New("Error serializing 'sourceAddress' field " + _sourceAddressErr.Error())
- }
-
- // Array Field (destinationAddress)
- if m.DestinationAddress != nil {
- for _, _element := range m.DestinationAddress {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'destinationAddress' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (groupAddress)
- groupAddress := bool(m.GroupAddress)
- _groupAddressErr := io.WriteBit((groupAddress))
- if _groupAddressErr != nil {
- return errors.New("Error serializing 'groupAddress' field " + _groupAddressErr.Error())
- }
-
- // Simple Field (hopCount)
- hopCount := uint8(m.HopCount)
- _hopCountErr := io.WriteUint8(3, (hopCount))
- if _hopCountErr != nil {
- return errors.New("Error serializing 'hopCount' field " + _hopCountErr.Error())
- }
-
- // Simple Field (dataLength)
- dataLength := uint8(m.DataLength)
- _dataLengthErr := io.WriteUint8(4, (dataLength))
- if _dataLengthErr != nil {
- return errors.New("Error serializing 'dataLength' field " + _dataLengthErr.Error())
- }
-
- // Enum field (tcpi)
- tcpi := CastTPCI(m.Tcpi)
- _tcpiErr := tcpi.Serialize(io)
- if _tcpiErr != nil {
- return errors.New("Error serializing 'tcpi' field " + _tcpiErr.Error())
- }
-
- // Simple Field (counter)
- counter := uint8(m.Counter)
- _counterErr := io.WriteUint8(4, (counter))
- if _counterErr != nil {
- return errors.New("Error serializing 'counter' field " + _counterErr.Error())
- }
-
- // Enum field (apci)
- apci := CastAPCI(m.Apci)
- _apciErr := apci.Serialize(io)
- if _apciErr != nil {
- return errors.New("Error serializing 'apci' field " + _apciErr.Error())
- }
-
- // Simple Field (dataFirstByte)
- dataFirstByte := int8(m.DataFirstByte)
- _dataFirstByteErr := io.WriteInt8(6, (dataFirstByte))
- if _dataFirstByteErr != nil {
- return errors.New("Error serializing 'dataFirstByte' field " + _dataFirstByteErr.Error())
- }
-
- // Array Field (data)
- if m.Data != nil {
- for _, _element := range m.Data {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'data' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (crc)
- crc := uint8(m.Crc)
- _crcErr := io.WriteUint8(8, (crc))
- if _crcErr != nil {
- return errors.New("Error serializing 'crc' field " + _crcErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIFrameData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "sourceAddress":
- var data *KNXAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.SourceAddress = data
- case "destinationAddress":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.DestinationAddress = utils.ByteToInt8(_decoded[0:_len])
- case "groupAddress":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.GroupAddress = data
- case "hopCount":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.HopCount = data
- case "dataLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DataLength = data
- case "tcpi":
- var data TPCI
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Tcpi = data
- case "counter":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Counter = data
- case "apci":
- var data APCI
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Apci = data
- case "dataFirstByte":
- var data int8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DataFirstByte = data
- case "data":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.Data = utils.ByteToInt8(_decoded[0:_len])
- case "crc":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Crc = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIFrameData) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.SourceAddress, xml.StartElement{Name: xml.Name{Local: "sourceAddress"}}); err != nil {
- return err
- }
- _encodedDestinationAddress := make([]byte, base64.StdEncoding.EncodedLen(len(m.DestinationAddress)))
- base64.StdEncoding.Encode(_encodedDestinationAddress, utils.Int8ToByte(m.DestinationAddress))
- if err := e.EncodeElement(_encodedDestinationAddress, xml.StartElement{Name: xml.Name{Local: "destinationAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.GroupAddress, xml.StartElement{Name: xml.Name{Local: "groupAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.HopCount, xml.StartElement{Name: xml.Name{Local: "hopCount"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DataLength, xml.StartElement{Name: xml.Name{Local: "dataLength"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Tcpi, xml.StartElement{Name: xml.Name{Local: "tcpi"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Counter, xml.StartElement{Name: xml.Name{Local: "counter"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Apci, xml.StartElement{Name: xml.Name{Local: "apci"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DataFirstByte, xml.StartElement{Name: xml.Name{Local: "dataFirstByte"}}); err != nil {
- return err
- }
- _encodedData := make([]byte, base64.StdEncoding.EncodedLen(len(m.Data)))
- base64.StdEncoding.Encode(_encodedData, utils.Int8ToByte(m.Data))
- if err := e.EncodeElement(_encodedData, xml.StartElement{Name: xml.Name{Local: "data"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Crc, xml.StartElement{Name: xml.Name{Local: "crc"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameDataExt.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameDataExt.go
deleted file mode 100644
index b35ed0f..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFrameDataExt.go
+++ /dev/null
@@ -1,514 +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 (
- "encoding/base64"
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIFrameDataExt struct {
- GroupAddress bool
- HopCount uint8
- ExtendedFrameFormat uint8
- SourceAddress *KNXAddress
- DestinationAddress []int8
- DataLength uint8
- Tcpi TPCI
- Counter uint8
- Apci APCI
- DataFirstByte int8
- Data []int8
- Crc uint8
- Parent *CEMIFrame
- ICEMIFrameDataExt
-}
-
-// The corresponding interface
-type ICEMIFrameDataExt interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIFrameDataExt) NotAckFrame() bool {
- return true
-}
-
-func (m *CEMIFrameDataExt) StandardFrame() bool {
- return false
-}
-
-func (m *CEMIFrameDataExt) Polling() bool {
- return false
-}
-
-
-func (m *CEMIFrameDataExt) InitializeParent(parent *CEMIFrame, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) {
- m.Parent.Repeated = repeated
- m.Parent.Priority = priority
- m.Parent.AcknowledgeRequested = acknowledgeRequested
- m.Parent.ErrorFlag = errorFlag
-}
-
-func NewCEMIFrameDataExt(groupAddress bool, hopCount uint8, extendedFrameFormat uint8, sourceAddress *KNXAddress, destinationAddress []int8, dataLength uint8, tcpi TPCI, counter uint8, apci APCI, dataFirstByte int8, data []int8, crc uint8, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) *CEMIFrame {
- child := &CEMIFrameDataExt{
- GroupAddress: groupAddress,
- HopCount: hopCount,
- ExtendedFrameFormat: extendedFrameFormat,
- SourceAddress: sourceAddress,
- DestinationAddress: destinationAddress,
- DataLength: dataLength,
- Tcpi: tcpi,
- Counter: counter,
- Apci: apci,
- DataFirstByte: dataFirstByte,
- Data: data,
- Crc: crc,
- Parent: NewCEMIFrame(repeated, priority, acknowledgeRequested, errorFlag),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIFrameDataExt(structType interface{}) CEMIFrameDataExt {
- castFunc := func(typ interface{}) CEMIFrameDataExt {
- if casted, ok := typ.(CEMIFrameDataExt); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIFrameDataExt); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIFrame); ok {
- return CastCEMIFrameDataExt(casted.Child)
- }
- if casted, ok := typ.(*CEMIFrame); ok {
- return CastCEMIFrameDataExt(casted.Child)
- }
- return CEMIFrameDataExt{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIFrameDataExt) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (groupAddress)
- lengthInBits += 1
-
- // Simple field (hopCount)
- lengthInBits += 3
-
- // Simple field (extendedFrameFormat)
- lengthInBits += 4
-
- // Simple field (sourceAddress)
- lengthInBits += m.SourceAddress.LengthInBits()
-
- // Array field
- if len(m.DestinationAddress) > 0 {
- lengthInBits += 8 * uint16(len(m.DestinationAddress))
- }
-
- // Simple field (dataLength)
- lengthInBits += 8
-
- // Enum Field (tcpi)
- lengthInBits += 2
-
- // Simple field (counter)
- lengthInBits += 4
-
- // Enum Field (apci)
- lengthInBits += 4
-
- // Simple field (dataFirstByte)
- lengthInBits += 6
-
- // Array field
- if len(m.Data) > 0 {
- lengthInBits += 8 * uint16(len(m.Data))
- }
-
- // Simple field (crc)
- lengthInBits += 8
-
- return lengthInBits
-}
-
-func (m *CEMIFrameDataExt) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIFrameDataExtParse(io *utils.ReadBuffer) (*CEMIFrame, error) {
-
- // Simple Field (groupAddress)
- groupAddress, _groupAddressErr := io.ReadBit()
- if _groupAddressErr != nil {
- return nil, errors.New("Error parsing 'groupAddress' field " + _groupAddressErr.Error())
- }
-
- // Simple Field (hopCount)
- hopCount, _hopCountErr := io.ReadUint8(3)
- if _hopCountErr != nil {
- return nil, errors.New("Error parsing 'hopCount' field " + _hopCountErr.Error())
- }
-
- // Simple Field (extendedFrameFormat)
- extendedFrameFormat, _extendedFrameFormatErr := io.ReadUint8(4)
- if _extendedFrameFormatErr != nil {
- return nil, errors.New("Error parsing 'extendedFrameFormat' field " + _extendedFrameFormatErr.Error())
- }
-
- // Simple Field (sourceAddress)
- sourceAddress, _sourceAddressErr := KNXAddressParse(io)
- if _sourceAddressErr != nil {
- return nil, errors.New("Error parsing 'sourceAddress' field " + _sourceAddressErr.Error())
- }
-
- // Array field (destinationAddress)
- // Count array
- destinationAddress := make([]int8, uint16(2))
- for curItem := uint16(0); curItem < uint16(uint16(2)); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'destinationAddress' field " + _err.Error())
- }
- destinationAddress[curItem] = _item
- }
-
- // Simple Field (dataLength)
- dataLength, _dataLengthErr := io.ReadUint8(8)
- if _dataLengthErr != nil {
- return nil, errors.New("Error parsing 'dataLength' field " + _dataLengthErr.Error())
- }
-
- // Enum field (tcpi)
- tcpi, _tcpiErr := TPCIParse(io)
- if _tcpiErr != nil {
- return nil, errors.New("Error parsing 'tcpi' field " + _tcpiErr.Error())
- }
-
- // Simple Field (counter)
- counter, _counterErr := io.ReadUint8(4)
- if _counterErr != nil {
- return nil, errors.New("Error parsing 'counter' field " + _counterErr.Error())
- }
-
- // Enum field (apci)
- apci, _apciErr := APCIParse(io)
- if _apciErr != nil {
- return nil, errors.New("Error parsing 'apci' field " + _apciErr.Error())
- }
-
- // Simple Field (dataFirstByte)
- dataFirstByte, _dataFirstByteErr := io.ReadInt8(6)
- if _dataFirstByteErr != nil {
- return nil, errors.New("Error parsing 'dataFirstByte' field " + _dataFirstByteErr.Error())
- }
-
- // Array field (data)
- // Count array
- data := make([]int8, uint16(dataLength) - uint16(uint16(1)))
- for curItem := uint16(0); curItem < uint16(uint16(dataLength) - uint16(uint16(1))); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'data' field " + _err.Error())
- }
- data[curItem] = _item
- }
-
- // Simple Field (crc)
- crc, _crcErr := io.ReadUint8(8)
- if _crcErr != nil {
- return nil, errors.New("Error parsing 'crc' field " + _crcErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIFrameDataExt{
- GroupAddress: groupAddress,
- HopCount: hopCount,
- ExtendedFrameFormat: extendedFrameFormat,
- SourceAddress: sourceAddress,
- DestinationAddress: destinationAddress,
- DataLength: dataLength,
- Tcpi: tcpi,
- Counter: counter,
- Apci: apci,
- DataFirstByte: dataFirstByte,
- Data: data,
- Crc: crc,
- Parent: &CEMIFrame{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIFrameDataExt) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (groupAddress)
- groupAddress := bool(m.GroupAddress)
- _groupAddressErr := io.WriteBit((groupAddress))
- if _groupAddressErr != nil {
- return errors.New("Error serializing 'groupAddress' field " + _groupAddressErr.Error())
- }
-
- // Simple Field (hopCount)
- hopCount := uint8(m.HopCount)
- _hopCountErr := io.WriteUint8(3, (hopCount))
- if _hopCountErr != nil {
- return errors.New("Error serializing 'hopCount' field " + _hopCountErr.Error())
- }
-
- // Simple Field (extendedFrameFormat)
- extendedFrameFormat := uint8(m.ExtendedFrameFormat)
- _extendedFrameFormatErr := io.WriteUint8(4, (extendedFrameFormat))
- if _extendedFrameFormatErr != nil {
- return errors.New("Error serializing 'extendedFrameFormat' field " + _extendedFrameFormatErr.Error())
- }
-
- // Simple Field (sourceAddress)
- _sourceAddressErr := m.SourceAddress.Serialize(io)
- if _sourceAddressErr != nil {
- return errors.New("Error serializing 'sourceAddress' field " + _sourceAddressErr.Error())
- }
-
- // Array Field (destinationAddress)
- if m.DestinationAddress != nil {
- for _, _element := range m.DestinationAddress {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'destinationAddress' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (dataLength)
- dataLength := uint8(m.DataLength)
- _dataLengthErr := io.WriteUint8(8, (dataLength))
- if _dataLengthErr != nil {
- return errors.New("Error serializing 'dataLength' field " + _dataLengthErr.Error())
- }
-
- // Enum field (tcpi)
- tcpi := CastTPCI(m.Tcpi)
- _tcpiErr := tcpi.Serialize(io)
- if _tcpiErr != nil {
- return errors.New("Error serializing 'tcpi' field " + _tcpiErr.Error())
- }
-
- // Simple Field (counter)
- counter := uint8(m.Counter)
- _counterErr := io.WriteUint8(4, (counter))
- if _counterErr != nil {
- return errors.New("Error serializing 'counter' field " + _counterErr.Error())
- }
-
- // Enum field (apci)
- apci := CastAPCI(m.Apci)
- _apciErr := apci.Serialize(io)
- if _apciErr != nil {
- return errors.New("Error serializing 'apci' field " + _apciErr.Error())
- }
-
- // Simple Field (dataFirstByte)
- dataFirstByte := int8(m.DataFirstByte)
- _dataFirstByteErr := io.WriteInt8(6, (dataFirstByte))
- if _dataFirstByteErr != nil {
- return errors.New("Error serializing 'dataFirstByte' field " + _dataFirstByteErr.Error())
- }
-
- // Array Field (data)
- if m.Data != nil {
- for _, _element := range m.Data {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'data' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (crc)
- crc := uint8(m.Crc)
- _crcErr := io.WriteUint8(8, (crc))
- if _crcErr != nil {
- return errors.New("Error serializing 'crc' field " + _crcErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIFrameDataExt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "groupAddress":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.GroupAddress = data
- case "hopCount":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.HopCount = data
- case "extendedFrameFormat":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ExtendedFrameFormat = data
- case "sourceAddress":
- var data *KNXAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.SourceAddress = data
- case "destinationAddress":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.DestinationAddress = utils.ByteToInt8(_decoded[0:_len])
- case "dataLength":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DataLength = data
- case "tcpi":
- var data TPCI
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Tcpi = data
- case "counter":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Counter = data
- case "apci":
- var data APCI
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Apci = data
- case "dataFirstByte":
- var data int8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DataFirstByte = data
- case "data":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.Data = utils.ByteToInt8(_decoded[0:_len])
- case "crc":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Crc = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIFrameDataExt) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.GroupAddress, xml.StartElement{Name: xml.Name{Local: "groupAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.HopCount, xml.StartElement{Name: xml.Name{Local: "hopCount"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ExtendedFrameFormat, xml.StartElement{Name: xml.Name{Local: "extendedFrameFormat"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.SourceAddress, xml.StartElement{Name: xml.Name{Local: "sourceAddress"}}); err != nil {
- return err
- }
- _encodedDestinationAddress := make([]byte, base64.StdEncoding.EncodedLen(len(m.DestinationAddress)))
- base64.StdEncoding.Encode(_encodedDestinationAddress, utils.Int8ToByte(m.DestinationAddress))
- if err := e.EncodeElement(_encodedDestinationAddress, xml.StartElement{Name: xml.Name{Local: "destinationAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DataLength, xml.StartElement{Name: xml.Name{Local: "dataLength"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Tcpi, xml.StartElement{Name: xml.Name{Local: "tcpi"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Counter, xml.StartElement{Name: xml.Name{Local: "counter"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Apci, xml.StartElement{Name: xml.Name{Local: "apci"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DataFirstByte, xml.StartElement{Name: xml.Name{Local: "dataFirstByte"}}); err != nil {
- return err
- }
- _encodedData := make([]byte, base64.StdEncoding.EncodedLen(len(m.Data)))
- base64.StdEncoding.Encode(_encodedData, utils.Int8ToByte(m.Data))
- if err := e.EncodeElement(_encodedData, xml.StartElement{Name: xml.Name{Local: "data"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Crc, xml.StartElement{Name: xml.Name{Local: "crc"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFramePollingData.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFramePollingData.go
deleted file mode 100644
index 092e873..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFramePollingData.go
+++ /dev/null
@@ -1,143 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIFramePollingData struct {
- Parent *CEMIFrame
- ICEMIFramePollingData
-}
-
-// The corresponding interface
-type ICEMIFramePollingData interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIFramePollingData) NotAckFrame() bool {
- return true
-}
-
-func (m *CEMIFramePollingData) StandardFrame() bool {
- return true
-}
-
-func (m *CEMIFramePollingData) Polling() bool {
- return true
-}
-
-
-func (m *CEMIFramePollingData) InitializeParent(parent *CEMIFrame, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) {
- m.Parent.Repeated = repeated
- m.Parent.Priority = priority
- m.Parent.AcknowledgeRequested = acknowledgeRequested
- m.Parent.ErrorFlag = errorFlag
-}
-
-func NewCEMIFramePollingData(repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) *CEMIFrame {
- child := &CEMIFramePollingData{
- Parent: NewCEMIFrame(repeated, priority, acknowledgeRequested, errorFlag),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIFramePollingData(structType interface{}) CEMIFramePollingData {
- castFunc := func(typ interface{}) CEMIFramePollingData {
- if casted, ok := typ.(CEMIFramePollingData); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIFramePollingData); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIFrame); ok {
- return CastCEMIFramePollingData(casted.Child)
- }
- if casted, ok := typ.(*CEMIFrame); ok {
- return CastCEMIFramePollingData(casted.Child)
- }
- return CEMIFramePollingData{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIFramePollingData) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIFramePollingData) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIFramePollingDataParse(io *utils.ReadBuffer) (*CEMIFrame, error) {
-
- // Create a partially initialized instance
- _child := &CEMIFramePollingData{
- Parent: &CEMIFrame{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIFramePollingData) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIFramePollingData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIFramePollingData) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFramePollingDataExt.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFramePollingDataExt.go
deleted file mode 100644
index cb7f324..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIFramePollingDataExt.go
+++ /dev/null
@@ -1,143 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIFramePollingDataExt struct {
- Parent *CEMIFrame
- ICEMIFramePollingDataExt
-}
-
-// The corresponding interface
-type ICEMIFramePollingDataExt interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIFramePollingDataExt) NotAckFrame() bool {
- return true
-}
-
-func (m *CEMIFramePollingDataExt) StandardFrame() bool {
- return false
-}
-
-func (m *CEMIFramePollingDataExt) Polling() bool {
- return true
-}
-
-
-func (m *CEMIFramePollingDataExt) InitializeParent(parent *CEMIFrame, repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) {
- m.Parent.Repeated = repeated
- m.Parent.Priority = priority
- m.Parent.AcknowledgeRequested = acknowledgeRequested
- m.Parent.ErrorFlag = errorFlag
-}
-
-func NewCEMIFramePollingDataExt(repeated bool, priority CEMIPriority, acknowledgeRequested bool, errorFlag bool) *CEMIFrame {
- child := &CEMIFramePollingDataExt{
- Parent: NewCEMIFrame(repeated, priority, acknowledgeRequested, errorFlag),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIFramePollingDataExt(structType interface{}) CEMIFramePollingDataExt {
- castFunc := func(typ interface{}) CEMIFramePollingDataExt {
- if casted, ok := typ.(CEMIFramePollingDataExt); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIFramePollingDataExt); ok {
- return *casted
- }
- if casted, ok := typ.(CEMIFrame); ok {
- return CastCEMIFramePollingDataExt(casted.Child)
- }
- if casted, ok := typ.(*CEMIFrame); ok {
- return CastCEMIFramePollingDataExt(casted.Child)
- }
- return CEMIFramePollingDataExt{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIFramePollingDataExt) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIFramePollingDataExt) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIFramePollingDataExtParse(io *utils.ReadBuffer) (*CEMIFrame, error) {
-
- // Create a partially initialized instance
- _child := &CEMIFramePollingDataExt{
- Parent: &CEMIFrame{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIFramePollingDataExt) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIFramePollingDataExt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIFramePollingDataExt) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIMPropReadCon.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIMPropReadCon.go
deleted file mode 100644
index 081288c..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIMPropReadCon.go
+++ /dev/null
@@ -1,300 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIMPropReadCon struct {
- InterfaceObjectType uint16
- ObjectInstance uint8
- PropertyId uint8
- NumberOfElements uint8
- StartIndex uint16
- Unknown uint16
- Parent *CEMI
- ICEMIMPropReadCon
-}
-
-// The corresponding interface
-type ICEMIMPropReadCon interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIMPropReadCon) MessageCode() uint8 {
- return 0xFB
-}
-
-
-func (m *CEMIMPropReadCon) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIMPropReadCon(interfaceObjectType uint16, objectInstance uint8, propertyId uint8, numberOfElements uint8, startIndex uint16, unknown uint16, ) *CEMI {
- child := &CEMIMPropReadCon{
- InterfaceObjectType: interfaceObjectType,
- ObjectInstance: objectInstance,
- PropertyId: propertyId,
- NumberOfElements: numberOfElements,
- StartIndex: startIndex,
- Unknown: unknown,
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIMPropReadCon(structType interface{}) CEMIMPropReadCon {
- castFunc := func(typ interface{}) CEMIMPropReadCon {
- if casted, ok := typ.(CEMIMPropReadCon); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIMPropReadCon); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIMPropReadCon(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIMPropReadCon(casted.Child)
- }
- return CEMIMPropReadCon{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIMPropReadCon) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (interfaceObjectType)
- lengthInBits += 16
-
- // Simple field (objectInstance)
- lengthInBits += 8
-
- // Simple field (propertyId)
- lengthInBits += 8
-
- // Simple field (numberOfElements)
- lengthInBits += 4
-
- // Simple field (startIndex)
- lengthInBits += 12
-
- // Simple field (unknown)
- lengthInBits += 16
-
- return lengthInBits
-}
-
-func (m *CEMIMPropReadCon) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIMPropReadConParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Simple Field (interfaceObjectType)
- interfaceObjectType, _interfaceObjectTypeErr := io.ReadUint16(16)
- if _interfaceObjectTypeErr != nil {
- return nil, errors.New("Error parsing 'interfaceObjectType' field " + _interfaceObjectTypeErr.Error())
- }
-
- // Simple Field (objectInstance)
- objectInstance, _objectInstanceErr := io.ReadUint8(8)
- if _objectInstanceErr != nil {
- return nil, errors.New("Error parsing 'objectInstance' field " + _objectInstanceErr.Error())
- }
-
- // Simple Field (propertyId)
- propertyId, _propertyIdErr := io.ReadUint8(8)
- if _propertyIdErr != nil {
- return nil, errors.New("Error parsing 'propertyId' field " + _propertyIdErr.Error())
- }
-
- // Simple Field (numberOfElements)
- numberOfElements, _numberOfElementsErr := io.ReadUint8(4)
- if _numberOfElementsErr != nil {
- return nil, errors.New("Error parsing 'numberOfElements' field " + _numberOfElementsErr.Error())
- }
-
- // Simple Field (startIndex)
- startIndex, _startIndexErr := io.ReadUint16(12)
- if _startIndexErr != nil {
- return nil, errors.New("Error parsing 'startIndex' field " + _startIndexErr.Error())
- }
-
- // Simple Field (unknown)
- unknown, _unknownErr := io.ReadUint16(16)
- if _unknownErr != nil {
- return nil, errors.New("Error parsing 'unknown' field " + _unknownErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIMPropReadCon{
- InterfaceObjectType: interfaceObjectType,
- ObjectInstance: objectInstance,
- PropertyId: propertyId,
- NumberOfElements: numberOfElements,
- StartIndex: startIndex,
- Unknown: unknown,
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIMPropReadCon) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (interfaceObjectType)
- interfaceObjectType := uint16(m.InterfaceObjectType)
- _interfaceObjectTypeErr := io.WriteUint16(16, (interfaceObjectType))
- if _interfaceObjectTypeErr != nil {
- return errors.New("Error serializing 'interfaceObjectType' field " + _interfaceObjectTypeErr.Error())
- }
-
- // Simple Field (objectInstance)
- objectInstance := uint8(m.ObjectInstance)
- _objectInstanceErr := io.WriteUint8(8, (objectInstance))
- if _objectInstanceErr != nil {
- return errors.New("Error serializing 'objectInstance' field " + _objectInstanceErr.Error())
- }
-
- // Simple Field (propertyId)
- propertyId := uint8(m.PropertyId)
- _propertyIdErr := io.WriteUint8(8, (propertyId))
- if _propertyIdErr != nil {
- return errors.New("Error serializing 'propertyId' field " + _propertyIdErr.Error())
- }
-
- // Simple Field (numberOfElements)
- numberOfElements := uint8(m.NumberOfElements)
- _numberOfElementsErr := io.WriteUint8(4, (numberOfElements))
- if _numberOfElementsErr != nil {
- return errors.New("Error serializing 'numberOfElements' field " + _numberOfElementsErr.Error())
- }
-
- // Simple Field (startIndex)
- startIndex := uint16(m.StartIndex)
- _startIndexErr := io.WriteUint16(12, (startIndex))
- if _startIndexErr != nil {
- return errors.New("Error serializing 'startIndex' field " + _startIndexErr.Error())
- }
-
- // Simple Field (unknown)
- unknown := uint16(m.Unknown)
- _unknownErr := io.WriteUint16(16, (unknown))
- if _unknownErr != nil {
- return errors.New("Error serializing 'unknown' field " + _unknownErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIMPropReadCon) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "interfaceObjectType":
- var data uint16
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.InterfaceObjectType = data
- case "objectInstance":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ObjectInstance = data
- case "propertyId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.PropertyId = data
- case "numberOfElements":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.NumberOfElements = data
- case "startIndex":
- var data uint16
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.StartIndex = data
- case "unknown":
- var data uint16
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Unknown = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIMPropReadCon) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.InterfaceObjectType, xml.StartElement{Name: xml.Name{Local: "interfaceObjectType"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ObjectInstance, xml.StartElement{Name: xml.Name{Local: "objectInstance"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.PropertyId, xml.StartElement{Name: xml.Name{Local: "propertyId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.NumberOfElements, xml.StartElement{Name: xml.Name{Local: "numberOfElements"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.StartIndex, xml.StartElement{Name: xml.Name{Local: "startIndex"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Unknown, xml.StartElement{Name: xml.Name{Local: "unknown"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIMPropReadReq.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIMPropReadReq.go
deleted file mode 100644
index 2a9a538..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIMPropReadReq.go
+++ /dev/null
@@ -1,272 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIMPropReadReq struct {
- InterfaceObjectType uint16
- ObjectInstance uint8
- PropertyId uint8
- NumberOfElements uint8
- StartIndex uint16
- Parent *CEMI
- ICEMIMPropReadReq
-}
-
-// The corresponding interface
-type ICEMIMPropReadReq interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIMPropReadReq) MessageCode() uint8 {
- return 0xFC
-}
-
-
-func (m *CEMIMPropReadReq) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIMPropReadReq(interfaceObjectType uint16, objectInstance uint8, propertyId uint8, numberOfElements uint8, startIndex uint16, ) *CEMI {
- child := &CEMIMPropReadReq{
- InterfaceObjectType: interfaceObjectType,
- ObjectInstance: objectInstance,
- PropertyId: propertyId,
- NumberOfElements: numberOfElements,
- StartIndex: startIndex,
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIMPropReadReq(structType interface{}) CEMIMPropReadReq {
- castFunc := func(typ interface{}) CEMIMPropReadReq {
- if casted, ok := typ.(CEMIMPropReadReq); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIMPropReadReq); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIMPropReadReq(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIMPropReadReq(casted.Child)
- }
- return CEMIMPropReadReq{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIMPropReadReq) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (interfaceObjectType)
- lengthInBits += 16
-
- // Simple field (objectInstance)
- lengthInBits += 8
-
- // Simple field (propertyId)
- lengthInBits += 8
-
- // Simple field (numberOfElements)
- lengthInBits += 4
-
- // Simple field (startIndex)
- lengthInBits += 12
-
- return lengthInBits
-}
-
-func (m *CEMIMPropReadReq) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIMPropReadReqParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Simple Field (interfaceObjectType)
- interfaceObjectType, _interfaceObjectTypeErr := io.ReadUint16(16)
- if _interfaceObjectTypeErr != nil {
- return nil, errors.New("Error parsing 'interfaceObjectType' field " + _interfaceObjectTypeErr.Error())
- }
-
- // Simple Field (objectInstance)
- objectInstance, _objectInstanceErr := io.ReadUint8(8)
- if _objectInstanceErr != nil {
- return nil, errors.New("Error parsing 'objectInstance' field " + _objectInstanceErr.Error())
- }
-
- // Simple Field (propertyId)
- propertyId, _propertyIdErr := io.ReadUint8(8)
- if _propertyIdErr != nil {
- return nil, errors.New("Error parsing 'propertyId' field " + _propertyIdErr.Error())
- }
-
- // Simple Field (numberOfElements)
- numberOfElements, _numberOfElementsErr := io.ReadUint8(4)
- if _numberOfElementsErr != nil {
- return nil, errors.New("Error parsing 'numberOfElements' field " + _numberOfElementsErr.Error())
- }
-
- // Simple Field (startIndex)
- startIndex, _startIndexErr := io.ReadUint16(12)
- if _startIndexErr != nil {
- return nil, errors.New("Error parsing 'startIndex' field " + _startIndexErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &CEMIMPropReadReq{
- InterfaceObjectType: interfaceObjectType,
- ObjectInstance: objectInstance,
- PropertyId: propertyId,
- NumberOfElements: numberOfElements,
- StartIndex: startIndex,
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIMPropReadReq) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (interfaceObjectType)
- interfaceObjectType := uint16(m.InterfaceObjectType)
- _interfaceObjectTypeErr := io.WriteUint16(16, (interfaceObjectType))
- if _interfaceObjectTypeErr != nil {
- return errors.New("Error serializing 'interfaceObjectType' field " + _interfaceObjectTypeErr.Error())
- }
-
- // Simple Field (objectInstance)
- objectInstance := uint8(m.ObjectInstance)
- _objectInstanceErr := io.WriteUint8(8, (objectInstance))
- if _objectInstanceErr != nil {
- return errors.New("Error serializing 'objectInstance' field " + _objectInstanceErr.Error())
- }
-
- // Simple Field (propertyId)
- propertyId := uint8(m.PropertyId)
- _propertyIdErr := io.WriteUint8(8, (propertyId))
- if _propertyIdErr != nil {
- return errors.New("Error serializing 'propertyId' field " + _propertyIdErr.Error())
- }
-
- // Simple Field (numberOfElements)
- numberOfElements := uint8(m.NumberOfElements)
- _numberOfElementsErr := io.WriteUint8(4, (numberOfElements))
- if _numberOfElementsErr != nil {
- return errors.New("Error serializing 'numberOfElements' field " + _numberOfElementsErr.Error())
- }
-
- // Simple Field (startIndex)
- startIndex := uint16(m.StartIndex)
- _startIndexErr := io.WriteUint16(12, (startIndex))
- if _startIndexErr != nil {
- return errors.New("Error serializing 'startIndex' field " + _startIndexErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIMPropReadReq) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "interfaceObjectType":
- var data uint16
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.InterfaceObjectType = data
- case "objectInstance":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ObjectInstance = data
- case "propertyId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.PropertyId = data
- case "numberOfElements":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.NumberOfElements = data
- case "startIndex":
- var data uint16
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.StartIndex = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIMPropReadReq) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.InterfaceObjectType, xml.StartElement{Name: xml.Name{Local: "interfaceObjectType"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ObjectInstance, xml.StartElement{Name: xml.Name{Local: "objectInstance"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.PropertyId, xml.StartElement{Name: xml.Name{Local: "propertyId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.NumberOfElements, xml.StartElement{Name: xml.Name{Local: "numberOfElements"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.StartIndex, xml.StartElement{Name: xml.Name{Local: "startIndex"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPollDataCon.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPollDataCon.go
deleted file mode 100644
index b73f22a..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPollDataCon.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIPollDataCon struct {
- Parent *CEMI
- ICEMIPollDataCon
-}
-
-// The corresponding interface
-type ICEMIPollDataCon interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIPollDataCon) MessageCode() uint8 {
- return 0x25
-}
-
-
-func (m *CEMIPollDataCon) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIPollDataCon() *CEMI {
- child := &CEMIPollDataCon{
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIPollDataCon(structType interface{}) CEMIPollDataCon {
- castFunc := func(typ interface{}) CEMIPollDataCon {
- if casted, ok := typ.(CEMIPollDataCon); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIPollDataCon); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIPollDataCon(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIPollDataCon(casted.Child)
- }
- return CEMIPollDataCon{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIPollDataCon) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIPollDataCon) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIPollDataConParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Create a partially initialized instance
- _child := &CEMIPollDataCon{
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIPollDataCon) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIPollDataCon) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIPollDataCon) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPollDataReq.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPollDataReq.go
deleted file mode 100644
index da25812..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPollDataReq.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIPollDataReq struct {
- Parent *CEMI
- ICEMIPollDataReq
-}
-
-// The corresponding interface
-type ICEMIPollDataReq interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIPollDataReq) MessageCode() uint8 {
- return 0x13
-}
-
-
-func (m *CEMIPollDataReq) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIPollDataReq() *CEMI {
- child := &CEMIPollDataReq{
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIPollDataReq(structType interface{}) CEMIPollDataReq {
- castFunc := func(typ interface{}) CEMIPollDataReq {
- if casted, ok := typ.(CEMIPollDataReq); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIPollDataReq); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIPollDataReq(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIPollDataReq(casted.Child)
- }
- return CEMIPollDataReq{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIPollDataReq) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIPollDataReq) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIPollDataReqParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Create a partially initialized instance
- _child := &CEMIPollDataReq{
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIPollDataReq) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIPollDataReq) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIPollDataReq) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPriority.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPriority.go
deleted file mode 100644
index 552319c..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIPriority.go
+++ /dev/null
@@ -1,78 +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 (
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-type CEMIPriority uint8
-
-type ICEMIPriority interface {
- Serialize(io utils.WriteBuffer) error
-}
-
-const(
- CEMIPriority_SYSTEM CEMIPriority = 0x0
- CEMIPriority_NORMAL CEMIPriority = 0x1
- CEMIPriority_URGENT CEMIPriority = 0x2
- CEMIPriority_LOW CEMIPriority = 0x3
-)
-
-func CEMIPriorityValueOf(value uint8) CEMIPriority {
- switch value {
- case 0x0:
- return CEMIPriority_SYSTEM
- case 0x1:
- return CEMIPriority_NORMAL
- case 0x2:
- return CEMIPriority_URGENT
- case 0x3:
- return CEMIPriority_LOW
- }
- return 0
-}
-
-func CastCEMIPriority(structType interface{}) CEMIPriority {
- castFunc := func(typ interface{}) CEMIPriority {
- if sCEMIPriority, ok := typ.(CEMIPriority); ok {
- return sCEMIPriority
- }
- return 0
- }
- return castFunc(structType)
-}
-
-func (m CEMIPriority) LengthInBits() uint16 {
- return 2
-}
-
-func (m CEMIPriority) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIPriorityParse(io *utils.ReadBuffer) (CEMIPriority, error) {
- // TODO: Implement ...
- return 0, nil
-}
-
-func (e CEMIPriority) Serialize(io utils.WriteBuffer) error {
- // TODO: Implement ...
- return nil
-}
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawCon.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawCon.go
deleted file mode 100644
index 4c7c7d0..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawCon.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIRawCon struct {
- Parent *CEMI
- ICEMIRawCon
-}
-
-// The corresponding interface
-type ICEMIRawCon interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIRawCon) MessageCode() uint8 {
- return 0x2F
-}
-
-
-func (m *CEMIRawCon) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIRawCon() *CEMI {
- child := &CEMIRawCon{
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIRawCon(structType interface{}) CEMIRawCon {
- castFunc := func(typ interface{}) CEMIRawCon {
- if casted, ok := typ.(CEMIRawCon); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIRawCon); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIRawCon(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIRawCon(casted.Child)
- }
- return CEMIRawCon{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIRawCon) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIRawCon) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIRawConParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Create a partially initialized instance
- _child := &CEMIRawCon{
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIRawCon) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIRawCon) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIRawCon) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawInd.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawInd.go
deleted file mode 100644
index ae2fb60..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawInd.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIRawInd struct {
- Parent *CEMI
- ICEMIRawInd
-}
-
-// The corresponding interface
-type ICEMIRawInd interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIRawInd) MessageCode() uint8 {
- return 0x2D
-}
-
-
-func (m *CEMIRawInd) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIRawInd() *CEMI {
- child := &CEMIRawInd{
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIRawInd(structType interface{}) CEMIRawInd {
- castFunc := func(typ interface{}) CEMIRawInd {
- if casted, ok := typ.(CEMIRawInd); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIRawInd); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIRawInd(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIRawInd(casted.Child)
- }
- return CEMIRawInd{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIRawInd) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIRawInd) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIRawIndParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Create a partially initialized instance
- _child := &CEMIRawInd{
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIRawInd) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIRawInd) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIRawInd) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawReq.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawReq.go
deleted file mode 100644
index 216a4bd..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/CEMIRawReq.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type CEMIRawReq struct {
- Parent *CEMI
- ICEMIRawReq
-}
-
-// The corresponding interface
-type ICEMIRawReq interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *CEMIRawReq) MessageCode() uint8 {
- return 0x10
-}
-
-
-func (m *CEMIRawReq) InitializeParent(parent *CEMI) {
-}
-
-func NewCEMIRawReq() *CEMI {
- child := &CEMIRawReq{
- Parent: NewCEMI(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastCEMIRawReq(structType interface{}) CEMIRawReq {
- castFunc := func(typ interface{}) CEMIRawReq {
- if casted, ok := typ.(CEMIRawReq); ok {
- return casted
- }
- if casted, ok := typ.(*CEMIRawReq); ok {
- return *casted
- }
- if casted, ok := typ.(CEMI); ok {
- return CastCEMIRawReq(casted.Child)
- }
- if casted, ok := typ.(*CEMI); ok {
- return CastCEMIRawReq(casted.Child)
- }
- return CEMIRawReq{}
- }
- return castFunc(structType)
-}
-
-func (m *CEMIRawReq) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *CEMIRawReq) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func CEMIRawReqParse(io *utils.ReadBuffer) (*CEMI, error) {
-
- // Create a partially initialized instance
- _child := &CEMIRawReq{
- Parent: &CEMI{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *CEMIRawReq) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *CEMIRawReq) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *CEMIRawReq) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequest.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequest.go
deleted file mode 100644
index 195d24b..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequest.go
+++ /dev/null
@@ -1,213 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionRequest struct {
- HpaiDiscoveryEndpoint *HPAIDiscoveryEndpoint
- HpaiDataEndpoint *HPAIDataEndpoint
- ConnectionRequestInformation *ConnectionRequestInformation
- Parent *KNXNetIPMessage
- IConnectionRequest
-}
-
-// The corresponding interface
-type IConnectionRequest interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionRequest) MsgType() uint16 {
- return 0x0205
-}
-
-
-func (m *ConnectionRequest) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewConnectionRequest(hpaiDiscoveryEndpoint *HPAIDiscoveryEndpoint, hpaiDataEndpoint *HPAIDataEndpoint, connectionRequestInformation *ConnectionRequestInformation, ) *KNXNetIPMessage {
- child := &ConnectionRequest{
- HpaiDiscoveryEndpoint: hpaiDiscoveryEndpoint,
- HpaiDataEndpoint: hpaiDataEndpoint,
- ConnectionRequestInformation: connectionRequestInformation,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionRequest(structType interface{}) ConnectionRequest {
- castFunc := func(typ interface{}) ConnectionRequest {
- if casted, ok := typ.(ConnectionRequest); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionRequest); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastConnectionRequest(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastConnectionRequest(casted.Child)
- }
- return ConnectionRequest{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionRequest) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (hpaiDiscoveryEndpoint)
- lengthInBits += m.HpaiDiscoveryEndpoint.LengthInBits()
-
- // Simple field (hpaiDataEndpoint)
- lengthInBits += m.HpaiDataEndpoint.LengthInBits()
-
- // Simple field (connectionRequestInformation)
- lengthInBits += m.ConnectionRequestInformation.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *ConnectionRequest) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionRequestParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (hpaiDiscoveryEndpoint)
- hpaiDiscoveryEndpoint, _hpaiDiscoveryEndpointErr := HPAIDiscoveryEndpointParse(io)
- if _hpaiDiscoveryEndpointErr != nil {
- return nil, errors.New("Error parsing 'hpaiDiscoveryEndpoint' field " + _hpaiDiscoveryEndpointErr.Error())
- }
-
- // Simple Field (hpaiDataEndpoint)
- hpaiDataEndpoint, _hpaiDataEndpointErr := HPAIDataEndpointParse(io)
- if _hpaiDataEndpointErr != nil {
- return nil, errors.New("Error parsing 'hpaiDataEndpoint' field " + _hpaiDataEndpointErr.Error())
- }
-
- // Simple Field (connectionRequestInformation)
- connectionRequestInformation, _connectionRequestInformationErr := ConnectionRequestInformationParse(io)
- if _connectionRequestInformationErr != nil {
- return nil, errors.New("Error parsing 'connectionRequestInformation' field " + _connectionRequestInformationErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &ConnectionRequest{
- HpaiDiscoveryEndpoint: hpaiDiscoveryEndpoint,
- HpaiDataEndpoint: hpaiDataEndpoint,
- ConnectionRequestInformation: connectionRequestInformation,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionRequest) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (hpaiDiscoveryEndpoint)
- _hpaiDiscoveryEndpointErr := m.HpaiDiscoveryEndpoint.Serialize(io)
- if _hpaiDiscoveryEndpointErr != nil {
- return errors.New("Error serializing 'hpaiDiscoveryEndpoint' field " + _hpaiDiscoveryEndpointErr.Error())
- }
-
- // Simple Field (hpaiDataEndpoint)
- _hpaiDataEndpointErr := m.HpaiDataEndpoint.Serialize(io)
- if _hpaiDataEndpointErr != nil {
- return errors.New("Error serializing 'hpaiDataEndpoint' field " + _hpaiDataEndpointErr.Error())
- }
-
- // Simple Field (connectionRequestInformation)
- _connectionRequestInformationErr := m.ConnectionRequestInformation.Serialize(io)
- if _connectionRequestInformationErr != nil {
- return errors.New("Error serializing 'connectionRequestInformation' field " + _connectionRequestInformationErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionRequest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "hpaiDiscoveryEndpoint":
- var data *HPAIDiscoveryEndpoint
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.HpaiDiscoveryEndpoint = data
- case "hpaiDataEndpoint":
- var data *HPAIDataEndpoint
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.HpaiDataEndpoint = data
- case "connectionRequestInformation":
- var dt *ConnectionRequestInformation
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- m.ConnectionRequestInformation = dt
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.HpaiDiscoveryEndpoint, xml.StartElement{Name: xml.Name{Local: "hpaiDiscoveryEndpoint"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.HpaiDataEndpoint, xml.StartElement{Name: xml.Name{Local: "hpaiDataEndpoint"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ConnectionRequestInformation, xml.StartElement{Name: xml.Name{Local: "connectionRequestInformation"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformation.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformation.go
deleted file mode 100644
index bc8132c..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformation.go
+++ /dev/null
@@ -1,218 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "reflect"
- "strings"
-)
-
-// The data-structure of this message
-type ConnectionRequestInformation struct {
- Child IConnectionRequestInformationChild
- IConnectionRequestInformation
- IConnectionRequestInformationParent
-}
-
-// The corresponding interface
-type IConnectionRequestInformation interface {
- ConnectionType() uint8
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-type IConnectionRequestInformationParent interface {
- SerializeParent(io utils.WriteBuffer, child IConnectionRequestInformation, serializeChildFunction func() error) error
-}
-
-type IConnectionRequestInformationChild interface {
- Serialize(io utils.WriteBuffer) error
- InitializeParent(parent *ConnectionRequestInformation)
- IConnectionRequestInformation
-}
-
-func NewConnectionRequestInformation() *ConnectionRequestInformation {
- return &ConnectionRequestInformation{}
-}
-
-func CastConnectionRequestInformation(structType interface{}) ConnectionRequestInformation {
- castFunc := func(typ interface{}) ConnectionRequestInformation {
- if casted, ok := typ.(ConnectionRequestInformation); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionRequestInformation); ok {
- return *casted
- }
- return ConnectionRequestInformation{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionRequestInformation) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Implicit Field (structureLength)
- lengthInBits += 8
-
- // Discriminator Field (connectionType)
- lengthInBits += 8
-
- // Length of sub-type elements will be added by sub-type...
- lengthInBits += m.Child.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *ConnectionRequestInformation) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionRequestInformationParse(io *utils.ReadBuffer) (*ConnectionRequestInformation, error) {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _, _structureLengthErr := io.ReadUint8(8)
- if _structureLengthErr != nil {
- return nil, errors.New("Error parsing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Discriminator Field (connectionType) (Used as input to a switch field)
- connectionType, _connectionTypeErr := io.ReadUint8(8)
- if _connectionTypeErr != nil {
- return nil, errors.New("Error parsing 'connectionType' field " + _connectionTypeErr.Error())
- }
-
- // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
- var _parent *ConnectionRequestInformation
- var typeSwitchError error
- switch {
- case connectionType == 0x03:
- _parent, typeSwitchError = ConnectionRequestInformationDeviceManagementParse(io)
- case connectionType == 0x04:
- _parent, typeSwitchError = ConnectionRequestInformationTunnelConnectionParse(io)
- }
- if typeSwitchError != nil {
- return nil, errors.New("Error parsing sub-type for type-switch. " + typeSwitchError.Error())
- }
-
- // Finish initializing
- _parent.Child.InitializeParent(_parent)
- return _parent, nil
-}
-
-func (m *ConnectionRequestInformation) Serialize(io utils.WriteBuffer) error {
- return m.Child.Serialize(io)
-}
-
-func (m *ConnectionRequestInformation) SerializeParent(io utils.WriteBuffer, child IConnectionRequestInformation, serializeChildFunction func() error) error {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- structureLength := uint8(uint8(m.LengthInBytes()))
- _structureLengthErr := io.WriteUint8(8, (structureLength))
- if _structureLengthErr != nil {
- return errors.New("Error serializing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Discriminator Field (connectionType) (Used as input to a switch field)
- connectionType := uint8(child.ConnectionType())
- _connectionTypeErr := io.WriteUint8(8, (connectionType))
- if _connectionTypeErr != nil {
- return errors.New("Error serializing 'connectionType' field " + _connectionTypeErr.Error())
- }
-
- // Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
- _typeSwitchErr := serializeChildFunction()
- if _typeSwitchErr != nil {
- return errors.New("Error serializing sub-type field " + _typeSwitchErr.Error())
- }
-
- return nil
-}
-
-func (m *ConnectionRequestInformation) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- default:
- switch start.Attr[0].Value {
- case "org.apache.plc4x.java.knxnetip.readwrite.ConnectionRequestInformationDeviceManagement":
- var dt *ConnectionRequestInformationDeviceManagement
- if m.Child != nil {
- dt = m.Child.(*ConnectionRequestInformationDeviceManagement)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.ConnectionRequestInformationTunnelConnection":
- var dt *ConnectionRequestInformationTunnelConnection
- if m.Child != nil {
- dt = m.Child.(*ConnectionRequestInformationTunnelConnection)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- }
- }
- }
- }
-}
-
-func (m *ConnectionRequestInformation) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := reflect.TypeOf(m.Child).String()
- className = "org.apache.plc4x.java.knxnetip.readwrite." + className[strings.LastIndex(className, ".") + 1:]
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- marshaller, ok := m.Child.(xml.Marshaler)
- if !ok {
- return errors.New("child is not castable to Marshaler")
- }
- marshaller.MarshalXML(e, start)
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformationDeviceManagement.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformationDeviceManagement.go
deleted file mode 100644
index 3f8fce4..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformationDeviceManagement.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionRequestInformationDeviceManagement struct {
- Parent *ConnectionRequestInformation
- IConnectionRequestInformationDeviceManagement
-}
-
-// The corresponding interface
-type IConnectionRequestInformationDeviceManagement interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionRequestInformationDeviceManagement) ConnectionType() uint8 {
- return 0x03
-}
-
-
-func (m *ConnectionRequestInformationDeviceManagement) InitializeParent(parent *ConnectionRequestInformation) {
-}
-
-func NewConnectionRequestInformationDeviceManagement() *ConnectionRequestInformation {
- child := &ConnectionRequestInformationDeviceManagement{
- Parent: NewConnectionRequestInformation(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionRequestInformationDeviceManagement(structType interface{}) ConnectionRequestInformationDeviceManagement {
- castFunc := func(typ interface{}) ConnectionRequestInformationDeviceManagement {
- if casted, ok := typ.(ConnectionRequestInformationDeviceManagement); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionRequestInformationDeviceManagement); ok {
- return *casted
- }
- if casted, ok := typ.(ConnectionRequestInformation); ok {
- return CastConnectionRequestInformationDeviceManagement(casted.Child)
- }
- if casted, ok := typ.(*ConnectionRequestInformation); ok {
- return CastConnectionRequestInformationDeviceManagement(casted.Child)
- }
- return ConnectionRequestInformationDeviceManagement{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionRequestInformationDeviceManagement) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *ConnectionRequestInformationDeviceManagement) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionRequestInformationDeviceManagementParse(io *utils.ReadBuffer) (*ConnectionRequestInformation, error) {
-
- // Create a partially initialized instance
- _child := &ConnectionRequestInformationDeviceManagement{
- Parent: &ConnectionRequestInformation{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionRequestInformationDeviceManagement) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionRequestInformationDeviceManagement) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionRequestInformationDeviceManagement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go
deleted file mode 100644
index 8240343..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go
+++ /dev/null
@@ -1,186 +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 (
- "encoding/xml"
- "errors"
- "io"
- log "github.com/sirupsen/logrus"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionRequestInformationTunnelConnection struct {
- KnxLayer KnxLayer
- Parent *ConnectionRequestInformation
- IConnectionRequestInformationTunnelConnection
-}
-
-// The corresponding interface
-type IConnectionRequestInformationTunnelConnection interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionRequestInformationTunnelConnection) ConnectionType() uint8 {
- return 0x04
-}
-
-
-func (m *ConnectionRequestInformationTunnelConnection) InitializeParent(parent *ConnectionRequestInformation) {
-}
-
-func NewConnectionRequestInformationTunnelConnection(knxLayer KnxLayer, ) *ConnectionRequestInformation {
- child := &ConnectionRequestInformationTunnelConnection{
- KnxLayer: knxLayer,
- Parent: NewConnectionRequestInformation(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionRequestInformationTunnelConnection(structType interface{}) ConnectionRequestInformationTunnelConnection {
- castFunc := func(typ interface{}) ConnectionRequestInformationTunnelConnection {
- if casted, ok := typ.(ConnectionRequestInformationTunnelConnection); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionRequestInformationTunnelConnection); ok {
- return *casted
- }
- if casted, ok := typ.(ConnectionRequestInformation); ok {
- return CastConnectionRequestInformationTunnelConnection(casted.Child)
- }
- if casted, ok := typ.(*ConnectionRequestInformation); ok {
- return CastConnectionRequestInformationTunnelConnection(casted.Child)
- }
- return ConnectionRequestInformationTunnelConnection{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionRequestInformationTunnelConnection) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Enum Field (knxLayer)
- lengthInBits += 8
-
- // Reserved Field (reserved)
- lengthInBits += 8
-
- return lengthInBits
-}
-
-func (m *ConnectionRequestInformationTunnelConnection) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionRequestInformationTunnelConnectionParse(io *utils.ReadBuffer) (*ConnectionRequestInformation, error) {
-
- // Enum field (knxLayer)
- knxLayer, _knxLayerErr := KnxLayerParse(io)
- if _knxLayerErr != nil {
- return nil, errors.New("Error parsing 'knxLayer' field " + _knxLayerErr.Error())
- }
-
- // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
- {
- reserved, _err := io.ReadUint8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'reserved' field " + _err.Error())
- }
- if reserved != uint8(0x00) {
- log.WithFields(log.Fields{
- "expected value": uint8(0x00),
- "got value": reserved,
- }).Info("Got unexpected response.")
- }
- }
-
- // Create a partially initialized instance
- _child := &ConnectionRequestInformationTunnelConnection{
- KnxLayer: knxLayer,
- Parent: &ConnectionRequestInformation{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionRequestInformationTunnelConnection) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Enum field (knxLayer)
- knxLayer := CastKnxLayer(m.KnxLayer)
- _knxLayerErr := knxLayer.Serialize(io)
- if _knxLayerErr != nil {
- return errors.New("Error serializing 'knxLayer' field " + _knxLayerErr.Error())
- }
-
- // Reserved Field (reserved)
- {
- _err := io.WriteUint8(8, uint8(0x00))
- if _err != nil {
- return errors.New("Error serializing 'reserved' field " + _err.Error())
- }
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionRequestInformationTunnelConnection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "knxLayer":
- var data KnxLayer
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.KnxLayer = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionRequestInformationTunnelConnection) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.KnxLayer, xml.StartElement{Name: xml.Name{Local: "knxLayer"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponse.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponse.go
deleted file mode 100644
index d486d64..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponse.go
+++ /dev/null
@@ -1,262 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionResponse struct {
- CommunicationChannelId uint8
- Status Status
- HpaiDataEndpoint *HPAIDataEndpoint
- ConnectionResponseDataBlock *ConnectionResponseDataBlock
- Parent *KNXNetIPMessage
- IConnectionResponse
-}
-
-// The corresponding interface
-type IConnectionResponse interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionResponse) MsgType() uint16 {
- return 0x0206
-}
-
-
-func (m *ConnectionResponse) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewConnectionResponse(communicationChannelId uint8, status Status, hpaiDataEndpoint *HPAIDataEndpoint, connectionResponseDataBlock *ConnectionResponseDataBlock, ) *KNXNetIPMessage {
- child := &ConnectionResponse{
- CommunicationChannelId: communicationChannelId,
- Status: status,
- HpaiDataEndpoint: hpaiDataEndpoint,
- ConnectionResponseDataBlock: connectionResponseDataBlock,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionResponse(structType interface{}) ConnectionResponse {
- castFunc := func(typ interface{}) ConnectionResponse {
- if casted, ok := typ.(ConnectionResponse); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionResponse); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastConnectionResponse(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastConnectionResponse(casted.Child)
- }
- return ConnectionResponse{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionResponse) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (communicationChannelId)
- lengthInBits += 8
-
- // Enum Field (status)
- lengthInBits += 8
-
- // Optional Field (hpaiDataEndpoint)
- if m.HpaiDataEndpoint != nil {
- lengthInBits += (*m.HpaiDataEndpoint).LengthInBits()
- }
-
- // Optional Field (connectionResponseDataBlock)
- if m.ConnectionResponseDataBlock != nil {
- lengthInBits += (*m.ConnectionResponseDataBlock).LengthInBits()
- }
-
- return lengthInBits
-}
-
-func (m *ConnectionResponse) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionResponseParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (communicationChannelId)
- communicationChannelId, _communicationChannelIdErr := io.ReadUint8(8)
- if _communicationChannelIdErr != nil {
- return nil, errors.New("Error parsing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Enum field (status)
- status, _statusErr := StatusParse(io)
- if _statusErr != nil {
- return nil, errors.New("Error parsing 'status' field " + _statusErr.Error())
- }
-
- // Optional Field (hpaiDataEndpoint) (Can be skipped, if a given expression evaluates to false)
- var hpaiDataEndpoint *HPAIDataEndpoint = nil
- if bool((status) == (Status_NO_ERROR)) {
- _message, _err := HPAIDataEndpointParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'hpaiDataEndpoint' field " + _err.Error())
- }
- hpaiDataEndpoint = _message
- }
-
- // Optional Field (connectionResponseDataBlock) (Can be skipped, if a given expression evaluates to false)
- var connectionResponseDataBlock *ConnectionResponseDataBlock = nil
- if bool((status) == (Status_NO_ERROR)) {
- _message, _err := ConnectionResponseDataBlockParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'connectionResponseDataBlock' field " + _err.Error())
- }
- connectionResponseDataBlock = _message
- }
-
- // Create a partially initialized instance
- _child := &ConnectionResponse{
- CommunicationChannelId: communicationChannelId,
- Status: status,
- HpaiDataEndpoint: hpaiDataEndpoint,
- ConnectionResponseDataBlock: connectionResponseDataBlock,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionResponse) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (communicationChannelId)
- communicationChannelId := uint8(m.CommunicationChannelId)
- _communicationChannelIdErr := io.WriteUint8(8, (communicationChannelId))
- if _communicationChannelIdErr != nil {
- return errors.New("Error serializing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Enum field (status)
- status := CastStatus(m.Status)
- _statusErr := status.Serialize(io)
- if _statusErr != nil {
- return errors.New("Error serializing 'status' field " + _statusErr.Error())
- }
-
- // Optional Field (hpaiDataEndpoint) (Can be skipped, if the value is null)
- var hpaiDataEndpoint *HPAIDataEndpoint = nil
- if m.HpaiDataEndpoint != nil {
- hpaiDataEndpoint = m.HpaiDataEndpoint
- _hpaiDataEndpointErr := hpaiDataEndpoint.Serialize(io)
- if _hpaiDataEndpointErr != nil {
- return errors.New("Error serializing 'hpaiDataEndpoint' field " + _hpaiDataEndpointErr.Error())
- }
- }
-
- // Optional Field (connectionResponseDataBlock) (Can be skipped, if the value is null)
- var connectionResponseDataBlock *ConnectionResponseDataBlock = nil
- if m.ConnectionResponseDataBlock != nil {
- connectionResponseDataBlock = m.ConnectionResponseDataBlock
- _connectionResponseDataBlockErr := connectionResponseDataBlock.Serialize(io)
- if _connectionResponseDataBlockErr != nil {
- return errors.New("Error serializing 'connectionResponseDataBlock' field " + _connectionResponseDataBlockErr.Error())
- }
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionResponse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "communicationChannelId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.CommunicationChannelId = data
- case "status":
- var data Status
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Status = data
- case "hpaiDataEndpoint":
- var data *HPAIDataEndpoint
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.HpaiDataEndpoint = data
- case "connectionResponseDataBlock":
- var dt *ConnectionResponseDataBlock
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- m.ConnectionResponseDataBlock = dt
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.CommunicationChannelId, xml.StartElement{Name: xml.Name{Local: "communicationChannelId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Status, xml.StartElement{Name: xml.Name{Local: "status"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.HpaiDataEndpoint, xml.StartElement{Name: xml.Name{Local: "hpaiDataEndpoint"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ConnectionResponseDataBlock, xml.StartElement{Name: xml.Name{Local: "connectionResponseDataBlock"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlock.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlock.go
deleted file mode 100644
index 1b2f2d3..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlock.go
+++ /dev/null
@@ -1,218 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
- "reflect"
- "strings"
-)
-
-// The data-structure of this message
-type ConnectionResponseDataBlock struct {
- Child IConnectionResponseDataBlockChild
- IConnectionResponseDataBlock
- IConnectionResponseDataBlockParent
-}
-
-// The corresponding interface
-type IConnectionResponseDataBlock interface {
- ConnectionType() uint8
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-type IConnectionResponseDataBlockParent interface {
- SerializeParent(io utils.WriteBuffer, child IConnectionResponseDataBlock, serializeChildFunction func() error) error
-}
-
-type IConnectionResponseDataBlockChild interface {
- Serialize(io utils.WriteBuffer) error
- InitializeParent(parent *ConnectionResponseDataBlock)
- IConnectionResponseDataBlock
-}
-
-func NewConnectionResponseDataBlock() *ConnectionResponseDataBlock {
- return &ConnectionResponseDataBlock{}
-}
-
-func CastConnectionResponseDataBlock(structType interface{}) ConnectionResponseDataBlock {
- castFunc := func(typ interface{}) ConnectionResponseDataBlock {
- if casted, ok := typ.(ConnectionResponseDataBlock); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionResponseDataBlock); ok {
- return *casted
- }
- return ConnectionResponseDataBlock{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionResponseDataBlock) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Implicit Field (structureLength)
- lengthInBits += 8
-
- // Discriminator Field (connectionType)
- lengthInBits += 8
-
- // Length of sub-type elements will be added by sub-type...
- lengthInBits += m.Child.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *ConnectionResponseDataBlock) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionResponseDataBlockParse(io *utils.ReadBuffer) (*ConnectionResponseDataBlock, error) {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _, _structureLengthErr := io.ReadUint8(8)
- if _structureLengthErr != nil {
- return nil, errors.New("Error parsing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Discriminator Field (connectionType) (Used as input to a switch field)
- connectionType, _connectionTypeErr := io.ReadUint8(8)
- if _connectionTypeErr != nil {
- return nil, errors.New("Error parsing 'connectionType' field " + _connectionTypeErr.Error())
- }
-
- // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
- var _parent *ConnectionResponseDataBlock
- var typeSwitchError error
- switch {
- case connectionType == 0x03:
- _parent, typeSwitchError = ConnectionResponseDataBlockDeviceManagementParse(io)
- case connectionType == 0x04:
- _parent, typeSwitchError = ConnectionResponseDataBlockTunnelConnectionParse(io)
- }
- if typeSwitchError != nil {
- return nil, errors.New("Error parsing sub-type for type-switch. " + typeSwitchError.Error())
- }
-
- // Finish initializing
- _parent.Child.InitializeParent(_parent)
- return _parent, nil
-}
-
-func (m *ConnectionResponseDataBlock) Serialize(io utils.WriteBuffer) error {
- return m.Child.Serialize(io)
-}
-
-func (m *ConnectionResponseDataBlock) SerializeParent(io utils.WriteBuffer, child IConnectionResponseDataBlock, serializeChildFunction func() error) error {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- structureLength := uint8(uint8(m.LengthInBytes()))
- _structureLengthErr := io.WriteUint8(8, (structureLength))
- if _structureLengthErr != nil {
- return errors.New("Error serializing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Discriminator Field (connectionType) (Used as input to a switch field)
- connectionType := uint8(child.ConnectionType())
- _connectionTypeErr := io.WriteUint8(8, (connectionType))
- if _connectionTypeErr != nil {
- return errors.New("Error serializing 'connectionType' field " + _connectionTypeErr.Error())
- }
-
- // Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
- _typeSwitchErr := serializeChildFunction()
- if _typeSwitchErr != nil {
- return errors.New("Error serializing sub-type field " + _typeSwitchErr.Error())
- }
-
- return nil
-}
-
-func (m *ConnectionResponseDataBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- default:
- switch start.Attr[0].Value {
- case "org.apache.plc4x.java.knxnetip.readwrite.ConnectionResponseDataBlockDeviceManagement":
- var dt *ConnectionResponseDataBlockDeviceManagement
- if m.Child != nil {
- dt = m.Child.(*ConnectionResponseDataBlockDeviceManagement)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- case "org.apache.plc4x.java.knxnetip.readwrite.ConnectionResponseDataBlockTunnelConnection":
- var dt *ConnectionResponseDataBlockTunnelConnection
- if m.Child != nil {
- dt = m.Child.(*ConnectionResponseDataBlockTunnelConnection)
- }
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- if m.Child == nil {
- dt.Parent = m
- m.Child = dt
- }
- }
- }
- }
- }
-}
-
-func (m *ConnectionResponseDataBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := reflect.TypeOf(m.Child).String()
- className = "org.apache.plc4x.java.knxnetip.readwrite." + className[strings.LastIndex(className, ".") + 1:]
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- marshaller, ok := m.Child.(xml.Marshaler)
- if !ok {
- return errors.New("child is not castable to Marshaler")
- }
- marshaller.MarshalXML(e, start)
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlockDeviceManagement.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlockDeviceManagement.go
deleted file mode 100644
index 2549d4c..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlockDeviceManagement.go
+++ /dev/null
@@ -1,131 +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 (
- "encoding/xml"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionResponseDataBlockDeviceManagement struct {
- Parent *ConnectionResponseDataBlock
- IConnectionResponseDataBlockDeviceManagement
-}
-
-// The corresponding interface
-type IConnectionResponseDataBlockDeviceManagement interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionResponseDataBlockDeviceManagement) ConnectionType() uint8 {
- return 0x03
-}
-
-
-func (m *ConnectionResponseDataBlockDeviceManagement) InitializeParent(parent *ConnectionResponseDataBlock) {
-}
-
-func NewConnectionResponseDataBlockDeviceManagement() *ConnectionResponseDataBlock {
- child := &ConnectionResponseDataBlockDeviceManagement{
- Parent: NewConnectionResponseDataBlock(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionResponseDataBlockDeviceManagement(structType interface{}) ConnectionResponseDataBlockDeviceManagement {
- castFunc := func(typ interface{}) ConnectionResponseDataBlockDeviceManagement {
- if casted, ok := typ.(ConnectionResponseDataBlockDeviceManagement); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionResponseDataBlockDeviceManagement); ok {
- return *casted
- }
- if casted, ok := typ.(ConnectionResponseDataBlock); ok {
- return CastConnectionResponseDataBlockDeviceManagement(casted.Child)
- }
- if casted, ok := typ.(*ConnectionResponseDataBlock); ok {
- return CastConnectionResponseDataBlockDeviceManagement(casted.Child)
- }
- return ConnectionResponseDataBlockDeviceManagement{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionResponseDataBlockDeviceManagement) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- return lengthInBits
-}
-
-func (m *ConnectionResponseDataBlockDeviceManagement) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionResponseDataBlockDeviceManagementParse(io *utils.ReadBuffer) (*ConnectionResponseDataBlock, error) {
-
- // Create a partially initialized instance
- _child := &ConnectionResponseDataBlockDeviceManagement{
- Parent: &ConnectionResponseDataBlock{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionResponseDataBlockDeviceManagement) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionResponseDataBlockDeviceManagement) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionResponseDataBlockDeviceManagement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlockTunnelConnection.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlockTunnelConnection.go
deleted file mode 100644
index 082b349..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionResponseDataBlockTunnelConnection.go
+++ /dev/null
@@ -1,159 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionResponseDataBlockTunnelConnection struct {
- KnxAddress *KNXAddress
- Parent *ConnectionResponseDataBlock
- IConnectionResponseDataBlockTunnelConnection
-}
-
-// The corresponding interface
-type IConnectionResponseDataBlockTunnelConnection interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionResponseDataBlockTunnelConnection) ConnectionType() uint8 {
- return 0x04
-}
-
-
-func (m *ConnectionResponseDataBlockTunnelConnection) InitializeParent(parent *ConnectionResponseDataBlock) {
-}
-
-func NewConnectionResponseDataBlockTunnelConnection(knxAddress *KNXAddress, ) *ConnectionResponseDataBlock {
- child := &ConnectionResponseDataBlockTunnelConnection{
- KnxAddress: knxAddress,
- Parent: NewConnectionResponseDataBlock(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionResponseDataBlockTunnelConnection(structType interface{}) ConnectionResponseDataBlockTunnelConnection {
- castFunc := func(typ interface{}) ConnectionResponseDataBlockTunnelConnection {
- if casted, ok := typ.(ConnectionResponseDataBlockTunnelConnection); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionResponseDataBlockTunnelConnection); ok {
- return *casted
- }
- if casted, ok := typ.(ConnectionResponseDataBlock); ok {
- return CastConnectionResponseDataBlockTunnelConnection(casted.Child)
- }
- if casted, ok := typ.(*ConnectionResponseDataBlock); ok {
- return CastConnectionResponseDataBlockTunnelConnection(casted.Child)
- }
- return ConnectionResponseDataBlockTunnelConnection{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionResponseDataBlockTunnelConnection) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (knxAddress)
- lengthInBits += m.KnxAddress.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *ConnectionResponseDataBlockTunnelConnection) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionResponseDataBlockTunnelConnectionParse(io *utils.ReadBuffer) (*ConnectionResponseDataBlock, error) {
-
- // Simple Field (knxAddress)
- knxAddress, _knxAddressErr := KNXAddressParse(io)
- if _knxAddressErr != nil {
- return nil, errors.New("Error parsing 'knxAddress' field " + _knxAddressErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &ConnectionResponseDataBlockTunnelConnection{
- KnxAddress: knxAddress,
- Parent: &ConnectionResponseDataBlock{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionResponseDataBlockTunnelConnection) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (knxAddress)
- _knxAddressErr := m.KnxAddress.Serialize(io)
- if _knxAddressErr != nil {
- return errors.New("Error serializing 'knxAddress' field " + _knxAddressErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionResponseDataBlockTunnelConnection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "knxAddress":
- var data *KNXAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.KnxAddress = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionResponseDataBlockTunnelConnection) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.KnxAddress, xml.StartElement{Name: xml.Name{Local: "knxAddress"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionStateRequest.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionStateRequest.go
deleted file mode 100644
index 75fbbbd..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionStateRequest.go
+++ /dev/null
@@ -1,213 +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 (
- "encoding/xml"
- "errors"
- "io"
- log "github.com/sirupsen/logrus"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionStateRequest struct {
- CommunicationChannelId uint8
- HpaiControlEndpoint *HPAIControlEndpoint
- Parent *KNXNetIPMessage
- IConnectionStateRequest
-}
-
-// The corresponding interface
-type IConnectionStateRequest interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionStateRequest) MsgType() uint16 {
- return 0x0207
-}
-
-
-func (m *ConnectionStateRequest) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewConnectionStateRequest(communicationChannelId uint8, hpaiControlEndpoint *HPAIControlEndpoint, ) *KNXNetIPMessage {
- child := &ConnectionStateRequest{
- CommunicationChannelId: communicationChannelId,
- HpaiControlEndpoint: hpaiControlEndpoint,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionStateRequest(structType interface{}) ConnectionStateRequest {
- castFunc := func(typ interface{}) ConnectionStateRequest {
- if casted, ok := typ.(ConnectionStateRequest); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionStateRequest); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastConnectionStateRequest(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastConnectionStateRequest(casted.Child)
- }
- return ConnectionStateRequest{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionStateRequest) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (communicationChannelId)
- lengthInBits += 8
-
- // Reserved Field (reserved)
- lengthInBits += 8
-
- // Simple field (hpaiControlEndpoint)
- lengthInBits += m.HpaiControlEndpoint.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *ConnectionStateRequest) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionStateRequestParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (communicationChannelId)
- communicationChannelId, _communicationChannelIdErr := io.ReadUint8(8)
- if _communicationChannelIdErr != nil {
- return nil, errors.New("Error parsing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
- {
- reserved, _err := io.ReadUint8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'reserved' field " + _err.Error())
- }
- if reserved != uint8(0x00) {
- log.WithFields(log.Fields{
- "expected value": uint8(0x00),
- "got value": reserved,
- }).Info("Got unexpected response.")
- }
- }
-
- // Simple Field (hpaiControlEndpoint)
- hpaiControlEndpoint, _hpaiControlEndpointErr := HPAIControlEndpointParse(io)
- if _hpaiControlEndpointErr != nil {
- return nil, errors.New("Error parsing 'hpaiControlEndpoint' field " + _hpaiControlEndpointErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &ConnectionStateRequest{
- CommunicationChannelId: communicationChannelId,
- HpaiControlEndpoint: hpaiControlEndpoint,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionStateRequest) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (communicationChannelId)
- communicationChannelId := uint8(m.CommunicationChannelId)
- _communicationChannelIdErr := io.WriteUint8(8, (communicationChannelId))
- if _communicationChannelIdErr != nil {
- return errors.New("Error serializing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Reserved Field (reserved)
- {
- _err := io.WriteUint8(8, uint8(0x00))
- if _err != nil {
- return errors.New("Error serializing 'reserved' field " + _err.Error())
- }
- }
-
- // Simple Field (hpaiControlEndpoint)
- _hpaiControlEndpointErr := m.HpaiControlEndpoint.Serialize(io)
- if _hpaiControlEndpointErr != nil {
- return errors.New("Error serializing 'hpaiControlEndpoint' field " + _hpaiControlEndpointErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionStateRequest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "communicationChannelId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.CommunicationChannelId = data
- case "hpaiControlEndpoint":
- var data *HPAIControlEndpoint
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.HpaiControlEndpoint = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionStateRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.CommunicationChannelId, xml.StartElement{Name: xml.Name{Local: "communicationChannelId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.HpaiControlEndpoint, xml.StartElement{Name: xml.Name{Local: "hpaiControlEndpoint"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionStateResponse.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionStateResponse.go
deleted file mode 100644
index 24fc2ae..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/ConnectionStateResponse.go
+++ /dev/null
@@ -1,188 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type ConnectionStateResponse struct {
- CommunicationChannelId uint8
- Status Status
- Parent *KNXNetIPMessage
- IConnectionStateResponse
-}
-
-// The corresponding interface
-type IConnectionStateResponse interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *ConnectionStateResponse) MsgType() uint16 {
- return 0x0208
-}
-
-
-func (m *ConnectionStateResponse) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewConnectionStateResponse(communicationChannelId uint8, status Status, ) *KNXNetIPMessage {
- child := &ConnectionStateResponse{
- CommunicationChannelId: communicationChannelId,
- Status: status,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastConnectionStateResponse(structType interface{}) ConnectionStateResponse {
- castFunc := func(typ interface{}) ConnectionStateResponse {
- if casted, ok := typ.(ConnectionStateResponse); ok {
- return casted
- }
- if casted, ok := typ.(*ConnectionStateResponse); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastConnectionStateResponse(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastConnectionStateResponse(casted.Child)
- }
- return ConnectionStateResponse{}
- }
- return castFunc(structType)
-}
-
-func (m *ConnectionStateResponse) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (communicationChannelId)
- lengthInBits += 8
-
- // Enum Field (status)
- lengthInBits += 8
-
- return lengthInBits
-}
-
-func (m *ConnectionStateResponse) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func ConnectionStateResponseParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (communicationChannelId)
- communicationChannelId, _communicationChannelIdErr := io.ReadUint8(8)
- if _communicationChannelIdErr != nil {
- return nil, errors.New("Error parsing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Enum field (status)
- status, _statusErr := StatusParse(io)
- if _statusErr != nil {
- return nil, errors.New("Error parsing 'status' field " + _statusErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &ConnectionStateResponse{
- CommunicationChannelId: communicationChannelId,
- Status: status,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *ConnectionStateResponse) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (communicationChannelId)
- communicationChannelId := uint8(m.CommunicationChannelId)
- _communicationChannelIdErr := io.WriteUint8(8, (communicationChannelId))
- if _communicationChannelIdErr != nil {
- return errors.New("Error serializing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Enum field (status)
- status := CastStatus(m.Status)
- _statusErr := status.Serialize(io)
- if _statusErr != nil {
- return errors.New("Error serializing 'status' field " + _statusErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *ConnectionStateResponse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "communicationChannelId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.CommunicationChannelId = data
- case "status":
- var data Status
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Status = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *ConnectionStateResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.CommunicationChannelId, xml.StartElement{Name: xml.Name{Local: "communicationChannelId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Status, xml.StartElement{Name: xml.Name{Local: "status"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DIBDeviceInfo.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DIBDeviceInfo.go
deleted file mode 100644
index 9a4f6af..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DIBDeviceInfo.go
+++ /dev/null
@@ -1,391 +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 (
- "encoding/base64"
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DIBDeviceInfo struct {
- DescriptionType uint8
- KnxMedium uint8
- DeviceStatus *DeviceStatus
- KnxAddress *KNXAddress
- ProjectInstallationIdentifier *ProjectInstallationIdentifier
- KnxNetIpDeviceSerialNumber []int8
- KnxNetIpDeviceMulticastAddress *IPAddress
- KnxNetIpDeviceMacAddress *MACAddress
- DeviceFriendlyName []int8
- IDIBDeviceInfo
-}
-
-// The corresponding interface
-type IDIBDeviceInfo interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-func NewDIBDeviceInfo(descriptionType uint8, knxMedium uint8, deviceStatus *DeviceStatus, knxAddress *KNXAddress, projectInstallationIdentifier *ProjectInstallationIdentifier, knxNetIpDeviceSerialNumber []int8, knxNetIpDeviceMulticastAddress *IPAddress, knxNetIpDeviceMacAddress *MACAddress, deviceFriendlyName []int8) *DIBDeviceInfo {
- return &DIBDeviceInfo{DescriptionType: descriptionType, KnxMedium: knxMedium, DeviceStatus: deviceStatus, KnxAddress: knxAddress, ProjectInstallationIdentifier: projectInstallationIdentifier, KnxNetIpDeviceSerialNumber: knxNetIpDeviceSerialNumber, KnxNetIpDeviceMulticastAddress: knxNetIpDeviceMulticastAddress, KnxNetIpDeviceMacAddress: knxNetIpDeviceMacAddress, DeviceFriendlyName: deviceFriendlyName}
-}
-
-func CastDIBDeviceInfo(structType interface{}) DIBDeviceInfo {
- castFunc := func(typ interface{}) DIBDeviceInfo {
- if casted, ok := typ.(DIBDeviceInfo); ok {
- return casted
- }
- if casted, ok := typ.(*DIBDeviceInfo); ok {
- return *casted
- }
- return DIBDeviceInfo{}
- }
- return castFunc(structType)
-}
-
-func (m *DIBDeviceInfo) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Implicit Field (structureLength)
- lengthInBits += 8
-
- // Simple field (descriptionType)
- lengthInBits += 8
-
- // Simple field (knxMedium)
- lengthInBits += 8
-
- // Simple field (deviceStatus)
- lengthInBits += m.DeviceStatus.LengthInBits()
-
- // Simple field (knxAddress)
- lengthInBits += m.KnxAddress.LengthInBits()
-
- // Simple field (projectInstallationIdentifier)
- lengthInBits += m.ProjectInstallationIdentifier.LengthInBits()
-
- // Array field
- if len(m.KnxNetIpDeviceSerialNumber) > 0 {
- lengthInBits += 8 * uint16(len(m.KnxNetIpDeviceSerialNumber))
- }
-
- // Simple field (knxNetIpDeviceMulticastAddress)
- lengthInBits += m.KnxNetIpDeviceMulticastAddress.LengthInBits()
-
- // Simple field (knxNetIpDeviceMacAddress)
- lengthInBits += m.KnxNetIpDeviceMacAddress.LengthInBits()
-
- // Array field
- if len(m.DeviceFriendlyName) > 0 {
- lengthInBits += 8 * uint16(len(m.DeviceFriendlyName))
- }
-
- return lengthInBits
-}
-
-func (m *DIBDeviceInfo) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DIBDeviceInfoParse(io *utils.ReadBuffer) (*DIBDeviceInfo, error) {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _, _structureLengthErr := io.ReadUint8(8)
- if _structureLengthErr != nil {
- return nil, errors.New("Error parsing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (descriptionType)
- descriptionType, _descriptionTypeErr := io.ReadUint8(8)
- if _descriptionTypeErr != nil {
- return nil, errors.New("Error parsing 'descriptionType' field " + _descriptionTypeErr.Error())
- }
-
- // Simple Field (knxMedium)
- knxMedium, _knxMediumErr := io.ReadUint8(8)
- if _knxMediumErr != nil {
- return nil, errors.New("Error parsing 'knxMedium' field " + _knxMediumErr.Error())
- }
-
- // Simple Field (deviceStatus)
- deviceStatus, _deviceStatusErr := DeviceStatusParse(io)
- if _deviceStatusErr != nil {
- return nil, errors.New("Error parsing 'deviceStatus' field " + _deviceStatusErr.Error())
- }
-
- // Simple Field (knxAddress)
- knxAddress, _knxAddressErr := KNXAddressParse(io)
- if _knxAddressErr != nil {
- return nil, errors.New("Error parsing 'knxAddress' field " + _knxAddressErr.Error())
- }
-
- // Simple Field (projectInstallationIdentifier)
- projectInstallationIdentifier, _projectInstallationIdentifierErr := ProjectInstallationIdentifierParse(io)
- if _projectInstallationIdentifierErr != nil {
- return nil, errors.New("Error parsing 'projectInstallationIdentifier' field " + _projectInstallationIdentifierErr.Error())
- }
-
- // Array field (knxNetIpDeviceSerialNumber)
- // Count array
- knxNetIpDeviceSerialNumber := make([]int8, uint16(6))
- for curItem := uint16(0); curItem < uint16(uint16(6)); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'knxNetIpDeviceSerialNumber' field " + _err.Error())
- }
- knxNetIpDeviceSerialNumber[curItem] = _item
- }
-
- // Simple Field (knxNetIpDeviceMulticastAddress)
- knxNetIpDeviceMulticastAddress, _knxNetIpDeviceMulticastAddressErr := IPAddressParse(io)
- if _knxNetIpDeviceMulticastAddressErr != nil {
- return nil, errors.New("Error parsing 'knxNetIpDeviceMulticastAddress' field " + _knxNetIpDeviceMulticastAddressErr.Error())
- }
-
- // Simple Field (knxNetIpDeviceMacAddress)
- knxNetIpDeviceMacAddress, _knxNetIpDeviceMacAddressErr := MACAddressParse(io)
- if _knxNetIpDeviceMacAddressErr != nil {
- return nil, errors.New("Error parsing 'knxNetIpDeviceMacAddress' field " + _knxNetIpDeviceMacAddressErr.Error())
- }
-
- // Array field (deviceFriendlyName)
- // Count array
- deviceFriendlyName := make([]int8, uint16(30))
- for curItem := uint16(0); curItem < uint16(uint16(30)); curItem++ {
- _item, _err := io.ReadInt8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'deviceFriendlyName' field " + _err.Error())
- }
- deviceFriendlyName[curItem] = _item
- }
-
- // Create the instance
- return NewDIBDeviceInfo(descriptionType, knxMedium, deviceStatus, knxAddress, projectInstallationIdentifier, knxNetIpDeviceSerialNumber, knxNetIpDeviceMulticastAddress, knxNetIpDeviceMacAddress, deviceFriendlyName), nil
-}
-
-func (m *DIBDeviceInfo) Serialize(io utils.WriteBuffer) error {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- structureLength := uint8(uint8(m.LengthInBytes()))
- _structureLengthErr := io.WriteUint8(8, (structureLength))
- if _structureLengthErr != nil {
- return errors.New("Error serializing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (descriptionType)
- descriptionType := uint8(m.DescriptionType)
- _descriptionTypeErr := io.WriteUint8(8, (descriptionType))
- if _descriptionTypeErr != nil {
- return errors.New("Error serializing 'descriptionType' field " + _descriptionTypeErr.Error())
- }
-
- // Simple Field (knxMedium)
- knxMedium := uint8(m.KnxMedium)
- _knxMediumErr := io.WriteUint8(8, (knxMedium))
- if _knxMediumErr != nil {
- return errors.New("Error serializing 'knxMedium' field " + _knxMediumErr.Error())
- }
-
- // Simple Field (deviceStatus)
- _deviceStatusErr := m.DeviceStatus.Serialize(io)
- if _deviceStatusErr != nil {
- return errors.New("Error serializing 'deviceStatus' field " + _deviceStatusErr.Error())
- }
-
- // Simple Field (knxAddress)
- _knxAddressErr := m.KnxAddress.Serialize(io)
- if _knxAddressErr != nil {
- return errors.New("Error serializing 'knxAddress' field " + _knxAddressErr.Error())
- }
-
- // Simple Field (projectInstallationIdentifier)
- _projectInstallationIdentifierErr := m.ProjectInstallationIdentifier.Serialize(io)
- if _projectInstallationIdentifierErr != nil {
- return errors.New("Error serializing 'projectInstallationIdentifier' field " + _projectInstallationIdentifierErr.Error())
- }
-
- // Array Field (knxNetIpDeviceSerialNumber)
- if m.KnxNetIpDeviceSerialNumber != nil {
- for _, _element := range m.KnxNetIpDeviceSerialNumber {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'knxNetIpDeviceSerialNumber' field " + _elementErr.Error())
- }
- }
- }
-
- // Simple Field (knxNetIpDeviceMulticastAddress)
- _knxNetIpDeviceMulticastAddressErr := m.KnxNetIpDeviceMulticastAddress.Serialize(io)
- if _knxNetIpDeviceMulticastAddressErr != nil {
- return errors.New("Error serializing 'knxNetIpDeviceMulticastAddress' field " + _knxNetIpDeviceMulticastAddressErr.Error())
- }
-
- // Simple Field (knxNetIpDeviceMacAddress)
- _knxNetIpDeviceMacAddressErr := m.KnxNetIpDeviceMacAddress.Serialize(io)
- if _knxNetIpDeviceMacAddressErr != nil {
- return errors.New("Error serializing 'knxNetIpDeviceMacAddress' field " + _knxNetIpDeviceMacAddressErr.Error())
- }
-
- // Array Field (deviceFriendlyName)
- if m.DeviceFriendlyName != nil {
- for _, _element := range m.DeviceFriendlyName {
- _elementErr := io.WriteInt8(8, _element)
- if _elementErr != nil {
- return errors.New("Error serializing 'deviceFriendlyName' field " + _elementErr.Error())
- }
- }
- }
-
- return nil
-}
-
-func (m *DIBDeviceInfo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "descriptionType":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DescriptionType = data
- case "knxMedium":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.KnxMedium = data
- case "deviceStatus":
- var data *DeviceStatus
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.DeviceStatus = data
- case "knxAddress":
- var data *KNXAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.KnxAddress = data
- case "projectInstallationIdentifier":
- var data *ProjectInstallationIdentifier
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.ProjectInstallationIdentifier = data
- case "knxNetIpDeviceSerialNumber":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.KnxNetIpDeviceSerialNumber = utils.ByteToInt8(_decoded[0:_len])
- case "knxNetIpDeviceMulticastAddress":
- var data *IPAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.KnxNetIpDeviceMulticastAddress = data
- case "knxNetIpDeviceMacAddress":
- var data *MACAddress
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.KnxNetIpDeviceMacAddress = data
- case "deviceFriendlyName":
- var _encoded string
- if err := d.DecodeElement(&_encoded, &tok); err != nil {
- return err
- }
- _decoded := make([]byte, base64.StdEncoding.DecodedLen(len(_encoded)))
- _len, err := base64.StdEncoding.Decode(_decoded, []byte(_encoded))
- if err != nil {
- return err
- }
- m.DeviceFriendlyName = utils.ByteToInt8(_decoded[0:_len])
- }
- }
- }
-}
-
-func (m *DIBDeviceInfo) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := "org.apache.plc4x.java.knxnetip.readwrite.DIBDeviceInfo"
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DescriptionType, xml.StartElement{Name: xml.Name{Local: "descriptionType"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.KnxMedium, xml.StartElement{Name: xml.Name{Local: "knxMedium"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DeviceStatus, xml.StartElement{Name: xml.Name{Local: "deviceStatus"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.KnxAddress, xml.StartElement{Name: xml.Name{Local: "knxAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ProjectInstallationIdentifier, xml.StartElement{Name: xml.Name{Local: "projectInstallationIdentifier"}}); err != nil {
- return err
- }
- _encodedKnxNetIpDeviceSerialNumber := make([]byte, base64.StdEncoding.EncodedLen(len(m.KnxNetIpDeviceSerialNumber)))
- base64.StdEncoding.Encode(_encodedKnxNetIpDeviceSerialNumber, utils.Int8ToByte(m.KnxNetIpDeviceSerialNumber))
- if err := e.EncodeElement(_encodedKnxNetIpDeviceSerialNumber, xml.StartElement{Name: xml.Name{Local: "knxNetIpDeviceSerialNumber"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.KnxNetIpDeviceMulticastAddress, xml.StartElement{Name: xml.Name{Local: "knxNetIpDeviceMulticastAddress"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.KnxNetIpDeviceMacAddress, xml.StartElement{Name: xml.Name{Local: "knxNetIpDeviceMacAddress"}}); err != nil {
- return err
- }
- _encodedDeviceFriendlyName := make([]byte, base64.StdEncoding.EncodedLen(len(m.DeviceFriendlyName)))
- base64.StdEncoding.Encode(_encodedDeviceFriendlyName, utils.Int8ToByte(m.DeviceFriendlyName))
- if err := e.EncodeElement(_encodedDeviceFriendlyName, xml.StartElement{Name: xml.Name{Local: "deviceFriendlyName"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DIBSuppSvcFamilies.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DIBSuppSvcFamilies.go
deleted file mode 100644
index 6f5695d..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DIBSuppSvcFamilies.go
+++ /dev/null
@@ -1,199 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DIBSuppSvcFamilies struct {
- DescriptionType uint8
- ServiceIds []*ServiceId
- IDIBSuppSvcFamilies
-}
-
-// The corresponding interface
-type IDIBSuppSvcFamilies interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-func NewDIBSuppSvcFamilies(descriptionType uint8, serviceIds []*ServiceId) *DIBSuppSvcFamilies {
- return &DIBSuppSvcFamilies{DescriptionType: descriptionType, ServiceIds: serviceIds}
-}
-
-func CastDIBSuppSvcFamilies(structType interface{}) DIBSuppSvcFamilies {
- castFunc := func(typ interface{}) DIBSuppSvcFamilies {
- if casted, ok := typ.(DIBSuppSvcFamilies); ok {
- return casted
- }
- if casted, ok := typ.(*DIBSuppSvcFamilies); ok {
- return *casted
- }
- return DIBSuppSvcFamilies{}
- }
- return castFunc(structType)
-}
-
-func (m *DIBSuppSvcFamilies) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Implicit Field (structureLength)
- lengthInBits += 8
-
- // Simple field (descriptionType)
- lengthInBits += 8
-
- // Array field
- if len(m.ServiceIds) > 0 {
- for _, element := range m.ServiceIds {
- lengthInBits += element.LengthInBits()
- }
- }
-
- return lengthInBits
-}
-
-func (m *DIBSuppSvcFamilies) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DIBSuppSvcFamiliesParse(io *utils.ReadBuffer) (*DIBSuppSvcFamilies, error) {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _, _structureLengthErr := io.ReadUint8(8)
- if _structureLengthErr != nil {
- return nil, errors.New("Error parsing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (descriptionType)
- descriptionType, _descriptionTypeErr := io.ReadUint8(8)
- if _descriptionTypeErr != nil {
- return nil, errors.New("Error parsing 'descriptionType' field " + _descriptionTypeErr.Error())
- }
-
- // Array field (serviceIds)
- // Count array
- serviceIds := make([]*ServiceId, uint16(3))
- for curItem := uint16(0); curItem < uint16(uint16(3)); curItem++ {
- _item, _err := ServiceIdParse(io)
- if _err != nil {
- return nil, errors.New("Error parsing 'serviceIds' field " + _err.Error())
- }
- serviceIds[curItem] = _item
- }
-
- // Create the instance
- return NewDIBSuppSvcFamilies(descriptionType, serviceIds), nil
-}
-
-func (m *DIBSuppSvcFamilies) Serialize(io utils.WriteBuffer) error {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- structureLength := uint8(uint8(m.LengthInBytes()))
- _structureLengthErr := io.WriteUint8(8, (structureLength))
- if _structureLengthErr != nil {
- return errors.New("Error serializing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (descriptionType)
- descriptionType := uint8(m.DescriptionType)
- _descriptionTypeErr := io.WriteUint8(8, (descriptionType))
- if _descriptionTypeErr != nil {
- return errors.New("Error serializing 'descriptionType' field " + _descriptionTypeErr.Error())
- }
-
- // Array Field (serviceIds)
- if m.ServiceIds != nil {
- for _, _element := range m.ServiceIds {
- _elementErr := _element.Serialize(io)
- if _elementErr != nil {
- return errors.New("Error serializing 'serviceIds' field " + _elementErr.Error())
- }
- }
- }
-
- return nil
-}
-
-func (m *DIBSuppSvcFamilies) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "descriptionType":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.DescriptionType = data
- case "serviceIds":
- var _values []*ServiceId
- var dt *ServiceId
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- _values = append(_values, dt)
- m.ServiceIds = _values
- }
- }
- }
-}
-
-func (m *DIBSuppSvcFamilies) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := "org.apache.plc4x.java.knxnetip.readwrite.DIBSuppSvcFamilies"
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DescriptionType, xml.StartElement{Name: xml.Name{Local: "descriptionType"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "serviceIds"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ServiceIds, xml.StartElement{Name: xml.Name{Local: "serviceIds"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "serviceIds"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DescriptionRequest.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DescriptionRequest.go
deleted file mode 100644
index e47292d..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DescriptionRequest.go
+++ /dev/null
@@ -1,159 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DescriptionRequest struct {
- HpaiControlEndpoint *HPAIControlEndpoint
- Parent *KNXNetIPMessage
- IDescriptionRequest
-}
-
-// The corresponding interface
-type IDescriptionRequest interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *DescriptionRequest) MsgType() uint16 {
- return 0x0203
-}
-
-
-func (m *DescriptionRequest) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewDescriptionRequest(hpaiControlEndpoint *HPAIControlEndpoint, ) *KNXNetIPMessage {
- child := &DescriptionRequest{
- HpaiControlEndpoint: hpaiControlEndpoint,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastDescriptionRequest(structType interface{}) DescriptionRequest {
- castFunc := func(typ interface{}) DescriptionRequest {
- if casted, ok := typ.(DescriptionRequest); ok {
- return casted
- }
- if casted, ok := typ.(*DescriptionRequest); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastDescriptionRequest(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastDescriptionRequest(casted.Child)
- }
- return DescriptionRequest{}
- }
- return castFunc(structType)
-}
-
-func (m *DescriptionRequest) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (hpaiControlEndpoint)
- lengthInBits += m.HpaiControlEndpoint.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *DescriptionRequest) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DescriptionRequestParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (hpaiControlEndpoint)
- hpaiControlEndpoint, _hpaiControlEndpointErr := HPAIControlEndpointParse(io)
- if _hpaiControlEndpointErr != nil {
- return nil, errors.New("Error parsing 'hpaiControlEndpoint' field " + _hpaiControlEndpointErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &DescriptionRequest{
- HpaiControlEndpoint: hpaiControlEndpoint,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *DescriptionRequest) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (hpaiControlEndpoint)
- _hpaiControlEndpointErr := m.HpaiControlEndpoint.Serialize(io)
- if _hpaiControlEndpointErr != nil {
- return errors.New("Error serializing 'hpaiControlEndpoint' field " + _hpaiControlEndpointErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *DescriptionRequest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "hpaiControlEndpoint":
- var data *HPAIControlEndpoint
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.HpaiControlEndpoint = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *DescriptionRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.HpaiControlEndpoint, xml.StartElement{Name: xml.Name{Local: "hpaiControlEndpoint"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DescriptionResponse.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DescriptionResponse.go
deleted file mode 100644
index 8755312..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DescriptionResponse.go
+++ /dev/null
@@ -1,186 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DescriptionResponse struct {
- DibDeviceInfo *DIBDeviceInfo
- DibSuppSvcFamilies *DIBSuppSvcFamilies
- Parent *KNXNetIPMessage
- IDescriptionResponse
-}
-
-// The corresponding interface
-type IDescriptionResponse interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *DescriptionResponse) MsgType() uint16 {
- return 0x0204
-}
-
-
-func (m *DescriptionResponse) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewDescriptionResponse(dibDeviceInfo *DIBDeviceInfo, dibSuppSvcFamilies *DIBSuppSvcFamilies, ) *KNXNetIPMessage {
- child := &DescriptionResponse{
- DibDeviceInfo: dibDeviceInfo,
- DibSuppSvcFamilies: dibSuppSvcFamilies,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastDescriptionResponse(structType interface{}) DescriptionResponse {
- castFunc := func(typ interface{}) DescriptionResponse {
- if casted, ok := typ.(DescriptionResponse); ok {
- return casted
- }
- if casted, ok := typ.(*DescriptionResponse); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastDescriptionResponse(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastDescriptionResponse(casted.Child)
- }
- return DescriptionResponse{}
- }
- return castFunc(structType)
-}
-
-func (m *DescriptionResponse) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (dibDeviceInfo)
- lengthInBits += m.DibDeviceInfo.LengthInBits()
-
- // Simple field (dibSuppSvcFamilies)
- lengthInBits += m.DibSuppSvcFamilies.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *DescriptionResponse) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DescriptionResponseParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (dibDeviceInfo)
- dibDeviceInfo, _dibDeviceInfoErr := DIBDeviceInfoParse(io)
- if _dibDeviceInfoErr != nil {
- return nil, errors.New("Error parsing 'dibDeviceInfo' field " + _dibDeviceInfoErr.Error())
- }
-
- // Simple Field (dibSuppSvcFamilies)
- dibSuppSvcFamilies, _dibSuppSvcFamiliesErr := DIBSuppSvcFamiliesParse(io)
- if _dibSuppSvcFamiliesErr != nil {
- return nil, errors.New("Error parsing 'dibSuppSvcFamilies' field " + _dibSuppSvcFamiliesErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &DescriptionResponse{
- DibDeviceInfo: dibDeviceInfo,
- DibSuppSvcFamilies: dibSuppSvcFamilies,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *DescriptionResponse) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (dibDeviceInfo)
- _dibDeviceInfoErr := m.DibDeviceInfo.Serialize(io)
- if _dibDeviceInfoErr != nil {
- return errors.New("Error serializing 'dibDeviceInfo' field " + _dibDeviceInfoErr.Error())
- }
-
- // Simple Field (dibSuppSvcFamilies)
- _dibSuppSvcFamiliesErr := m.DibSuppSvcFamilies.Serialize(io)
- if _dibSuppSvcFamiliesErr != nil {
- return errors.New("Error serializing 'dibSuppSvcFamilies' field " + _dibSuppSvcFamiliesErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *DescriptionResponse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "dibDeviceInfo":
- var data *DIBDeviceInfo
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.DibDeviceInfo = data
- case "dibSuppSvcFamilies":
- var data *DIBSuppSvcFamilies
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.DibSuppSvcFamilies = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *DescriptionResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.DibDeviceInfo, xml.StartElement{Name: xml.Name{Local: "dibDeviceInfo"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.DibSuppSvcFamilies, xml.StartElement{Name: xml.Name{Local: "dibSuppSvcFamilies"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationAck.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationAck.go
deleted file mode 100644
index 73dda51..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationAck.go
+++ /dev/null
@@ -1,159 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DeviceConfigurationAck struct {
- DeviceConfigurationAckDataBlock *DeviceConfigurationAckDataBlock
- Parent *KNXNetIPMessage
- IDeviceConfigurationAck
-}
-
-// The corresponding interface
-type IDeviceConfigurationAck interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *DeviceConfigurationAck) MsgType() uint16 {
- return 0x0311
-}
-
-
-func (m *DeviceConfigurationAck) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewDeviceConfigurationAck(deviceConfigurationAckDataBlock *DeviceConfigurationAckDataBlock, ) *KNXNetIPMessage {
- child := &DeviceConfigurationAck{
- DeviceConfigurationAckDataBlock: deviceConfigurationAckDataBlock,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastDeviceConfigurationAck(structType interface{}) DeviceConfigurationAck {
- castFunc := func(typ interface{}) DeviceConfigurationAck {
- if casted, ok := typ.(DeviceConfigurationAck); ok {
- return casted
- }
- if casted, ok := typ.(*DeviceConfigurationAck); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastDeviceConfigurationAck(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastDeviceConfigurationAck(casted.Child)
- }
- return DeviceConfigurationAck{}
- }
- return castFunc(structType)
-}
-
-func (m *DeviceConfigurationAck) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (deviceConfigurationAckDataBlock)
- lengthInBits += m.DeviceConfigurationAckDataBlock.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *DeviceConfigurationAck) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DeviceConfigurationAckParse(io *utils.ReadBuffer) (*KNXNetIPMessage, error) {
-
- // Simple Field (deviceConfigurationAckDataBlock)
- deviceConfigurationAckDataBlock, _deviceConfigurationAckDataBlockErr := DeviceConfigurationAckDataBlockParse(io)
- if _deviceConfigurationAckDataBlockErr != nil {
- return nil, errors.New("Error parsing 'deviceConfigurationAckDataBlock' field " + _deviceConfigurationAckDataBlockErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &DeviceConfigurationAck{
- DeviceConfigurationAckDataBlock: deviceConfigurationAckDataBlock,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *DeviceConfigurationAck) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (deviceConfigurationAckDataBlock)
- _deviceConfigurationAckDataBlockErr := m.DeviceConfigurationAckDataBlock.Serialize(io)
- if _deviceConfigurationAckDataBlockErr != nil {
- return errors.New("Error serializing 'deviceConfigurationAckDataBlock' field " + _deviceConfigurationAckDataBlockErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *DeviceConfigurationAck) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "deviceConfigurationAckDataBlock":
- var data *DeviceConfigurationAckDataBlock
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.DeviceConfigurationAckDataBlock = data
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *DeviceConfigurationAck) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.DeviceConfigurationAckDataBlock, xml.StartElement{Name: xml.Name{Local: "deviceConfigurationAckDataBlock"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go
deleted file mode 100644
index c865e8b..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go
+++ /dev/null
@@ -1,205 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DeviceConfigurationAckDataBlock struct {
- CommunicationChannelId uint8
- SequenceCounter uint8
- Status Status
- IDeviceConfigurationAckDataBlock
-}
-
-// The corresponding interface
-type IDeviceConfigurationAckDataBlock interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-func NewDeviceConfigurationAckDataBlock(communicationChannelId uint8, sequenceCounter uint8, status Status) *DeviceConfigurationAckDataBlock {
- return &DeviceConfigurationAckDataBlock{CommunicationChannelId: communicationChannelId, SequenceCounter: sequenceCounter, Status: status}
-}
-
-func CastDeviceConfigurationAckDataBlock(structType interface{}) DeviceConfigurationAckDataBlock {
- castFunc := func(typ interface{}) DeviceConfigurationAckDataBlock {
- if casted, ok := typ.(DeviceConfigurationAckDataBlock); ok {
- return casted
- }
- if casted, ok := typ.(*DeviceConfigurationAckDataBlock); ok {
- return *casted
- }
- return DeviceConfigurationAckDataBlock{}
- }
- return castFunc(structType)
-}
-
-func (m *DeviceConfigurationAckDataBlock) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Implicit Field (structureLength)
- lengthInBits += 8
-
- // Simple field (communicationChannelId)
- lengthInBits += 8
-
- // Simple field (sequenceCounter)
- lengthInBits += 8
-
- // Enum Field (status)
- lengthInBits += 8
-
- return lengthInBits
-}
-
-func (m *DeviceConfigurationAckDataBlock) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DeviceConfigurationAckDataBlockParse(io *utils.ReadBuffer) (*DeviceConfigurationAckDataBlock, error) {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _, _structureLengthErr := io.ReadUint8(8)
- if _structureLengthErr != nil {
- return nil, errors.New("Error parsing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (communicationChannelId)
- communicationChannelId, _communicationChannelIdErr := io.ReadUint8(8)
- if _communicationChannelIdErr != nil {
- return nil, errors.New("Error parsing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Simple Field (sequenceCounter)
- sequenceCounter, _sequenceCounterErr := io.ReadUint8(8)
- if _sequenceCounterErr != nil {
- return nil, errors.New("Error parsing 'sequenceCounter' field " + _sequenceCounterErr.Error())
- }
-
- // Enum field (status)
- status, _statusErr := StatusParse(io)
- if _statusErr != nil {
- return nil, errors.New("Error parsing 'status' field " + _statusErr.Error())
- }
-
- // Create the instance
- return NewDeviceConfigurationAckDataBlock(communicationChannelId, sequenceCounter, status), nil
-}
-
-func (m *DeviceConfigurationAckDataBlock) Serialize(io utils.WriteBuffer) error {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- structureLength := uint8(uint8(m.LengthInBytes()))
- _structureLengthErr := io.WriteUint8(8, (structureLength))
- if _structureLengthErr != nil {
- return errors.New("Error serializing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (communicationChannelId)
- communicationChannelId := uint8(m.CommunicationChannelId)
- _communicationChannelIdErr := io.WriteUint8(8, (communicationChannelId))
- if _communicationChannelIdErr != nil {
- return errors.New("Error serializing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Simple Field (sequenceCounter)
- sequenceCounter := uint8(m.SequenceCounter)
- _sequenceCounterErr := io.WriteUint8(8, (sequenceCounter))
- if _sequenceCounterErr != nil {
- return errors.New("Error serializing 'sequenceCounter' field " + _sequenceCounterErr.Error())
- }
-
- // Enum field (status)
- status := CastStatus(m.Status)
- _statusErr := status.Serialize(io)
- if _statusErr != nil {
- return errors.New("Error serializing 'status' field " + _statusErr.Error())
- }
-
- return nil
-}
-
-func (m *DeviceConfigurationAckDataBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "communicationChannelId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.CommunicationChannelId = data
- case "sequenceCounter":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.SequenceCounter = data
- case "status":
- var data Status
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.Status = data
- }
- }
- }
-}
-
-func (m *DeviceConfigurationAckDataBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := "org.apache.plc4x.java.knxnetip.readwrite.DeviceConfigurationAckDataBlock"
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.CommunicationChannelId, xml.StartElement{Name: xml.Name{Local: "communicationChannelId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.SequenceCounter, xml.StartElement{Name: xml.Name{Local: "sequenceCounter"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Status, xml.StartElement{Name: xml.Name{Local: "status"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationRequest.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationRequest.go
deleted file mode 100644
index 7c924bc..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationRequest.go
+++ /dev/null
@@ -1,186 +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 (
- "encoding/xml"
- "errors"
- "io"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DeviceConfigurationRequest struct {
- DeviceConfigurationRequestDataBlock *DeviceConfigurationRequestDataBlock
- Cemi *CEMI
- Parent *KNXNetIPMessage
- IDeviceConfigurationRequest
-}
-
-// The corresponding interface
-type IDeviceConfigurationRequest interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *DeviceConfigurationRequest) MsgType() uint16 {
- return 0x0310
-}
-
-
-func (m *DeviceConfigurationRequest) InitializeParent(parent *KNXNetIPMessage) {
-}
-
-func NewDeviceConfigurationRequest(deviceConfigurationRequestDataBlock *DeviceConfigurationRequestDataBlock, cemi *CEMI, ) *KNXNetIPMessage {
- child := &DeviceConfigurationRequest{
- DeviceConfigurationRequestDataBlock: deviceConfigurationRequestDataBlock,
- Cemi: cemi,
- Parent: NewKNXNetIPMessage(),
- }
- child.Parent.Child = child
- return child.Parent
-}
-
-func CastDeviceConfigurationRequest(structType interface{}) DeviceConfigurationRequest {
- castFunc := func(typ interface{}) DeviceConfigurationRequest {
- if casted, ok := typ.(DeviceConfigurationRequest); ok {
- return casted
- }
- if casted, ok := typ.(*DeviceConfigurationRequest); ok {
- return *casted
- }
- if casted, ok := typ.(KNXNetIPMessage); ok {
- return CastDeviceConfigurationRequest(casted.Child)
- }
- if casted, ok := typ.(*KNXNetIPMessage); ok {
- return CastDeviceConfigurationRequest(casted.Child)
- }
- return DeviceConfigurationRequest{}
- }
- return castFunc(structType)
-}
-
-func (m *DeviceConfigurationRequest) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Simple field (deviceConfigurationRequestDataBlock)
- lengthInBits += m.DeviceConfigurationRequestDataBlock.LengthInBits()
-
- // Simple field (cemi)
- lengthInBits += m.Cemi.LengthInBits()
-
- return lengthInBits
-}
-
-func (m *DeviceConfigurationRequest) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DeviceConfigurationRequestParse(io *utils.ReadBuffer, totalLength uint16) (*KNXNetIPMessage, error) {
-
- // Simple Field (deviceConfigurationRequestDataBlock)
- deviceConfigurationRequestDataBlock, _deviceConfigurationRequestDataBlockErr := DeviceConfigurationRequestDataBlockParse(io)
- if _deviceConfigurationRequestDataBlockErr != nil {
- return nil, errors.New("Error parsing 'deviceConfigurationRequestDataBlock' field " + _deviceConfigurationRequestDataBlockErr.Error())
- }
-
- // Simple Field (cemi)
- cemi, _cemiErr := CEMIParse(io, uint8(totalLength) - uint8(uint8(uint8(uint8(6)) + uint8(deviceConfigurationRequestDataBlock.LengthInBytes()))))
- if _cemiErr != nil {
- return nil, errors.New("Error parsing 'cemi' field " + _cemiErr.Error())
- }
-
- // Create a partially initialized instance
- _child := &DeviceConfigurationRequest{
- DeviceConfigurationRequestDataBlock: deviceConfigurationRequestDataBlock,
- Cemi: cemi,
- Parent: &KNXNetIPMessage{},
- }
- _child.Parent.Child = _child
- return _child.Parent, nil
-}
-
-func (m *DeviceConfigurationRequest) Serialize(io utils.WriteBuffer) error {
- ser := func() error {
-
- // Simple Field (deviceConfigurationRequestDataBlock)
- _deviceConfigurationRequestDataBlockErr := m.DeviceConfigurationRequestDataBlock.Serialize(io)
- if _deviceConfigurationRequestDataBlockErr != nil {
- return errors.New("Error serializing 'deviceConfigurationRequestDataBlock' field " + _deviceConfigurationRequestDataBlockErr.Error())
- }
-
- // Simple Field (cemi)
- _cemiErr := m.Cemi.Serialize(io)
- if _cemiErr != nil {
- return errors.New("Error serializing 'cemi' field " + _cemiErr.Error())
- }
-
- return nil
- }
- return m.Parent.SerializeParent(io, m, ser)
-}
-
-func (m *DeviceConfigurationRequest) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- token = start
- for {
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "deviceConfigurationRequestDataBlock":
- var data *DeviceConfigurationRequestDataBlock
- if err := d.DecodeElement(data, &tok); err != nil {
- return err
- }
- m.DeviceConfigurationRequestDataBlock = data
- case "cemi":
- var dt *CEMI
- if err := d.DecodeElement(&dt, &tok); err != nil {
- return err
- }
- m.Cemi = dt
- }
- }
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- }
-}
-
-func (m *DeviceConfigurationRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- if err := e.EncodeElement(m.DeviceConfigurationRequestDataBlock, xml.StartElement{Name: xml.Name{Local: "deviceConfigurationRequestDataBlock"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.Cemi, xml.StartElement{Name: xml.Name{Local: "cemi"}}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go
deleted file mode 100644
index 17f8f4b..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go
+++ /dev/null
@@ -1,205 +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 (
- "encoding/xml"
- "errors"
- "io"
- log "github.com/sirupsen/logrus"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DeviceConfigurationRequestDataBlock struct {
- CommunicationChannelId uint8
- SequenceCounter uint8
- IDeviceConfigurationRequestDataBlock
-}
-
-// The corresponding interface
-type IDeviceConfigurationRequestDataBlock interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-func NewDeviceConfigurationRequestDataBlock(communicationChannelId uint8, sequenceCounter uint8) *DeviceConfigurationRequestDataBlock {
- return &DeviceConfigurationRequestDataBlock{CommunicationChannelId: communicationChannelId, SequenceCounter: sequenceCounter}
-}
-
-func CastDeviceConfigurationRequestDataBlock(structType interface{}) DeviceConfigurationRequestDataBlock {
- castFunc := func(typ interface{}) DeviceConfigurationRequestDataBlock {
- if casted, ok := typ.(DeviceConfigurationRequestDataBlock); ok {
- return casted
- }
- if casted, ok := typ.(*DeviceConfigurationRequestDataBlock); ok {
- return *casted
- }
- return DeviceConfigurationRequestDataBlock{}
- }
- return castFunc(structType)
-}
-
-func (m *DeviceConfigurationRequestDataBlock) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Implicit Field (structureLength)
- lengthInBits += 8
-
- // Simple field (communicationChannelId)
- lengthInBits += 8
-
- // Simple field (sequenceCounter)
- lengthInBits += 8
-
- // Reserved Field (reserved)
- lengthInBits += 8
-
- return lengthInBits
-}
-
-func (m *DeviceConfigurationRequestDataBlock) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DeviceConfigurationRequestDataBlockParse(io *utils.ReadBuffer) (*DeviceConfigurationRequestDataBlock, error) {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _, _structureLengthErr := io.ReadUint8(8)
- if _structureLengthErr != nil {
- return nil, errors.New("Error parsing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (communicationChannelId)
- communicationChannelId, _communicationChannelIdErr := io.ReadUint8(8)
- if _communicationChannelIdErr != nil {
- return nil, errors.New("Error parsing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Simple Field (sequenceCounter)
- sequenceCounter, _sequenceCounterErr := io.ReadUint8(8)
- if _sequenceCounterErr != nil {
- return nil, errors.New("Error parsing 'sequenceCounter' field " + _sequenceCounterErr.Error())
- }
-
- // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
- {
- reserved, _err := io.ReadUint8(8)
- if _err != nil {
- return nil, errors.New("Error parsing 'reserved' field " + _err.Error())
- }
- if reserved != uint8(0x00) {
- log.WithFields(log.Fields{
- "expected value": uint8(0x00),
- "got value": reserved,
- }).Info("Got unexpected response.")
- }
- }
-
- // Create the instance
- return NewDeviceConfigurationRequestDataBlock(communicationChannelId, sequenceCounter), nil
-}
-
-func (m *DeviceConfigurationRequestDataBlock) Serialize(io utils.WriteBuffer) error {
-
- // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- structureLength := uint8(uint8(m.LengthInBytes()))
- _structureLengthErr := io.WriteUint8(8, (structureLength))
- if _structureLengthErr != nil {
- return errors.New("Error serializing 'structureLength' field " + _structureLengthErr.Error())
- }
-
- // Simple Field (communicationChannelId)
- communicationChannelId := uint8(m.CommunicationChannelId)
- _communicationChannelIdErr := io.WriteUint8(8, (communicationChannelId))
- if _communicationChannelIdErr != nil {
- return errors.New("Error serializing 'communicationChannelId' field " + _communicationChannelIdErr.Error())
- }
-
- // Simple Field (sequenceCounter)
- sequenceCounter := uint8(m.SequenceCounter)
- _sequenceCounterErr := io.WriteUint8(8, (sequenceCounter))
- if _sequenceCounterErr != nil {
- return errors.New("Error serializing 'sequenceCounter' field " + _sequenceCounterErr.Error())
- }
-
- // Reserved Field (reserved)
- {
- _err := io.WriteUint8(8, uint8(0x00))
- if _err != nil {
- return errors.New("Error serializing 'reserved' field " + _err.Error())
- }
- }
-
- return nil
-}
-
-func (m *DeviceConfigurationRequestDataBlock) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "communicationChannelId":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.CommunicationChannelId = data
- case "sequenceCounter":
- var data uint8
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.SequenceCounter = data
- }
- }
- }
-}
-
-func (m *DeviceConfigurationRequestDataBlock) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := "org.apache.plc4x.java.knxnetip.readwrite.DeviceConfigurationRequestDataBlock"
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.CommunicationChannelId, xml.StartElement{Name: xml.Name{Local: "communicationChannelId"}}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.SequenceCounter, xml.StartElement{Name: xml.Name{Local: "sequenceCounter"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceStatus.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceStatus.go
deleted file mode 100644
index 178d6c6..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DeviceStatus.go
+++ /dev/null
@@ -1,163 +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 (
- "encoding/xml"
- "errors"
- "io"
- log "github.com/sirupsen/logrus"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DeviceStatus struct {
- ProgramMode bool
- IDeviceStatus
-}
-
-// The corresponding interface
-type IDeviceStatus interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-func NewDeviceStatus(programMode bool) *DeviceStatus {
- return &DeviceStatus{ProgramMode: programMode}
-}
-
-func CastDeviceStatus(structType interface{}) DeviceStatus {
- castFunc := func(typ interface{}) DeviceStatus {
- if casted, ok := typ.(DeviceStatus); ok {
- return casted
- }
- if casted, ok := typ.(*DeviceStatus); ok {
- return *casted
- }
- return DeviceStatus{}
- }
- return castFunc(structType)
-}
-
-func (m *DeviceStatus) LengthInBits() uint16 {
- lengthInBits := uint16(0)
-
- // Reserved Field (reserved)
- lengthInBits += 7
-
- // Simple field (programMode)
- lengthInBits += 1
-
- return lengthInBits
-}
-
-func (m *DeviceStatus) LengthInBytes() uint16 {
- return m.LengthInBits() / 8
-}
-
-func DeviceStatusParse(io *utils.ReadBuffer) (*DeviceStatus, error) {
-
- // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
- {
- reserved, _err := io.ReadUint8(7)
- if _err != nil {
- return nil, errors.New("Error parsing 'reserved' field " + _err.Error())
- }
- if reserved != uint8(0x00) {
- log.WithFields(log.Fields{
- "expected value": uint8(0x00),
- "got value": reserved,
- }).Info("Got unexpected response.")
- }
- }
-
- // Simple Field (programMode)
- programMode, _programModeErr := io.ReadBit()
- if _programModeErr != nil {
- return nil, errors.New("Error parsing 'programMode' field " + _programModeErr.Error())
- }
-
- // Create the instance
- return NewDeviceStatus(programMode), nil
-}
-
-func (m *DeviceStatus) Serialize(io utils.WriteBuffer) error {
-
- // Reserved Field (reserved)
- {
- _err := io.WriteUint8(7, uint8(0x00))
- if _err != nil {
- return errors.New("Error serializing 'reserved' field " + _err.Error())
- }
- }
-
- // Simple Field (programMode)
- programMode := bool(m.ProgramMode)
- _programModeErr := io.WriteBit((programMode))
- if _programModeErr != nil {
- return errors.New("Error serializing 'programMode' field " + _programModeErr.Error())
- }
-
- return nil
-}
-
-func (m *DeviceStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
- var token xml.Token
- var err error
- for {
- token, err = d.Token()
- if err != nil {
- if err == io.EOF {
- return nil
- }
- return err
- }
- switch token.(type) {
- case xml.StartElement:
- tok := token.(xml.StartElement)
- switch tok.Name.Local {
- case "programMode":
- var data bool
- if err := d.DecodeElement(&data, &tok); err != nil {
- return err
- }
- m.ProgramMode = data
- }
- }
- }
-}
-
-func (m *DeviceStatus) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- className := "org.apache.plc4x.java.knxnetip.readwrite.DeviceStatus"
- if err := e.EncodeToken(xml.StartElement{Name: start.Name, Attr: []xml.Attr{
- {Name: xml.Name{Local: "className"}, Value: className},
- }}); err != nil {
- return err
- }
- if err := e.EncodeElement(m.ProgramMode, xml.StartElement{Name: xml.Name{Local: "programMode"}}); err != nil {
- return err
- }
- if err := e.EncodeToken(xml.EndElement{Name: start.Name}); err != nil {
- return err
- }
- return nil
-}
-
diff --git a/plc4go/internal/plc4go/knxnetip/readwrite/model/DisconnectRequest.go b/plc4go/internal/plc4go/knxnetip/readwrite/model/DisconnectRequest.go
deleted file mode 100644
index b87feaf..0000000
--- a/plc4go/internal/plc4go/knxnetip/readwrite/model/DisconnectRequest.go
+++ /dev/null
@@ -1,213 +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 (
- "encoding/xml"
- "errors"
- "io"
- log "github.com/sirupsen/logrus"
- "plc4x.apache.org/plc4go-modbus-driver/v0/internal/plc4go/utils"
-)
-
-// The data-structure of this message
-type DisconnectRequest struct {
- CommunicationChannelId uint8
- HpaiControlEndpoint *HPAIControlEndpoint
- Parent *KNXNetIPMessage
- IDisconnectRequest
-}
-
-// The corresponding interface
-type IDisconnectRequest interface {
- LengthInBytes() uint16
- LengthInBits() uint16
- Serialize(io utils.WriteBuffer) error
- xml.Marshaler
-}
-
-///////////////////////////////////////////////////////////
-// Accessors for discriminator values.
-///////////////////////////////////////////////////////////
-func (m *DisconnectRequest) MsgType() uint16 {
- return 0x0209
-}
-
-
... 15421 lines suppressed ...