diff --git a/plc4go/protocols/bacnetip/readwrite/ParserHelper.go b/plc4go/protocols/bacnetip/readwrite/ParserHelper.go index 885c0edef6a..1b49121e693 100644 --- a/plc4go/protocols/bacnetip/readwrite/ParserHelper.go +++ b/plc4go/protocols/bacnetip/readwrite/ParserHelper.go @@ -914,9 +914,13 @@ func (m BacnetipParserHelper) Parse(typeName string, arguments []string, io util return model.BACnetConfirmedServiceRequestConfirmedTextMessageMessageClassParse(io, tagNumber) case "BACnetAddressBinding": return model.BACnetAddressBindingParse(io) + case "BACnetLandingCallStatusCommand": + return model.BACnetLandingCallStatusCommandParse(io) case "ListOfCovNotificationsValue": objectTypeArgument := model.BACnetObjectTypeByName(arguments[0]) return model.ListOfCovNotificationsValueParse(io, objectTypeArgument) + case "BACnetLandingCallStatus": + return model.BACnetLandingCallStatusParse(io) case "BACnetEventParameterChangeOfStateListOfValues": tagNumber, err := utils.StrToUint8(arguments[0]) if err != nil { diff --git a/plc4go/protocols/bacnetip/readwrite/XmlParserHelper.go b/plc4go/protocols/bacnetip/readwrite/XmlParserHelper.go index 08ca8c6ba64..63f4872c1cb 100644 --- a/plc4go/protocols/bacnetip/readwrite/XmlParserHelper.go +++ b/plc4go/protocols/bacnetip/readwrite/XmlParserHelper.go @@ -1041,9 +1041,13 @@ func (m BacnetipXmlParserHelper) Parse(typeName string, xmlString string, parser return model.BACnetConfirmedServiceRequestConfirmedTextMessageMessageClassParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)), tagNumber) case "BACnetAddressBinding": return model.BACnetAddressBindingParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString))) + case "BACnetLandingCallStatusCommand": + return model.BACnetLandingCallStatusCommandParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString))) case "ListOfCovNotificationsValue": objectTypeArgument := model.BACnetObjectTypeByName(parserArguments[0]) return model.ListOfCovNotificationsValueParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)), objectTypeArgument) + case "BACnetLandingCallStatus": + return model.BACnetLandingCallStatusParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString))) case "BACnetEventParameterChangeOfStateListOfValues": parsedUint0, err := strconv.ParseUint(parserArguments[0], 10, 8) if err != nil { diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go index f3e986b31c1..e6400f92f6f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedData.go @@ -538,6 +538,8 @@ func BACnetConstructedDataParse(readBuffer utils.ReadBuffer, tagNumber uint8, ob _child, typeSwitchError = BACnetConstructedDataFullDutyBaselineParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_GROUP_MEMBER_NAMES: // BACnetConstructedDataGroupMemberNames _child, typeSwitchError = BACnetConstructedDataGroupMemberNamesParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) + case true && propertyIdentifierArgument == BACnetPropertyIdentifier_GROUP_MODE: // BACnetConstructedDataGroupMode + _child, typeSwitchError = BACnetConstructedDataGroupModeParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case objectTypeArgument == BACnetObjectType_ACCUMULATOR && propertyIdentifierArgument == BACnetPropertyIdentifier_HIGH_LIMIT: // BACnetConstructedDataAccumulatorHighLimit _child, typeSwitchError = BACnetConstructedDataAccumulatorHighLimitParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_HIGH_LIMIT: // BACnetConstructedDataHighLimit @@ -596,6 +598,10 @@ func BACnetConstructedDataParse(readBuffer utils.ReadBuffer, tagNumber uint8, ob _child, typeSwitchError = BACnetConstructedDataIPv6ZoneIndexParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_KEY_SETS: // BACnetConstructedDataKeySets _child, typeSwitchError = BACnetConstructedDataKeySetsParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) + case true && propertyIdentifierArgument == BACnetPropertyIdentifier_LANDING_CALL_CONTROL: // BACnetConstructedDataLandingCallControl + _child, typeSwitchError = BACnetConstructedDataLandingCallControlParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) + case true && propertyIdentifierArgument == BACnetPropertyIdentifier_LANDING_CALLS: // BACnetConstructedDataLandingCalls + _child, typeSwitchError = BACnetConstructedDataLandingCallsParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_LANDING_DOOR_STATUS: // BACnetConstructedDataLandingDoorStatus _child, typeSwitchError = BACnetConstructedDataLandingDoorStatusParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_LAST_ACCESS_EVENT: // BACnetConstructedDataLastAccessEvent @@ -644,6 +650,8 @@ func BACnetConstructedDataParse(readBuffer utils.ReadBuffer, tagNumber uint8, ob _child, typeSwitchError = BACnetConstructedDataLowerDeckParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_MAC_ADDRESS: // BACnetConstructedDataMACAddress _child, typeSwitchError = BACnetConstructedDataMACAddressParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) + case true && propertyIdentifierArgument == BACnetPropertyIdentifier_MACHINE_ROOM_ID: // BACnetConstructedDataMachineRoomID + _child, typeSwitchError = BACnetConstructedDataMachineRoomIDParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_MAKING_CAR_CALL: // BACnetConstructedDataMakingCarCall _child, typeSwitchError = BACnetConstructedDataMakingCarCallParse(readBuffer, tagNumber, objectTypeArgument, propertyIdentifierArgument) case true && propertyIdentifierArgument == BACnetPropertyIdentifier_MANIPULATED_VARIABLE_REFERENCE: // BACnetConstructedDataManipulatedVariableReference diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataGroupMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataGroupMode.go new file mode 100644 index 00000000000..f6baca2cdf2 --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataGroupMode.go @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetConstructedDataGroupMode is the data-structure of this message +type BACnetConstructedDataGroupMode struct { + *BACnetConstructedData + GroupMode *BACnetLiftGroupModeTagged + + // Arguments. + TagNumber uint8 +} + +// IBACnetConstructedDataGroupMode is the corresponding interface of BACnetConstructedDataGroupMode +type IBACnetConstructedDataGroupMode interface { + IBACnetConstructedData + // GetGroupMode returns GroupMode (property field) + GetGroupMode() *BACnetLiftGroupModeTagged + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for discriminator values. +/////////////////////// + +func (m *BACnetConstructedDataGroupMode) GetObjectTypeArgument() BACnetObjectType { + return 0 +} + +func (m *BACnetConstructedDataGroupMode) GetPropertyIdentifierArgument() BACnetPropertyIdentifier { + return BACnetPropertyIdentifier_GROUP_MODE +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +func (m *BACnetConstructedDataGroupMode) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) { + m.BACnetConstructedData.OpeningTag = openingTag + m.BACnetConstructedData.ClosingTag = closingTag +} + +func (m *BACnetConstructedDataGroupMode) GetParent() *BACnetConstructedData { + return m.BACnetConstructedData +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetConstructedDataGroupMode) GetGroupMode() *BACnetLiftGroupModeTagged { + return m.GroupMode +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetConstructedDataGroupMode factory function for BACnetConstructedDataGroupMode +func NewBACnetConstructedDataGroupMode(groupMode *BACnetLiftGroupModeTagged, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataGroupMode { + _result := &BACnetConstructedDataGroupMode{ + GroupMode: groupMode, + BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber), + } + _result.Child = _result + return _result +} + +func CastBACnetConstructedDataGroupMode(structType interface{}) *BACnetConstructedDataGroupMode { + if casted, ok := structType.(BACnetConstructedDataGroupMode); ok { + return &casted + } + if casted, ok := structType.(*BACnetConstructedDataGroupMode); ok { + return casted + } + if casted, ok := structType.(BACnetConstructedData); ok { + return CastBACnetConstructedDataGroupMode(casted.Child) + } + if casted, ok := structType.(*BACnetConstructedData); ok { + return CastBACnetConstructedDataGroupMode(casted.Child) + } + return nil +} + +func (m *BACnetConstructedDataGroupMode) GetTypeName() string { + return "BACnetConstructedDataGroupMode" +} + +func (m *BACnetConstructedDataGroupMode) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetConstructedDataGroupMode) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(m.GetParentLengthInBits()) + + // Simple field (groupMode) + lengthInBits += m.GroupMode.GetLengthInBits() + + return lengthInBits +} + +func (m *BACnetConstructedDataGroupMode) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetConstructedDataGroupModeParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataGroupMode, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetConstructedDataGroupMode"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Simple Field (groupMode) + if pullErr := readBuffer.PullContext("groupMode"); pullErr != nil { + return nil, pullErr + } + _groupMode, _groupModeErr := BACnetLiftGroupModeTaggedParse(readBuffer, uint8(uint8(0)), TagClass(TagClass_APPLICATION_TAGS)) + if _groupModeErr != nil { + return nil, errors.Wrap(_groupModeErr, "Error parsing 'groupMode' field") + } + groupMode := CastBACnetLiftGroupModeTagged(_groupMode) + if closeErr := readBuffer.CloseContext("groupMode"); closeErr != nil { + return nil, closeErr + } + + if closeErr := readBuffer.CloseContext("BACnetConstructedDataGroupMode"); closeErr != nil { + return nil, closeErr + } + + // Create a partially initialized instance + _child := &BACnetConstructedDataGroupMode{ + GroupMode: CastBACnetLiftGroupModeTagged(groupMode), + BACnetConstructedData: &BACnetConstructedData{}, + } + _child.BACnetConstructedData.Child = _child + return _child, nil +} + +func (m *BACnetConstructedDataGroupMode) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + ser := func() error { + if pushErr := writeBuffer.PushContext("BACnetConstructedDataGroupMode"); pushErr != nil { + return pushErr + } + + // Simple Field (groupMode) + if pushErr := writeBuffer.PushContext("groupMode"); pushErr != nil { + return pushErr + } + _groupModeErr := m.GroupMode.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("groupMode"); popErr != nil { + return popErr + } + if _groupModeErr != nil { + return errors.Wrap(_groupModeErr, "Error serializing 'groupMode' field") + } + + if popErr := writeBuffer.PopContext("BACnetConstructedDataGroupMode"); popErr != nil { + return popErr + } + return nil + } + return m.SerializeParent(writeBuffer, m, ser) +} + +func (m *BACnetConstructedDataGroupMode) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataLandingCallControl.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataLandingCallControl.go new file mode 100644 index 00000000000..83a891fa360 --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataLandingCallControl.go @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetConstructedDataLandingCallControl is the data-structure of this message +type BACnetConstructedDataLandingCallControl struct { + *BACnetConstructedData + LandingCallControl *BACnetLandingCallStatus + + // Arguments. + TagNumber uint8 +} + +// IBACnetConstructedDataLandingCallControl is the corresponding interface of BACnetConstructedDataLandingCallControl +type IBACnetConstructedDataLandingCallControl interface { + IBACnetConstructedData + // GetLandingCallControl returns LandingCallControl (property field) + GetLandingCallControl() *BACnetLandingCallStatus + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for discriminator values. +/////////////////////// + +func (m *BACnetConstructedDataLandingCallControl) GetObjectTypeArgument() BACnetObjectType { + return 0 +} + +func (m *BACnetConstructedDataLandingCallControl) GetPropertyIdentifierArgument() BACnetPropertyIdentifier { + return BACnetPropertyIdentifier_LANDING_CALL_CONTROL +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +func (m *BACnetConstructedDataLandingCallControl) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) { + m.BACnetConstructedData.OpeningTag = openingTag + m.BACnetConstructedData.ClosingTag = closingTag +} + +func (m *BACnetConstructedDataLandingCallControl) GetParent() *BACnetConstructedData { + return m.BACnetConstructedData +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetConstructedDataLandingCallControl) GetLandingCallControl() *BACnetLandingCallStatus { + return m.LandingCallControl +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetConstructedDataLandingCallControl factory function for BACnetConstructedDataLandingCallControl +func NewBACnetConstructedDataLandingCallControl(landingCallControl *BACnetLandingCallStatus, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataLandingCallControl { + _result := &BACnetConstructedDataLandingCallControl{ + LandingCallControl: landingCallControl, + BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber), + } + _result.Child = _result + return _result +} + +func CastBACnetConstructedDataLandingCallControl(structType interface{}) *BACnetConstructedDataLandingCallControl { + if casted, ok := structType.(BACnetConstructedDataLandingCallControl); ok { + return &casted + } + if casted, ok := structType.(*BACnetConstructedDataLandingCallControl); ok { + return casted + } + if casted, ok := structType.(BACnetConstructedData); ok { + return CastBACnetConstructedDataLandingCallControl(casted.Child) + } + if casted, ok := structType.(*BACnetConstructedData); ok { + return CastBACnetConstructedDataLandingCallControl(casted.Child) + } + return nil +} + +func (m *BACnetConstructedDataLandingCallControl) GetTypeName() string { + return "BACnetConstructedDataLandingCallControl" +} + +func (m *BACnetConstructedDataLandingCallControl) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetConstructedDataLandingCallControl) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(m.GetParentLengthInBits()) + + // Simple field (landingCallControl) + lengthInBits += m.LandingCallControl.GetLengthInBits() + + return lengthInBits +} + +func (m *BACnetConstructedDataLandingCallControl) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetConstructedDataLandingCallControlParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataLandingCallControl, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetConstructedDataLandingCallControl"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Simple Field (landingCallControl) + if pullErr := readBuffer.PullContext("landingCallControl"); pullErr != nil { + return nil, pullErr + } + _landingCallControl, _landingCallControlErr := BACnetLandingCallStatusParse(readBuffer) + if _landingCallControlErr != nil { + return nil, errors.Wrap(_landingCallControlErr, "Error parsing 'landingCallControl' field") + } + landingCallControl := CastBACnetLandingCallStatus(_landingCallControl) + if closeErr := readBuffer.CloseContext("landingCallControl"); closeErr != nil { + return nil, closeErr + } + + if closeErr := readBuffer.CloseContext("BACnetConstructedDataLandingCallControl"); closeErr != nil { + return nil, closeErr + } + + // Create a partially initialized instance + _child := &BACnetConstructedDataLandingCallControl{ + LandingCallControl: CastBACnetLandingCallStatus(landingCallControl), + BACnetConstructedData: &BACnetConstructedData{}, + } + _child.BACnetConstructedData.Child = _child + return _child, nil +} + +func (m *BACnetConstructedDataLandingCallControl) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + ser := func() error { + if pushErr := writeBuffer.PushContext("BACnetConstructedDataLandingCallControl"); pushErr != nil { + return pushErr + } + + // Simple Field (landingCallControl) + if pushErr := writeBuffer.PushContext("landingCallControl"); pushErr != nil { + return pushErr + } + _landingCallControlErr := m.LandingCallControl.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("landingCallControl"); popErr != nil { + return popErr + } + if _landingCallControlErr != nil { + return errors.Wrap(_landingCallControlErr, "Error serializing 'landingCallControl' field") + } + + if popErr := writeBuffer.PopContext("BACnetConstructedDataLandingCallControl"); popErr != nil { + return popErr + } + return nil + } + return m.SerializeParent(writeBuffer, m, ser) +} + +func (m *BACnetConstructedDataLandingCallControl) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataLandingCalls.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataLandingCalls.go new file mode 100644 index 00000000000..0daae866fec --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataLandingCalls.go @@ -0,0 +1,226 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetConstructedDataLandingCalls is the data-structure of this message +type BACnetConstructedDataLandingCalls struct { + *BACnetConstructedData + LandingCallStatus []*BACnetLandingCallStatus + + // Arguments. + TagNumber uint8 +} + +// IBACnetConstructedDataLandingCalls is the corresponding interface of BACnetConstructedDataLandingCalls +type IBACnetConstructedDataLandingCalls interface { + IBACnetConstructedData + // GetLandingCallStatus returns LandingCallStatus (property field) + GetLandingCallStatus() []*BACnetLandingCallStatus + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for discriminator values. +/////////////////////// + +func (m *BACnetConstructedDataLandingCalls) GetObjectTypeArgument() BACnetObjectType { + return 0 +} + +func (m *BACnetConstructedDataLandingCalls) GetPropertyIdentifierArgument() BACnetPropertyIdentifier { + return BACnetPropertyIdentifier_LANDING_CALLS +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +func (m *BACnetConstructedDataLandingCalls) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) { + m.BACnetConstructedData.OpeningTag = openingTag + m.BACnetConstructedData.ClosingTag = closingTag +} + +func (m *BACnetConstructedDataLandingCalls) GetParent() *BACnetConstructedData { + return m.BACnetConstructedData +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetConstructedDataLandingCalls) GetLandingCallStatus() []*BACnetLandingCallStatus { + return m.LandingCallStatus +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetConstructedDataLandingCalls factory function for BACnetConstructedDataLandingCalls +func NewBACnetConstructedDataLandingCalls(landingCallStatus []*BACnetLandingCallStatus, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataLandingCalls { + _result := &BACnetConstructedDataLandingCalls{ + LandingCallStatus: landingCallStatus, + BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber), + } + _result.Child = _result + return _result +} + +func CastBACnetConstructedDataLandingCalls(structType interface{}) *BACnetConstructedDataLandingCalls { + if casted, ok := structType.(BACnetConstructedDataLandingCalls); ok { + return &casted + } + if casted, ok := structType.(*BACnetConstructedDataLandingCalls); ok { + return casted + } + if casted, ok := structType.(BACnetConstructedData); ok { + return CastBACnetConstructedDataLandingCalls(casted.Child) + } + if casted, ok := structType.(*BACnetConstructedData); ok { + return CastBACnetConstructedDataLandingCalls(casted.Child) + } + return nil +} + +func (m *BACnetConstructedDataLandingCalls) GetTypeName() string { + return "BACnetConstructedDataLandingCalls" +} + +func (m *BACnetConstructedDataLandingCalls) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetConstructedDataLandingCalls) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(m.GetParentLengthInBits()) + + // Array field + if len(m.LandingCallStatus) > 0 { + for _, element := range m.LandingCallStatus { + lengthInBits += element.GetLengthInBits() + } + } + + return lengthInBits +} + +func (m *BACnetConstructedDataLandingCalls) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetConstructedDataLandingCallsParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataLandingCalls, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetConstructedDataLandingCalls"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Array field (landingCallStatus) + if pullErr := readBuffer.PullContext("landingCallStatus", utils.WithRenderAsList(true)); pullErr != nil { + return nil, pullErr + } + // Terminated array + landingCallStatus := make([]*BACnetLandingCallStatus, 0) + { + for !bool(IsBACnetConstructedDataClosingTag(readBuffer, false, tagNumber)) { + _item, _err := BACnetLandingCallStatusParse(readBuffer) + if _err != nil { + return nil, errors.Wrap(_err, "Error parsing 'landingCallStatus' field") + } + landingCallStatus = append(landingCallStatus, CastBACnetLandingCallStatus(_item)) + + } + } + if closeErr := readBuffer.CloseContext("landingCallStatus", utils.WithRenderAsList(true)); closeErr != nil { + return nil, closeErr + } + + if closeErr := readBuffer.CloseContext("BACnetConstructedDataLandingCalls"); closeErr != nil { + return nil, closeErr + } + + // Create a partially initialized instance + _child := &BACnetConstructedDataLandingCalls{ + LandingCallStatus: landingCallStatus, + BACnetConstructedData: &BACnetConstructedData{}, + } + _child.BACnetConstructedData.Child = _child + return _child, nil +} + +func (m *BACnetConstructedDataLandingCalls) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + ser := func() error { + if pushErr := writeBuffer.PushContext("BACnetConstructedDataLandingCalls"); pushErr != nil { + return pushErr + } + + // Array Field (landingCallStatus) + if m.LandingCallStatus != nil { + if pushErr := writeBuffer.PushContext("landingCallStatus", utils.WithRenderAsList(true)); pushErr != nil { + return pushErr + } + for _, _element := range m.LandingCallStatus { + _elementErr := _element.Serialize(writeBuffer) + if _elementErr != nil { + return errors.Wrap(_elementErr, "Error serializing 'landingCallStatus' field") + } + } + if popErr := writeBuffer.PopContext("landingCallStatus", utils.WithRenderAsList(true)); popErr != nil { + return popErr + } + } + + if popErr := writeBuffer.PopContext("BACnetConstructedDataLandingCalls"); popErr != nil { + return popErr + } + return nil + } + return m.SerializeParent(writeBuffer, m, ser) +} + +func (m *BACnetConstructedDataLandingCalls) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataMachineRoomID.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataMachineRoomID.go new file mode 100644 index 00000000000..c125ac21bee --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConstructedDataMachineRoomID.go @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetConstructedDataMachineRoomID is the data-structure of this message +type BACnetConstructedDataMachineRoomID struct { + *BACnetConstructedData + MachineRoomId *BACnetApplicationTagObjectIdentifier + + // Arguments. + TagNumber uint8 +} + +// IBACnetConstructedDataMachineRoomID is the corresponding interface of BACnetConstructedDataMachineRoomID +type IBACnetConstructedDataMachineRoomID interface { + IBACnetConstructedData + // GetMachineRoomId returns MachineRoomId (property field) + GetMachineRoomId() *BACnetApplicationTagObjectIdentifier + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for discriminator values. +/////////////////////// + +func (m *BACnetConstructedDataMachineRoomID) GetObjectTypeArgument() BACnetObjectType { + return 0 +} + +func (m *BACnetConstructedDataMachineRoomID) GetPropertyIdentifierArgument() BACnetPropertyIdentifier { + return BACnetPropertyIdentifier_MACHINE_ROOM_ID +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +func (m *BACnetConstructedDataMachineRoomID) InitializeParent(parent *BACnetConstructedData, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag) { + m.BACnetConstructedData.OpeningTag = openingTag + m.BACnetConstructedData.ClosingTag = closingTag +} + +func (m *BACnetConstructedDataMachineRoomID) GetParent() *BACnetConstructedData { + return m.BACnetConstructedData +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetConstructedDataMachineRoomID) GetMachineRoomId() *BACnetApplicationTagObjectIdentifier { + return m.MachineRoomId +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetConstructedDataMachineRoomID factory function for BACnetConstructedDataMachineRoomID +func NewBACnetConstructedDataMachineRoomID(machineRoomId *BACnetApplicationTagObjectIdentifier, openingTag *BACnetOpeningTag, closingTag *BACnetClosingTag, tagNumber uint8) *BACnetConstructedDataMachineRoomID { + _result := &BACnetConstructedDataMachineRoomID{ + MachineRoomId: machineRoomId, + BACnetConstructedData: NewBACnetConstructedData(openingTag, closingTag, tagNumber), + } + _result.Child = _result + return _result +} + +func CastBACnetConstructedDataMachineRoomID(structType interface{}) *BACnetConstructedDataMachineRoomID { + if casted, ok := structType.(BACnetConstructedDataMachineRoomID); ok { + return &casted + } + if casted, ok := structType.(*BACnetConstructedDataMachineRoomID); ok { + return casted + } + if casted, ok := structType.(BACnetConstructedData); ok { + return CastBACnetConstructedDataMachineRoomID(casted.Child) + } + if casted, ok := structType.(*BACnetConstructedData); ok { + return CastBACnetConstructedDataMachineRoomID(casted.Child) + } + return nil +} + +func (m *BACnetConstructedDataMachineRoomID) GetTypeName() string { + return "BACnetConstructedDataMachineRoomID" +} + +func (m *BACnetConstructedDataMachineRoomID) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetConstructedDataMachineRoomID) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(m.GetParentLengthInBits()) + + // Simple field (machineRoomId) + lengthInBits += m.MachineRoomId.GetLengthInBits() + + return lengthInBits +} + +func (m *BACnetConstructedDataMachineRoomID) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetConstructedDataMachineRoomIDParse(readBuffer utils.ReadBuffer, tagNumber uint8, objectTypeArgument BACnetObjectType, propertyIdentifierArgument BACnetPropertyIdentifier) (*BACnetConstructedDataMachineRoomID, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetConstructedDataMachineRoomID"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Simple Field (machineRoomId) + if pullErr := readBuffer.PullContext("machineRoomId"); pullErr != nil { + return nil, pullErr + } + _machineRoomId, _machineRoomIdErr := BACnetApplicationTagParse(readBuffer) + if _machineRoomIdErr != nil { + return nil, errors.Wrap(_machineRoomIdErr, "Error parsing 'machineRoomId' field") + } + machineRoomId := CastBACnetApplicationTagObjectIdentifier(_machineRoomId) + if closeErr := readBuffer.CloseContext("machineRoomId"); closeErr != nil { + return nil, closeErr + } + + if closeErr := readBuffer.CloseContext("BACnetConstructedDataMachineRoomID"); closeErr != nil { + return nil, closeErr + } + + // Create a partially initialized instance + _child := &BACnetConstructedDataMachineRoomID{ + MachineRoomId: CastBACnetApplicationTagObjectIdentifier(machineRoomId), + BACnetConstructedData: &BACnetConstructedData{}, + } + _child.BACnetConstructedData.Child = _child + return _child, nil +} + +func (m *BACnetConstructedDataMachineRoomID) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + ser := func() error { + if pushErr := writeBuffer.PushContext("BACnetConstructedDataMachineRoomID"); pushErr != nil { + return pushErr + } + + // Simple Field (machineRoomId) + if pushErr := writeBuffer.PushContext("machineRoomId"); pushErr != nil { + return pushErr + } + _machineRoomIdErr := m.MachineRoomId.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("machineRoomId"); popErr != nil { + return popErr + } + if _machineRoomIdErr != nil { + return errors.Wrap(_machineRoomIdErr, "Error serializing 'machineRoomId' field") + } + + if popErr := writeBuffer.PopContext("BACnetConstructedDataMachineRoomID"); popErr != nil { + return popErr + } + return nil + } + return m.SerializeParent(writeBuffer, m, ser) +} + +func (m *BACnetConstructedDataMachineRoomID) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatus.go new file mode 100644 index 00000000000..0b4760e3041 --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatus.go @@ -0,0 +1,245 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" + "io" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetLandingCallStatus is the data-structure of this message +type BACnetLandingCallStatus struct { + FloorNumber *BACnetContextTagUnsignedInteger + Command *BACnetLandingCallStatusCommand + FloorText *BACnetContextTagCharacterString +} + +// IBACnetLandingCallStatus is the corresponding interface of BACnetLandingCallStatus +type IBACnetLandingCallStatus interface { + // GetFloorNumber returns FloorNumber (property field) + GetFloorNumber() *BACnetContextTagUnsignedInteger + // GetCommand returns Command (property field) + GetCommand() *BACnetLandingCallStatusCommand + // GetFloorText returns FloorText (property field) + GetFloorText() *BACnetContextTagCharacterString + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetLandingCallStatus) GetFloorNumber() *BACnetContextTagUnsignedInteger { + return m.FloorNumber +} + +func (m *BACnetLandingCallStatus) GetCommand() *BACnetLandingCallStatusCommand { + return m.Command +} + +func (m *BACnetLandingCallStatus) GetFloorText() *BACnetContextTagCharacterString { + return m.FloorText +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetLandingCallStatus factory function for BACnetLandingCallStatus +func NewBACnetLandingCallStatus(floorNumber *BACnetContextTagUnsignedInteger, command *BACnetLandingCallStatusCommand, floorText *BACnetContextTagCharacterString) *BACnetLandingCallStatus { + return &BACnetLandingCallStatus{FloorNumber: floorNumber, Command: command, FloorText: floorText} +} + +func CastBACnetLandingCallStatus(structType interface{}) *BACnetLandingCallStatus { + if casted, ok := structType.(BACnetLandingCallStatus); ok { + return &casted + } + if casted, ok := structType.(*BACnetLandingCallStatus); ok { + return casted + } + return nil +} + +func (m *BACnetLandingCallStatus) GetTypeName() string { + return "BACnetLandingCallStatus" +} + +func (m *BACnetLandingCallStatus) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetLandingCallStatus) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(0) + + // Simple field (floorNumber) + lengthInBits += m.FloorNumber.GetLengthInBits() + + // Simple field (command) + lengthInBits += m.Command.GetLengthInBits() + + // Optional Field (floorText) + if m.FloorText != nil { + lengthInBits += (*m.FloorText).GetLengthInBits() + } + + return lengthInBits +} + +func (m *BACnetLandingCallStatus) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetLandingCallStatusParse(readBuffer utils.ReadBuffer) (*BACnetLandingCallStatus, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetLandingCallStatus"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Simple Field (floorNumber) + if pullErr := readBuffer.PullContext("floorNumber"); pullErr != nil { + return nil, pullErr + } + _floorNumber, _floorNumberErr := BACnetContextTagParse(readBuffer, uint8(uint8(0)), BACnetDataType(BACnetDataType_UNSIGNED_INTEGER)) + if _floorNumberErr != nil { + return nil, errors.Wrap(_floorNumberErr, "Error parsing 'floorNumber' field") + } + floorNumber := CastBACnetContextTagUnsignedInteger(_floorNumber) + if closeErr := readBuffer.CloseContext("floorNumber"); closeErr != nil { + return nil, closeErr + } + + // Simple Field (command) + if pullErr := readBuffer.PullContext("command"); pullErr != nil { + return nil, pullErr + } + _command, _commandErr := BACnetLandingCallStatusCommandParse(readBuffer) + if _commandErr != nil { + return nil, errors.Wrap(_commandErr, "Error parsing 'command' field") + } + command := CastBACnetLandingCallStatusCommand(_command) + if closeErr := readBuffer.CloseContext("command"); closeErr != nil { + return nil, closeErr + } + + // Optional Field (floorText) (Can be skipped, if a given expression evaluates to false) + var floorText *BACnetContextTagCharacterString = nil + { + currentPos = positionAware.GetPos() + if pullErr := readBuffer.PullContext("floorText"); pullErr != nil { + return nil, pullErr + } + _val, _err := BACnetContextTagParse(readBuffer, uint8(3), BACnetDataType_CHARACTER_STRING) + switch { + case errors.Is(_err, utils.ParseAssertError{}) || errors.Is(_err, io.EOF): + readBuffer.Reset(currentPos) + case _err != nil: + return nil, errors.Wrap(_err, "Error parsing 'floorText' field") + default: + floorText = CastBACnetContextTagCharacterString(_val) + if closeErr := readBuffer.CloseContext("floorText"); closeErr != nil { + return nil, closeErr + } + } + } + + if closeErr := readBuffer.CloseContext("BACnetLandingCallStatus"); closeErr != nil { + return nil, closeErr + } + + // Create the instance + return NewBACnetLandingCallStatus(floorNumber, command, floorText), nil +} + +func (m *BACnetLandingCallStatus) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + if pushErr := writeBuffer.PushContext("BACnetLandingCallStatus"); pushErr != nil { + return pushErr + } + + // Simple Field (floorNumber) + if pushErr := writeBuffer.PushContext("floorNumber"); pushErr != nil { + return pushErr + } + _floorNumberErr := m.FloorNumber.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("floorNumber"); popErr != nil { + return popErr + } + if _floorNumberErr != nil { + return errors.Wrap(_floorNumberErr, "Error serializing 'floorNumber' field") + } + + // Simple Field (command) + if pushErr := writeBuffer.PushContext("command"); pushErr != nil { + return pushErr + } + _commandErr := m.Command.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("command"); popErr != nil { + return popErr + } + if _commandErr != nil { + return errors.Wrap(_commandErr, "Error serializing 'command' field") + } + + // Optional Field (floorText) (Can be skipped, if the value is null) + var floorText *BACnetContextTagCharacterString = nil + if m.FloorText != nil { + if pushErr := writeBuffer.PushContext("floorText"); pushErr != nil { + return pushErr + } + floorText = m.FloorText + _floorTextErr := floorText.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("floorText"); popErr != nil { + return popErr + } + if _floorTextErr != nil { + return errors.Wrap(_floorTextErr, "Error serializing 'floorText' field") + } + } + + if popErr := writeBuffer.PopContext("BACnetLandingCallStatus"); popErr != nil { + return popErr + } + return nil +} + +func (m *BACnetLandingCallStatus) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommand.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommand.go new file mode 100644 index 00000000000..a730fa13bf8 --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommand.go @@ -0,0 +1,218 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetLandingCallStatusCommand is the data-structure of this message +type BACnetLandingCallStatusCommand struct { + PeekedTagHeader *BACnetTagHeader + Child IBACnetLandingCallStatusCommandChild +} + +// IBACnetLandingCallStatusCommand is the corresponding interface of BACnetLandingCallStatusCommand +type IBACnetLandingCallStatusCommand interface { + // GetPeekedTagHeader returns PeekedTagHeader (property field) + GetPeekedTagHeader() *BACnetTagHeader + // GetPeekedTagNumber returns PeekedTagNumber (virtual field) + GetPeekedTagNumber() uint8 + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +type IBACnetLandingCallStatusCommandParent interface { + SerializeParent(writeBuffer utils.WriteBuffer, child IBACnetLandingCallStatusCommand, serializeChildFunction func() error) error + GetTypeName() string +} + +type IBACnetLandingCallStatusCommandChild interface { + Serialize(writeBuffer utils.WriteBuffer) error + InitializeParent(parent *BACnetLandingCallStatusCommand, peekedTagHeader *BACnetTagHeader) + GetParent() *BACnetLandingCallStatusCommand + + GetTypeName() string + IBACnetLandingCallStatusCommand +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetLandingCallStatusCommand) GetPeekedTagHeader() *BACnetTagHeader { + return m.PeekedTagHeader +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for virtual fields. +/////////////////////// + +func (m *BACnetLandingCallStatusCommand) GetPeekedTagNumber() uint8 { + return uint8(m.GetPeekedTagHeader().GetActualTagNumber()) +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetLandingCallStatusCommand factory function for BACnetLandingCallStatusCommand +func NewBACnetLandingCallStatusCommand(peekedTagHeader *BACnetTagHeader) *BACnetLandingCallStatusCommand { + return &BACnetLandingCallStatusCommand{PeekedTagHeader: peekedTagHeader} +} + +func CastBACnetLandingCallStatusCommand(structType interface{}) *BACnetLandingCallStatusCommand { + if casted, ok := structType.(BACnetLandingCallStatusCommand); ok { + return &casted + } + if casted, ok := structType.(*BACnetLandingCallStatusCommand); ok { + return casted + } + if casted, ok := structType.(IBACnetLandingCallStatusCommandChild); ok { + return casted.GetParent() + } + return nil +} + +func (m *BACnetLandingCallStatusCommand) GetTypeName() string { + return "BACnetLandingCallStatusCommand" +} + +func (m *BACnetLandingCallStatusCommand) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetLandingCallStatusCommand) GetLengthInBitsConditional(lastItem bool) uint16 { + return m.Child.GetLengthInBits() +} + +func (m *BACnetLandingCallStatusCommand) GetParentLengthInBits() uint16 { + lengthInBits := uint16(0) + + // A virtual field doesn't have any in- or output. + + return lengthInBits +} + +func (m *BACnetLandingCallStatusCommand) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetLandingCallStatusCommandParse(readBuffer utils.ReadBuffer) (*BACnetLandingCallStatusCommand, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetLandingCallStatusCommand"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Peek Field (peekedTagHeader) + currentPos = positionAware.GetPos() + if pullErr := readBuffer.PullContext("peekedTagHeader"); pullErr != nil { + return nil, pullErr + } + peekedTagHeader, _ := BACnetTagHeaderParse(readBuffer) + readBuffer.Reset(currentPos) + + // Virtual field + _peekedTagNumber := peekedTagHeader.GetActualTagNumber() + peekedTagNumber := uint8(_peekedTagNumber) + _ = peekedTagNumber + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + type BACnetLandingCallStatusCommandChild interface { + InitializeParent(*BACnetLandingCallStatusCommand, *BACnetTagHeader) + GetParent() *BACnetLandingCallStatusCommand + } + var _child BACnetLandingCallStatusCommandChild + var typeSwitchError error + switch { + case peekedTagNumber == uint8(1): // BACnetLandingCallStatusCommandDirection + _child, typeSwitchError = BACnetLandingCallStatusCommandDirectionParse(readBuffer) + case peekedTagNumber == uint8(2): // BACnetLandingCallStatusCommandDestination + _child, typeSwitchError = BACnetLandingCallStatusCommandDestinationParse(readBuffer) + default: + // TODO: return actual type + typeSwitchError = errors.New("Unmapped type") + } + if typeSwitchError != nil { + return nil, errors.Wrap(typeSwitchError, "Error parsing sub-type for type-switch.") + } + + if closeErr := readBuffer.CloseContext("BACnetLandingCallStatusCommand"); closeErr != nil { + return nil, closeErr + } + + // Finish initializing + _child.InitializeParent(_child.GetParent(), peekedTagHeader) + return _child.GetParent(), nil +} + +func (m *BACnetLandingCallStatusCommand) Serialize(writeBuffer utils.WriteBuffer) error { + return m.Child.Serialize(writeBuffer) +} + +func (m *BACnetLandingCallStatusCommand) SerializeParent(writeBuffer utils.WriteBuffer, child IBACnetLandingCallStatusCommand, serializeChildFunction func() error) error { + positionAware := writeBuffer + _ = positionAware + if pushErr := writeBuffer.PushContext("BACnetLandingCallStatusCommand"); pushErr != nil { + return pushErr + } + // Virtual field + if _peekedTagNumberErr := writeBuffer.WriteVirtual("peekedTagNumber", m.GetPeekedTagNumber()); _peekedTagNumberErr != nil { + return errors.Wrap(_peekedTagNumberErr, "Error serializing 'peekedTagNumber' field") + } + + // Switch field (Depending on the discriminator values, passes the serialization to a sub-type) + if _typeSwitchErr := serializeChildFunction(); _typeSwitchErr != nil { + return errors.Wrap(_typeSwitchErr, "Error serializing sub-type field") + } + + if popErr := writeBuffer.PopContext("BACnetLandingCallStatusCommand"); popErr != nil { + return popErr + } + return nil +} + +func (m *BACnetLandingCallStatusCommand) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommandDestination.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommandDestination.go new file mode 100644 index 00000000000..98aa584a332 --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommandDestination.go @@ -0,0 +1,199 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetLandingCallStatusCommandDestination is the data-structure of this message +type BACnetLandingCallStatusCommandDestination struct { + *BACnetLandingCallStatusCommand + Destination *BACnetContextTagUnsignedInteger +} + +// IBACnetLandingCallStatusCommandDestination is the corresponding interface of BACnetLandingCallStatusCommandDestination +type IBACnetLandingCallStatusCommandDestination interface { + IBACnetLandingCallStatusCommand + // GetDestination returns Destination (property field) + GetDestination() *BACnetContextTagUnsignedInteger + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for discriminator values. +/////////////////////// + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +func (m *BACnetLandingCallStatusCommandDestination) InitializeParent(parent *BACnetLandingCallStatusCommand, peekedTagHeader *BACnetTagHeader) { + m.BACnetLandingCallStatusCommand.PeekedTagHeader = peekedTagHeader +} + +func (m *BACnetLandingCallStatusCommandDestination) GetParent() *BACnetLandingCallStatusCommand { + return m.BACnetLandingCallStatusCommand +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetLandingCallStatusCommandDestination) GetDestination() *BACnetContextTagUnsignedInteger { + return m.Destination +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetLandingCallStatusCommandDestination factory function for BACnetLandingCallStatusCommandDestination +func NewBACnetLandingCallStatusCommandDestination(destination *BACnetContextTagUnsignedInteger, peekedTagHeader *BACnetTagHeader) *BACnetLandingCallStatusCommandDestination { + _result := &BACnetLandingCallStatusCommandDestination{ + Destination: destination, + BACnetLandingCallStatusCommand: NewBACnetLandingCallStatusCommand(peekedTagHeader), + } + _result.Child = _result + return _result +} + +func CastBACnetLandingCallStatusCommandDestination(structType interface{}) *BACnetLandingCallStatusCommandDestination { + if casted, ok := structType.(BACnetLandingCallStatusCommandDestination); ok { + return &casted + } + if casted, ok := structType.(*BACnetLandingCallStatusCommandDestination); ok { + return casted + } + if casted, ok := structType.(BACnetLandingCallStatusCommand); ok { + return CastBACnetLandingCallStatusCommandDestination(casted.Child) + } + if casted, ok := structType.(*BACnetLandingCallStatusCommand); ok { + return CastBACnetLandingCallStatusCommandDestination(casted.Child) + } + return nil +} + +func (m *BACnetLandingCallStatusCommandDestination) GetTypeName() string { + return "BACnetLandingCallStatusCommandDestination" +} + +func (m *BACnetLandingCallStatusCommandDestination) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetLandingCallStatusCommandDestination) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(m.GetParentLengthInBits()) + + // Simple field (destination) + lengthInBits += m.Destination.GetLengthInBits() + + return lengthInBits +} + +func (m *BACnetLandingCallStatusCommandDestination) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetLandingCallStatusCommandDestinationParse(readBuffer utils.ReadBuffer) (*BACnetLandingCallStatusCommandDestination, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetLandingCallStatusCommandDestination"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Simple Field (destination) + if pullErr := readBuffer.PullContext("destination"); pullErr != nil { + return nil, pullErr + } + _destination, _destinationErr := BACnetContextTagParse(readBuffer, uint8(uint8(2)), BACnetDataType(BACnetDataType_UNSIGNED_INTEGER)) + if _destinationErr != nil { + return nil, errors.Wrap(_destinationErr, "Error parsing 'destination' field") + } + destination := CastBACnetContextTagUnsignedInteger(_destination) + if closeErr := readBuffer.CloseContext("destination"); closeErr != nil { + return nil, closeErr + } + + if closeErr := readBuffer.CloseContext("BACnetLandingCallStatusCommandDestination"); closeErr != nil { + return nil, closeErr + } + + // Create a partially initialized instance + _child := &BACnetLandingCallStatusCommandDestination{ + Destination: CastBACnetContextTagUnsignedInteger(destination), + BACnetLandingCallStatusCommand: &BACnetLandingCallStatusCommand{}, + } + _child.BACnetLandingCallStatusCommand.Child = _child + return _child, nil +} + +func (m *BACnetLandingCallStatusCommandDestination) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + ser := func() error { + if pushErr := writeBuffer.PushContext("BACnetLandingCallStatusCommandDestination"); pushErr != nil { + return pushErr + } + + // Simple Field (destination) + if pushErr := writeBuffer.PushContext("destination"); pushErr != nil { + return pushErr + } + _destinationErr := m.Destination.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("destination"); popErr != nil { + return popErr + } + if _destinationErr != nil { + return errors.Wrap(_destinationErr, "Error serializing 'destination' field") + } + + if popErr := writeBuffer.PopContext("BACnetLandingCallStatusCommandDestination"); popErr != nil { + return popErr + } + return nil + } + return m.SerializeParent(writeBuffer, m, ser) +} + +func (m *BACnetLandingCallStatusCommandDestination) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommandDirection.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommandDirection.go new file mode 100644 index 00000000000..194ca920ab4 --- /dev/null +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLandingCallStatusCommandDirection.go @@ -0,0 +1,199 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package model + +import ( + "github.com/apache/plc4x/plc4go/internal/spi/utils" + "github.com/pkg/errors" +) + +// Code generated by code-generation. DO NOT EDIT. + +// BACnetLandingCallStatusCommandDirection is the data-structure of this message +type BACnetLandingCallStatusCommandDirection struct { + *BACnetLandingCallStatusCommand + Direction *BACnetLiftCarDirectionTagged +} + +// IBACnetLandingCallStatusCommandDirection is the corresponding interface of BACnetLandingCallStatusCommandDirection +type IBACnetLandingCallStatusCommandDirection interface { + IBACnetLandingCallStatusCommand + // GetDirection returns Direction (property field) + GetDirection() *BACnetLiftCarDirectionTagged + // GetLengthInBytes returns the length in bytes + GetLengthInBytes() uint16 + // GetLengthInBits returns the length in bits + GetLengthInBits() uint16 + // Serialize serializes this type + Serialize(writeBuffer utils.WriteBuffer) error +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for discriminator values. +/////////////////////// + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +func (m *BACnetLandingCallStatusCommandDirection) InitializeParent(parent *BACnetLandingCallStatusCommand, peekedTagHeader *BACnetTagHeader) { + m.BACnetLandingCallStatusCommand.PeekedTagHeader = peekedTagHeader +} + +func (m *BACnetLandingCallStatusCommandDirection) GetParent() *BACnetLandingCallStatusCommand { + return m.BACnetLandingCallStatusCommand +} + +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////// Accessors for property fields. +/////////////////////// + +func (m *BACnetLandingCallStatusCommandDirection) GetDirection() *BACnetLiftCarDirectionTagged { + return m.Direction +} + +/////////////////////// +/////////////////////// +/////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// + +// NewBACnetLandingCallStatusCommandDirection factory function for BACnetLandingCallStatusCommandDirection +func NewBACnetLandingCallStatusCommandDirection(direction *BACnetLiftCarDirectionTagged, peekedTagHeader *BACnetTagHeader) *BACnetLandingCallStatusCommandDirection { + _result := &BACnetLandingCallStatusCommandDirection{ + Direction: direction, + BACnetLandingCallStatusCommand: NewBACnetLandingCallStatusCommand(peekedTagHeader), + } + _result.Child = _result + return _result +} + +func CastBACnetLandingCallStatusCommandDirection(structType interface{}) *BACnetLandingCallStatusCommandDirection { + if casted, ok := structType.(BACnetLandingCallStatusCommandDirection); ok { + return &casted + } + if casted, ok := structType.(*BACnetLandingCallStatusCommandDirection); ok { + return casted + } + if casted, ok := structType.(BACnetLandingCallStatusCommand); ok { + return CastBACnetLandingCallStatusCommandDirection(casted.Child) + } + if casted, ok := structType.(*BACnetLandingCallStatusCommand); ok { + return CastBACnetLandingCallStatusCommandDirection(casted.Child) + } + return nil +} + +func (m *BACnetLandingCallStatusCommandDirection) GetTypeName() string { + return "BACnetLandingCallStatusCommandDirection" +} + +func (m *BACnetLandingCallStatusCommandDirection) GetLengthInBits() uint16 { + return m.GetLengthInBitsConditional(false) +} + +func (m *BACnetLandingCallStatusCommandDirection) GetLengthInBitsConditional(lastItem bool) uint16 { + lengthInBits := uint16(m.GetParentLengthInBits()) + + // Simple field (direction) + lengthInBits += m.Direction.GetLengthInBits() + + return lengthInBits +} + +func (m *BACnetLandingCallStatusCommandDirection) GetLengthInBytes() uint16 { + return m.GetLengthInBits() / 8 +} + +func BACnetLandingCallStatusCommandDirectionParse(readBuffer utils.ReadBuffer) (*BACnetLandingCallStatusCommandDirection, error) { + positionAware := readBuffer + _ = positionAware + if pullErr := readBuffer.PullContext("BACnetLandingCallStatusCommandDirection"); pullErr != nil { + return nil, pullErr + } + currentPos := positionAware.GetPos() + _ = currentPos + + // Simple Field (direction) + if pullErr := readBuffer.PullContext("direction"); pullErr != nil { + return nil, pullErr + } + _direction, _directionErr := BACnetLiftCarDirectionTaggedParse(readBuffer, uint8(uint8(1)), TagClass(TagClass_CONTEXT_SPECIFIC_TAGS)) + if _directionErr != nil { + return nil, errors.Wrap(_directionErr, "Error parsing 'direction' field") + } + direction := CastBACnetLiftCarDirectionTagged(_direction) + if closeErr := readBuffer.CloseContext("direction"); closeErr != nil { + return nil, closeErr + } + + if closeErr := readBuffer.CloseContext("BACnetLandingCallStatusCommandDirection"); closeErr != nil { + return nil, closeErr + } + + // Create a partially initialized instance + _child := &BACnetLandingCallStatusCommandDirection{ + Direction: CastBACnetLiftCarDirectionTagged(direction), + BACnetLandingCallStatusCommand: &BACnetLandingCallStatusCommand{}, + } + _child.BACnetLandingCallStatusCommand.Child = _child + return _child, nil +} + +func (m *BACnetLandingCallStatusCommandDirection) Serialize(writeBuffer utils.WriteBuffer) error { + positionAware := writeBuffer + _ = positionAware + ser := func() error { + if pushErr := writeBuffer.PushContext("BACnetLandingCallStatusCommandDirection"); pushErr != nil { + return pushErr + } + + // Simple Field (direction) + if pushErr := writeBuffer.PushContext("direction"); pushErr != nil { + return pushErr + } + _directionErr := m.Direction.Serialize(writeBuffer) + if popErr := writeBuffer.PopContext("direction"); popErr != nil { + return popErr + } + if _directionErr != nil { + return errors.Wrap(_directionErr, "Error serializing 'direction' field") + } + + if popErr := writeBuffer.PopContext("BACnetLandingCallStatusCommandDirection"); popErr != nil { + return popErr + } + return nil + } + return m.SerializeParent(writeBuffer, m, ser) +} + +func (m *BACnetLandingCallStatusCommandDirection) String() string { + if m == nil { + return "" + } + buffer := utils.NewBoxedWriteBufferWithOptions(true, true) + if err := m.Serialize(buffer); err != nil { + return err.Error() + } + return buffer.GetBox().String() +} diff --git a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec index cb83e8fe682..cc38843b123 100644 --- a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec +++ b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec @@ -2998,7 +2998,9 @@ 'STATIC_CALL("isBACnetConstructedDataClosingTag", readBuffer, false, tagNumber)' ] ] //[*, 'GROUP_MEMBERS' BACnetConstructedDataGroupMembers [validation '1 == 2' "TODO: implement me GROUP_MEMBERS BACnetConstructedDataGroupMembers"]] - //[*, 'GROUP_MODE' BACnetConstructedDataGroupMode [validation '1 == 2' "TODO: implement me GROUP_MODE BACnetConstructedDataGroupMode"]] + [*, 'GROUP_MODE' BACnetConstructedDataGroupMode + [simple BACnetLiftGroupModeTagged('0', 'TagClass.APPLICATION_TAGS') groupMode ] + ] ['ACCUMULATOR', 'HIGH_LIMIT' BACnetConstructedDataAccumulatorHighLimit [simple BACnetApplicationTagUnsignedInteger highLimit ] ] @@ -3102,8 +3104,15 @@ 'STATIC_CALL("isBACnetConstructedDataClosingTag", readBuffer, false, tagNumber)' ] [validation 'COUNT(keySets) == 2' "keySets should have exactly 2 values" ] ] - //[*, 'LANDING_CALL_CONTROL' BACnetConstructedDataLandingCallControl [validation '1 == 2' "TODO: implement me LANDING_CALL_CONTROL BACnetConstructedDataLandingCallControl"]] - //[*, 'LANDING_CALLS' BACnetConstructedDataLandingCalls [validation '1 == 2' "TODO: implement me LANDING_CALLS BACnetConstructedDataLandingCalls"]] + [*, 'LANDING_CALL_CONTROL' BACnetConstructedDataLandingCallControl + [simple BACnetLandingCallStatus landingCallControl ] + ] + [*, 'LANDING_CALLS' BACnetConstructedDataLandingCalls + [array BACnetLandingCallStatus + landingCallStatus + terminated + 'STATIC_CALL("isBACnetConstructedDataClosingTag", readBuffer, false, tagNumber)' ] + ] [*, 'LANDING_DOOR_STATUS' BACnetConstructedDataLandingDoorStatus [array BACnetLandingDoorStatus landingDoorStatus @@ -3208,7 +3217,9 @@ [*, 'MAC_ADDRESS' BACnetConstructedDataMACAddress [simple BACnetApplicationTagOctetString macAddress ] ] - //[*, 'MACHINE_ROOM_ID' BACnetConstructedDataMachineRoomId [validation '1 == 2' "TODO: implement me MACHINE_ROOM_ID BACnetConstructedDataMachineRoomId"]] + [*, 'MACHINE_ROOM_ID' BACnetConstructedDataMachineRoomID + [simple BACnetApplicationTagObjectIdentifier machineRoomId ] + ] //[*, 'MAINTENANCE_REQUIRED' BACnetConstructedDataMaintenanceRequired [validation '1 == 2' "TODO: implement me MAINTENANCE_REQUIRED BACnetConstructedDataMaintenanceRequired"]] [*, 'MAKING_CAR_CALL' BACnetConstructedDataMakingCarCall [array BACnetApplicationTagUnsignedInteger @@ -5047,3 +5058,28 @@ [simple BACnetClosingTag('tagNumber') closingTag ] ] + +[type BACnetLandingCallStatus + [simple BACnetContextTagUnsignedInteger('0', 'BACnetDataType.UNSIGNED_INTEGER') + floorNumber ] + [simple BACnetLandingCallStatusCommand + command ] + [optional BACnetContextTagCharacterString('3', 'BACnetDataType.CHARACTER_STRING') + floorText ] +] + +[type BACnetLandingCallStatusCommand + [peek BACnetTagHeader + peekedTagHeader ] + [virtual uint 8 peekedTagNumber 'peekedTagHeader.actualTagNumber' ] + [typeSwitch peekedTagNumber + ['1' BACnetLandingCallStatusCommandDirection + [simple BACnetLiftCarDirectionTagged('1', 'TagClass.CONTEXT_SPECIFIC_TAGS') + direction ] + ] + ['2' BACnetLandingCallStatusCommandDestination + [simple BACnetContextTagUnsignedInteger('2', 'BACnetDataType.UNSIGNED_INTEGER') + destination ] + ] + ] +]