You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/07/19 13:29:15 UTC
[plc4x] 01/03: feat(cbus): implemented telephony application
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 9edc9266343bb531270ede7dd33390cca70f2902
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Jul 19 13:25:16 2022 +0200
feat(cbus): implemented telephony application
---
plc4go/protocols/cbus/readwrite/ParserHelper.go | 2 +
plc4go/protocols/cbus/readwrite/XmlParserHelper.go | 2 +
.../cbus/readwrite/model/DialInFailureReason.go | 121 ++++
.../cbus/readwrite/model/DialOutFailureReason.go | 161 +++++
.../cbus/readwrite/model/LineOffHookReason.go | 177 ++++++
.../protocols/cbus/readwrite/model/StaticHelper.go | 10 +
.../cbus/readwrite/model/TelephonyCommandType.go | 121 ++++
.../model/TelephonyCommandTypeContainer.go | 678 +++++++++++++++++++++
.../cbus/readwrite/model/TelephonyData.go | 291 +++++++++
.../readwrite/model/TelephonyDataClearDiversion.go | 155 +++++
.../readwrite/model/TelephonyDataDialOutFailure.go | 202 ++++++
.../cbus/readwrite/model/TelephonyDataDivert.go | 191 ++++++
.../TelephonyDataInternetConnectionRequestMade.go | 155 +++++
.../model/TelephonyDataIsolateSecondaryOutlet.go | 234 +++++++
.../readwrite/model/TelephonyDataLineOffHook.go | 228 +++++++
.../readwrite/model/TelephonyDataLineOnHook.go | 155 +++++
.../model/TelephonyDataRecallLastNumber.go | 260 ++++++++
.../model/TelephonyDataRecallLastNumberRequest.go | 234 +++++++
.../model/TelephonyDataRejectIncomingCall.go | 155 +++++
.../cbus/readwrite/model/TelephonyDataRinging.go | 217 +++++++
.../src/main/resources/protocols/cbus/c-bus.mspec | 117 +++-
21 files changed, 3865 insertions(+), 1 deletion(-)
diff --git a/plc4go/protocols/cbus/readwrite/ParserHelper.go b/plc4go/protocols/cbus/readwrite/ParserHelper.go
index d4a8e897f..1d4a80267 100644
--- a/plc4go/protocols/cbus/readwrite/ParserHelper.go
+++ b/plc4go/protocols/cbus/readwrite/ParserHelper.go
@@ -90,6 +90,8 @@ func (m CbusParserHelper) Parse(typeName string, arguments []string, io utils.Re
}
var requestContext model.RequestContext
return model.ReplyParse(io, cBusOptions, replyLength, requestContext)
+ case "TelephonyData":
+ return model.TelephonyDataParse(io)
case "InterfaceOptions1PowerUpSettings":
return model.InterfaceOptions1PowerUpSettingsParse(io)
case "MonitoredSAL":
diff --git a/plc4go/protocols/cbus/readwrite/XmlParserHelper.go b/plc4go/protocols/cbus/readwrite/XmlParserHelper.go
index f988ee002..33a8ef961 100644
--- a/plc4go/protocols/cbus/readwrite/XmlParserHelper.go
+++ b/plc4go/protocols/cbus/readwrite/XmlParserHelper.go
@@ -106,6 +106,8 @@ func (m CbusXmlParserHelper) Parse(typeName string, xmlString string, parserArgu
// TODO: find a way to parse the sub types
var requestContext model.RequestContext
return model.ReplyParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)), cBusOptions, replyLength, requestContext)
+ case "TelephonyData":
+ return model.TelephonyDataParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
case "InterfaceOptions1PowerUpSettings":
return model.InterfaceOptions1PowerUpSettingsParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
case "MonitoredSAL":
diff --git a/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go b/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go
new file mode 100644
index 000000000..966e9bd27
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go
@@ -0,0 +1,121 @@
+/*
+ * 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
+ *
+ * https://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"
+ "github.com/rs/zerolog/log"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// DialInFailureReason is an enum
+type DialInFailureReason uint8
+
+type IDialInFailureReason interface {
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+const (
+ DialInFailureReason_PHONE_STOPPED_RINGING DialInFailureReason = 0x01
+)
+
+var DialInFailureReasonValues []DialInFailureReason
+
+func init() {
+ _ = errors.New
+ DialInFailureReasonValues = []DialInFailureReason{
+ DialInFailureReason_PHONE_STOPPED_RINGING,
+ }
+}
+
+func DialInFailureReasonByValue(value uint8) (enum DialInFailureReason, ok bool) {
+ switch value {
+ case 0x01:
+ return DialInFailureReason_PHONE_STOPPED_RINGING, true
+ }
+ return 0, false
+}
+
+func DialInFailureReasonByName(value string) (enum DialInFailureReason, ok bool) {
+ switch value {
+ case "PHONE_STOPPED_RINGING":
+ return DialInFailureReason_PHONE_STOPPED_RINGING, true
+ }
+ return 0, false
+}
+
+func DialInFailureReasonKnows(value uint8) bool {
+ for _, typeValue := range DialInFailureReasonValues {
+ if uint8(typeValue) == value {
+ return true
+ }
+ }
+ return false
+}
+
+func CastDialInFailureReason(structType interface{}) DialInFailureReason {
+ castFunc := func(typ interface{}) DialInFailureReason {
+ if sDialInFailureReason, ok := typ.(DialInFailureReason); ok {
+ return sDialInFailureReason
+ }
+ return 0
+ }
+ return castFunc(structType)
+}
+
+func (m DialInFailureReason) GetLengthInBits() uint16 {
+ return 8
+}
+
+func (m DialInFailureReason) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func DialInFailureReasonParse(readBuffer utils.ReadBuffer) (DialInFailureReason, error) {
+ val, err := readBuffer.ReadUint8("DialInFailureReason", 8)
+ if err != nil {
+ return 0, errors.Wrap(err, "error reading DialInFailureReason")
+ }
+ if enum, ok := DialInFailureReasonByValue(val); !ok {
+ log.Debug().Msgf("no value %x found for RequestType", val)
+ return DialInFailureReason(val), nil
+ } else {
+ return enum, nil
+ }
+}
+
+func (e DialInFailureReason) Serialize(writeBuffer utils.WriteBuffer) error {
+ return writeBuffer.WriteUint8("DialInFailureReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
+}
+
+// PLC4XEnumName returns the name that is used in code to identify this enum
+func (e DialInFailureReason) PLC4XEnumName() string {
+ switch e {
+ case DialInFailureReason_PHONE_STOPPED_RINGING:
+ return "PHONE_STOPPED_RINGING"
+ }
+ return ""
+}
+
+func (e DialInFailureReason) String() string {
+ return e.PLC4XEnumName()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go b/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go
new file mode 100644
index 000000000..e3a8cf771
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go
@@ -0,0 +1,161 @@
+/*
+ * 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
+ *
+ * https://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"
+ "github.com/rs/zerolog/log"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// DialOutFailureReason is an enum
+type DialOutFailureReason uint8
+
+type IDialOutFailureReason interface {
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+const (
+ DialOutFailureReason_NO_DIAL_TONE DialOutFailureReason = 0x01
+ DialOutFailureReason_NO_ANSWER DialOutFailureReason = 0x02
+ DialOutFailureReason_NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS DialOutFailureReason = 0x03
+ DialOutFailureReason_NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST DialOutFailureReason = 0x04
+ DialOutFailureReason_NUMBER_WAS_BUSY DialOutFailureReason = 0x05
+ DialOutFailureReason_INTERNAL_FAILURE DialOutFailureReason = 0x06
+)
+
+var DialOutFailureReasonValues []DialOutFailureReason
+
+func init() {
+ _ = errors.New
+ DialOutFailureReasonValues = []DialOutFailureReason{
+ DialOutFailureReason_NO_DIAL_TONE,
+ DialOutFailureReason_NO_ANSWER,
+ DialOutFailureReason_NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS,
+ DialOutFailureReason_NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST,
+ DialOutFailureReason_NUMBER_WAS_BUSY,
+ DialOutFailureReason_INTERNAL_FAILURE,
+ }
+}
+
+func DialOutFailureReasonByValue(value uint8) (enum DialOutFailureReason, ok bool) {
+ switch value {
+ case 0x01:
+ return DialOutFailureReason_NO_DIAL_TONE, true
+ case 0x02:
+ return DialOutFailureReason_NO_ANSWER, true
+ case 0x03:
+ return DialOutFailureReason_NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS, true
+ case 0x04:
+ return DialOutFailureReason_NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST, true
+ case 0x05:
+ return DialOutFailureReason_NUMBER_WAS_BUSY, true
+ case 0x06:
+ return DialOutFailureReason_INTERNAL_FAILURE, true
+ }
+ return 0, false
+}
+
+func DialOutFailureReasonByName(value string) (enum DialOutFailureReason, ok bool) {
+ switch value {
+ case "NO_DIAL_TONE":
+ return DialOutFailureReason_NO_DIAL_TONE, true
+ case "NO_ANSWER":
+ return DialOutFailureReason_NO_ANSWER, true
+ case "NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS":
+ return DialOutFailureReason_NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS, true
+ case "NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST":
+ return DialOutFailureReason_NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST, true
+ case "NUMBER_WAS_BUSY":
+ return DialOutFailureReason_NUMBER_WAS_BUSY, true
+ case "INTERNAL_FAILURE":
+ return DialOutFailureReason_INTERNAL_FAILURE, true
+ }
+ return 0, false
+}
+
+func DialOutFailureReasonKnows(value uint8) bool {
+ for _, typeValue := range DialOutFailureReasonValues {
+ if uint8(typeValue) == value {
+ return true
+ }
+ }
+ return false
+}
+
+func CastDialOutFailureReason(structType interface{}) DialOutFailureReason {
+ castFunc := func(typ interface{}) DialOutFailureReason {
+ if sDialOutFailureReason, ok := typ.(DialOutFailureReason); ok {
+ return sDialOutFailureReason
+ }
+ return 0
+ }
+ return castFunc(structType)
+}
+
+func (m DialOutFailureReason) GetLengthInBits() uint16 {
+ return 8
+}
+
+func (m DialOutFailureReason) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func DialOutFailureReasonParse(readBuffer utils.ReadBuffer) (DialOutFailureReason, error) {
+ val, err := readBuffer.ReadUint8("DialOutFailureReason", 8)
+ if err != nil {
+ return 0, errors.Wrap(err, "error reading DialOutFailureReason")
+ }
+ if enum, ok := DialOutFailureReasonByValue(val); !ok {
+ log.Debug().Msgf("no value %x found for RequestType", val)
+ return DialOutFailureReason(val), nil
+ } else {
+ return enum, nil
+ }
+}
+
+func (e DialOutFailureReason) Serialize(writeBuffer utils.WriteBuffer) error {
+ return writeBuffer.WriteUint8("DialOutFailureReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
+}
+
+// PLC4XEnumName returns the name that is used in code to identify this enum
+func (e DialOutFailureReason) PLC4XEnumName() string {
+ switch e {
+ case DialOutFailureReason_NO_DIAL_TONE:
+ return "NO_DIAL_TONE"
+ case DialOutFailureReason_NO_ANSWER:
+ return "NO_ANSWER"
+ case DialOutFailureReason_NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS:
+ return "NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS"
+ case DialOutFailureReason_NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST:
+ return "NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST"
+ case DialOutFailureReason_NUMBER_WAS_BUSY:
+ return "NUMBER_WAS_BUSY"
+ case DialOutFailureReason_INTERNAL_FAILURE:
+ return "INTERNAL_FAILURE"
+ }
+ return ""
+}
+
+func (e DialOutFailureReason) String() string {
+ return e.PLC4XEnumName()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go b/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go
new file mode 100644
index 000000000..da5259102
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go
@@ -0,0 +1,177 @@
+/*
+ * 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
+ *
+ * https://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"
+ "github.com/rs/zerolog/log"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// LineOffHookReason is an enum
+type LineOffHookReason uint8
+
+type ILineOffHookReason interface {
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+const (
+ LineOffHookReason_INCOMING_VOICE_CALL LineOffHookReason = 0x01
+ LineOffHookReason_INCOMING_DATA_CALL LineOffHookReason = 0x02
+ LineOffHookReason_INCOMING_CALL LineOffHookReason = 0x03
+ LineOffHookReason_OUTGOING_VOICE_CALL LineOffHookReason = 0x10
+ LineOffHookReason_OUTGOING_DATA_CALL LineOffHookReason = 0x20
+ LineOffHookReason_OUTGOING_CALL LineOffHookReason = 0x30
+ LineOffHookReason_CBTI_IS_SETTING LineOffHookReason = 0x40
+ LineOffHookReason_CBTI_IS_CLEARING LineOffHookReason = 0x50
+)
+
+var LineOffHookReasonValues []LineOffHookReason
+
+func init() {
+ _ = errors.New
+ LineOffHookReasonValues = []LineOffHookReason{
+ LineOffHookReason_INCOMING_VOICE_CALL,
+ LineOffHookReason_INCOMING_DATA_CALL,
+ LineOffHookReason_INCOMING_CALL,
+ LineOffHookReason_OUTGOING_VOICE_CALL,
+ LineOffHookReason_OUTGOING_DATA_CALL,
+ LineOffHookReason_OUTGOING_CALL,
+ LineOffHookReason_CBTI_IS_SETTING,
+ LineOffHookReason_CBTI_IS_CLEARING,
+ }
+}
+
+func LineOffHookReasonByValue(value uint8) (enum LineOffHookReason, ok bool) {
+ switch value {
+ case 0x01:
+ return LineOffHookReason_INCOMING_VOICE_CALL, true
+ case 0x02:
+ return LineOffHookReason_INCOMING_DATA_CALL, true
+ case 0x03:
+ return LineOffHookReason_INCOMING_CALL, true
+ case 0x10:
+ return LineOffHookReason_OUTGOING_VOICE_CALL, true
+ case 0x20:
+ return LineOffHookReason_OUTGOING_DATA_CALL, true
+ case 0x30:
+ return LineOffHookReason_OUTGOING_CALL, true
+ case 0x40:
+ return LineOffHookReason_CBTI_IS_SETTING, true
+ case 0x50:
+ return LineOffHookReason_CBTI_IS_CLEARING, true
+ }
+ return 0, false
+}
+
+func LineOffHookReasonByName(value string) (enum LineOffHookReason, ok bool) {
+ switch value {
+ case "INCOMING_VOICE_CALL":
+ return LineOffHookReason_INCOMING_VOICE_CALL, true
+ case "INCOMING_DATA_CALL":
+ return LineOffHookReason_INCOMING_DATA_CALL, true
+ case "INCOMING_CALL":
+ return LineOffHookReason_INCOMING_CALL, true
+ case "OUTGOING_VOICE_CALL":
+ return LineOffHookReason_OUTGOING_VOICE_CALL, true
+ case "OUTGOING_DATA_CALL":
+ return LineOffHookReason_OUTGOING_DATA_CALL, true
+ case "OUTGOING_CALL":
+ return LineOffHookReason_OUTGOING_CALL, true
+ case "CBTI_IS_SETTING":
+ return LineOffHookReason_CBTI_IS_SETTING, true
+ case "CBTI_IS_CLEARING":
+ return LineOffHookReason_CBTI_IS_CLEARING, true
+ }
+ return 0, false
+}
+
+func LineOffHookReasonKnows(value uint8) bool {
+ for _, typeValue := range LineOffHookReasonValues {
+ if uint8(typeValue) == value {
+ return true
+ }
+ }
+ return false
+}
+
+func CastLineOffHookReason(structType interface{}) LineOffHookReason {
+ castFunc := func(typ interface{}) LineOffHookReason {
+ if sLineOffHookReason, ok := typ.(LineOffHookReason); ok {
+ return sLineOffHookReason
+ }
+ return 0
+ }
+ return castFunc(structType)
+}
+
+func (m LineOffHookReason) GetLengthInBits() uint16 {
+ return 8
+}
+
+func (m LineOffHookReason) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func LineOffHookReasonParse(readBuffer utils.ReadBuffer) (LineOffHookReason, error) {
+ val, err := readBuffer.ReadUint8("LineOffHookReason", 8)
+ if err != nil {
+ return 0, errors.Wrap(err, "error reading LineOffHookReason")
+ }
+ if enum, ok := LineOffHookReasonByValue(val); !ok {
+ log.Debug().Msgf("no value %x found for RequestType", val)
+ return LineOffHookReason(val), nil
+ } else {
+ return enum, nil
+ }
+}
+
+func (e LineOffHookReason) Serialize(writeBuffer utils.WriteBuffer) error {
+ return writeBuffer.WriteUint8("LineOffHookReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
+}
+
+// PLC4XEnumName returns the name that is used in code to identify this enum
+func (e LineOffHookReason) PLC4XEnumName() string {
+ switch e {
+ case LineOffHookReason_INCOMING_VOICE_CALL:
+ return "INCOMING_VOICE_CALL"
+ case LineOffHookReason_INCOMING_DATA_CALL:
+ return "INCOMING_DATA_CALL"
+ case LineOffHookReason_INCOMING_CALL:
+ return "INCOMING_CALL"
+ case LineOffHookReason_OUTGOING_VOICE_CALL:
+ return "OUTGOING_VOICE_CALL"
+ case LineOffHookReason_OUTGOING_DATA_CALL:
+ return "OUTGOING_DATA_CALL"
+ case LineOffHookReason_OUTGOING_CALL:
+ return "OUTGOING_CALL"
+ case LineOffHookReason_CBTI_IS_SETTING:
+ return "CBTI_IS_SETTING"
+ case LineOffHookReason_CBTI_IS_CLEARING:
+ return "CBTI_IS_CLEARING"
+ }
+ return ""
+}
+
+func (e LineOffHookReason) String() string {
+ return e.PLC4XEnumName()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/StaticHelper.go b/plc4go/protocols/cbus/readwrite/model/StaticHelper.go
index a1ada5075..203fe6ac5 100644
--- a/plc4go/protocols/cbus/readwrite/model/StaticHelper.go
+++ b/plc4go/protocols/cbus/readwrite/model/StaticHelper.go
@@ -211,3 +211,13 @@ func KnowsClockAndTimekeepingCommandTypeContainer(readBuffer utils.ReadBuffer) b
}
return ClockAndTimekeepingCommandTypeContainerKnows(readUint8)
}
+
+func KnowsTelephonyCommandTypeContainer(readBuffer utils.ReadBuffer) bool {
+ oldPos := readBuffer.GetPos()
+ defer readBuffer.Reset(oldPos)
+ readUint8, err := readBuffer.ReadUint8("", 8)
+ if err != nil {
+ return false
+ }
+ return TelephonyCommandTypeContainerKnows(readUint8)
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go
new file mode 100644
index 000000000..244030a59
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go
@@ -0,0 +1,121 @@
+/*
+ * 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
+ *
+ * https://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"
+ "github.com/rs/zerolog/log"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// TelephonyCommandType is an enum
+type TelephonyCommandType uint8
+
+type ITelephonyCommandType interface {
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+const (
+ TelephonyCommandType_EVENT TelephonyCommandType = 0x00
+)
+
+var TelephonyCommandTypeValues []TelephonyCommandType
+
+func init() {
+ _ = errors.New
+ TelephonyCommandTypeValues = []TelephonyCommandType{
+ TelephonyCommandType_EVENT,
+ }
+}
+
+func TelephonyCommandTypeByValue(value uint8) (enum TelephonyCommandType, ok bool) {
+ switch value {
+ case 0x00:
+ return TelephonyCommandType_EVENT, true
+ }
+ return 0, false
+}
+
+func TelephonyCommandTypeByName(value string) (enum TelephonyCommandType, ok bool) {
+ switch value {
+ case "EVENT":
+ return TelephonyCommandType_EVENT, true
+ }
+ return 0, false
+}
+
+func TelephonyCommandTypeKnows(value uint8) bool {
+ for _, typeValue := range TelephonyCommandTypeValues {
+ if uint8(typeValue) == value {
+ return true
+ }
+ }
+ return false
+}
+
+func CastTelephonyCommandType(structType interface{}) TelephonyCommandType {
+ castFunc := func(typ interface{}) TelephonyCommandType {
+ if sTelephonyCommandType, ok := typ.(TelephonyCommandType); ok {
+ return sTelephonyCommandType
+ }
+ return 0
+ }
+ return castFunc(structType)
+}
+
+func (m TelephonyCommandType) GetLengthInBits() uint16 {
+ return 4
+}
+
+func (m TelephonyCommandType) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyCommandTypeParse(readBuffer utils.ReadBuffer) (TelephonyCommandType, error) {
+ val, err := readBuffer.ReadUint8("TelephonyCommandType", 4)
+ if err != nil {
+ return 0, errors.Wrap(err, "error reading TelephonyCommandType")
+ }
+ if enum, ok := TelephonyCommandTypeByValue(val); !ok {
+ log.Debug().Msgf("no value %x found for RequestType", val)
+ return TelephonyCommandType(val), nil
+ } else {
+ return enum, nil
+ }
+}
+
+func (e TelephonyCommandType) Serialize(writeBuffer utils.WriteBuffer) error {
+ return writeBuffer.WriteUint8("TelephonyCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
+}
+
+// PLC4XEnumName returns the name that is used in code to identify this enum
+func (e TelephonyCommandType) PLC4XEnumName() string {
+ switch e {
+ case TelephonyCommandType_EVENT:
+ return "EVENT"
+ }
+ return ""
+}
+
+func (e TelephonyCommandType) String() string {
+ return e.PLC4XEnumName()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go
new file mode 100644
index 000000000..d162e2769
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go
@@ -0,0 +1,678 @@
+/*
+ * 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
+ *
+ * https://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"
+ "github.com/rs/zerolog/log"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// TelephonyCommandTypeContainer is an enum
+type TelephonyCommandTypeContainer uint8
+
+type ITelephonyCommandTypeContainer interface {
+ NumBytes() uint8
+ CommandType() TelephonyCommandType
+ Serialize(writeBuffer utils.WriteBuffer) error
+}
+
+const (
+ TelephonyCommandTypeContainer_TelephonyCommandLineOnHook TelephonyCommandTypeContainer = 0x09
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_0Bytes TelephonyCommandTypeContainer = 0xA0
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_1Bytes TelephonyCommandTypeContainer = 0xA1
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_2Bytes TelephonyCommandTypeContainer = 0xA2
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_3Bytes TelephonyCommandTypeContainer = 0xA3
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_4Bytes TelephonyCommandTypeContainer = 0xA4
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_5Bytes TelephonyCommandTypeContainer = 0xA5
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_6Bytes TelephonyCommandTypeContainer = 0xA6
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_7Bytes TelephonyCommandTypeContainer = 0xA7
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_8Bytes TelephonyCommandTypeContainer = 0xA8
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_9Bytes TelephonyCommandTypeContainer = 0xA9
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_10Bytes TelephonyCommandTypeContainer = 0xAA
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_11Bytes TelephonyCommandTypeContainer = 0xAB
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_12Bytes TelephonyCommandTypeContainer = 0xAC
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_13Bytes TelephonyCommandTypeContainer = 0xAD
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_14Bytes TelephonyCommandTypeContainer = 0xAE
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_15Bytes TelephonyCommandTypeContainer = 0xAF
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_16Bytes TelephonyCommandTypeContainer = 0xB0
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_17Bytes TelephonyCommandTypeContainer = 0xB1
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_18Bytes TelephonyCommandTypeContainer = 0xB2
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_19Bytes TelephonyCommandTypeContainer = 0xB3
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_20Bytes TelephonyCommandTypeContainer = 0xB4
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_21Bytes TelephonyCommandTypeContainer = 0xB5
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_22Bytes TelephonyCommandTypeContainer = 0xB6
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_23Bytes TelephonyCommandTypeContainer = 0xB7
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_24Bytes TelephonyCommandTypeContainer = 0xB8
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_25Bytes TelephonyCommandTypeContainer = 0xB9
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_26Bytes TelephonyCommandTypeContainer = 0xBA
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_27Bytes TelephonyCommandTypeContainer = 0xBB
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_28Bytes TelephonyCommandTypeContainer = 0xBC
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_29Bytes TelephonyCommandTypeContainer = 0xBD
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_30Bytes TelephonyCommandTypeContainer = 0xBE
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_31Bytes TelephonyCommandTypeContainer = 0xBF
+)
+
+var TelephonyCommandTypeContainerValues []TelephonyCommandTypeContainer
+
+func init() {
+ _ = errors.New
+ TelephonyCommandTypeContainerValues = []TelephonyCommandTypeContainer{
+ TelephonyCommandTypeContainer_TelephonyCommandLineOnHook,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_0Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_1Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_2Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_3Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_4Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_5Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_6Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_7Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_8Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_9Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_10Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_11Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_12Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_13Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_14Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_15Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_16Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_17Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_18Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_19Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_20Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_21Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_22Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_23Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_24Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_25Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_26Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_27Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_28Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_29Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_30Bytes,
+ TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_31Bytes,
+ }
+}
+
+func (e TelephonyCommandTypeContainer) NumBytes() uint8 {
+ switch e {
+ case 0x09:
+ { /* '0x09' */
+ return 1
+ }
+ case 0xA0:
+ { /* '0xA0' */
+ return 0
+ }
+ case 0xA1:
+ { /* '0xA1' */
+ return 1
+ }
+ case 0xA2:
+ { /* '0xA2' */
+ return 2
+ }
+ case 0xA3:
+ { /* '0xA3' */
+ return 3
+ }
+ case 0xA4:
+ { /* '0xA4' */
+ return 4
+ }
+ case 0xA5:
+ { /* '0xA5' */
+ return 5
+ }
+ case 0xA6:
+ { /* '0xA6' */
+ return 6
+ }
+ case 0xA7:
+ { /* '0xA7' */
+ return 7
+ }
+ case 0xA8:
+ { /* '0xA8' */
+ return 8
+ }
+ case 0xA9:
+ { /* '0xA9' */
+ return 9
+ }
+ case 0xAA:
+ { /* '0xAA' */
+ return 10
+ }
+ case 0xAB:
+ { /* '0xAB' */
+ return 11
+ }
+ case 0xAC:
+ { /* '0xAC' */
+ return 12
+ }
+ case 0xAD:
+ { /* '0xAD' */
+ return 13
+ }
+ case 0xAE:
+ { /* '0xAE' */
+ return 14
+ }
+ case 0xAF:
+ { /* '0xAF' */
+ return 15
+ }
+ case 0xB0:
+ { /* '0xB0' */
+ return 16
+ }
+ case 0xB1:
+ { /* '0xB1' */
+ return 17
+ }
+ case 0xB2:
+ { /* '0xB2' */
+ return 18
+ }
+ case 0xB3:
+ { /* '0xB3' */
+ return 19
+ }
+ case 0xB4:
+ { /* '0xB4' */
+ return 20
+ }
+ case 0xB5:
+ { /* '0xB5' */
+ return 21
+ }
+ case 0xB6:
+ { /* '0xB6' */
+ return 22
+ }
+ case 0xB7:
+ { /* '0xB7' */
+ return 23
+ }
+ case 0xB8:
+ { /* '0xB8' */
+ return 24
+ }
+ case 0xB9:
+ { /* '0xB9' */
+ return 25
+ }
+ case 0xBA:
+ { /* '0xBA' */
+ return 26
+ }
+ case 0xBB:
+ { /* '0xBB' */
+ return 27
+ }
+ case 0xBC:
+ { /* '0xBC' */
+ return 28
+ }
+ case 0xBD:
+ { /* '0xBD' */
+ return 29
+ }
+ case 0xBE:
+ { /* '0xBE' */
+ return 30
+ }
+ case 0xBF:
+ { /* '0xBF' */
+ return 31
+ }
+ default:
+ {
+ return 0
+ }
+ }
+}
+
+func TelephonyCommandTypeContainerFirstEnumForFieldNumBytes(value uint8) (TelephonyCommandTypeContainer, error) {
+ for _, sizeValue := range TelephonyCommandTypeContainerValues {
+ if sizeValue.NumBytes() == value {
+ return sizeValue, nil
+ }
+ }
+ return 0, errors.Errorf("enum for %v describing NumBytes not found", value)
+}
+
+func (e TelephonyCommandTypeContainer) CommandType() TelephonyCommandType {
+ switch e {
+ case 0x09:
+ { /* '0x09' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA0:
+ { /* '0xA0' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA1:
+ { /* '0xA1' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA2:
+ { /* '0xA2' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA3:
+ { /* '0xA3' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA4:
+ { /* '0xA4' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA5:
+ { /* '0xA5' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA6:
+ { /* '0xA6' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA7:
+ { /* '0xA7' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA8:
+ { /* '0xA8' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xA9:
+ { /* '0xA9' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xAA:
+ { /* '0xAA' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xAB:
+ { /* '0xAB' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xAC:
+ { /* '0xAC' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xAD:
+ { /* '0xAD' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xAE:
+ { /* '0xAE' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xAF:
+ { /* '0xAF' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB0:
+ { /* '0xB0' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB1:
+ { /* '0xB1' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB2:
+ { /* '0xB2' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB3:
+ { /* '0xB3' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB4:
+ { /* '0xB4' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB5:
+ { /* '0xB5' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB6:
+ { /* '0xB6' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB7:
+ { /* '0xB7' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB8:
+ { /* '0xB8' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xB9:
+ { /* '0xB9' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xBA:
+ { /* '0xBA' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xBB:
+ { /* '0xBB' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xBC:
+ { /* '0xBC' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xBD:
+ { /* '0xBD' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xBE:
+ { /* '0xBE' */
+ return TelephonyCommandType_EVENT
+ }
+ case 0xBF:
+ { /* '0xBF' */
+ return TelephonyCommandType_EVENT
+ }
+ default:
+ {
+ return 0
+ }
+ }
+}
+
+func TelephonyCommandTypeContainerFirstEnumForFieldCommandType(value TelephonyCommandType) (TelephonyCommandTypeContainer, error) {
+ for _, sizeValue := range TelephonyCommandTypeContainerValues {
+ if sizeValue.CommandType() == value {
+ return sizeValue, nil
+ }
+ }
+ return 0, errors.Errorf("enum for %v describing CommandType not found", value)
+}
+func TelephonyCommandTypeContainerByValue(value uint8) (enum TelephonyCommandTypeContainer, ok bool) {
+ switch value {
+ case 0x09:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOnHook, true
+ case 0xA0:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_0Bytes, true
+ case 0xA1:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_1Bytes, true
+ case 0xA2:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_2Bytes, true
+ case 0xA3:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_3Bytes, true
+ case 0xA4:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_4Bytes, true
+ case 0xA5:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_5Bytes, true
+ case 0xA6:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_6Bytes, true
+ case 0xA7:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_7Bytes, true
+ case 0xA8:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_8Bytes, true
+ case 0xA9:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_9Bytes, true
+ case 0xAA:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_10Bytes, true
+ case 0xAB:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_11Bytes, true
+ case 0xAC:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_12Bytes, true
+ case 0xAD:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_13Bytes, true
+ case 0xAE:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_14Bytes, true
+ case 0xAF:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_15Bytes, true
+ case 0xB0:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_16Bytes, true
+ case 0xB1:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_17Bytes, true
+ case 0xB2:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_18Bytes, true
+ case 0xB3:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_19Bytes, true
+ case 0xB4:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_20Bytes, true
+ case 0xB5:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_21Bytes, true
+ case 0xB6:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_22Bytes, true
+ case 0xB7:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_23Bytes, true
+ case 0xB8:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_24Bytes, true
+ case 0xB9:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_25Bytes, true
+ case 0xBA:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_26Bytes, true
+ case 0xBB:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_27Bytes, true
+ case 0xBC:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_28Bytes, true
+ case 0xBD:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_29Bytes, true
+ case 0xBE:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_30Bytes, true
+ case 0xBF:
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_31Bytes, true
+ }
+ return 0, false
+}
+
+func TelephonyCommandTypeContainerByName(value string) (enum TelephonyCommandTypeContainer, ok bool) {
+ switch value {
+ case "TelephonyCommandLineOnHook":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOnHook, true
+ case "TelephonyCommandLineOffHook_0Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_0Bytes, true
+ case "TelephonyCommandLineOffHook_1Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_1Bytes, true
+ case "TelephonyCommandLineOffHook_2Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_2Bytes, true
+ case "TelephonyCommandLineOffHook_3Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_3Bytes, true
+ case "TelephonyCommandLineOffHook_4Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_4Bytes, true
+ case "TelephonyCommandLineOffHook_5Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_5Bytes, true
+ case "TelephonyCommandLineOffHook_6Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_6Bytes, true
+ case "TelephonyCommandLineOffHook_7Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_7Bytes, true
+ case "TelephonyCommandLineOffHook_8Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_8Bytes, true
+ case "TelephonyCommandLineOffHook_9Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_9Bytes, true
+ case "TelephonyCommandLineOffHook_10Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_10Bytes, true
+ case "TelephonyCommandLineOffHook_11Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_11Bytes, true
+ case "TelephonyCommandLineOffHook_12Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_12Bytes, true
+ case "TelephonyCommandLineOffHook_13Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_13Bytes, true
+ case "TelephonyCommandLineOffHook_14Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_14Bytes, true
+ case "TelephonyCommandLineOffHook_15Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_15Bytes, true
+ case "TelephonyCommandLineOffHook_16Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_16Bytes, true
+ case "TelephonyCommandLineOffHook_17Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_17Bytes, true
+ case "TelephonyCommandLineOffHook_18Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_18Bytes, true
+ case "TelephonyCommandLineOffHook_19Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_19Bytes, true
+ case "TelephonyCommandLineOffHook_20Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_20Bytes, true
+ case "TelephonyCommandLineOffHook_21Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_21Bytes, true
+ case "TelephonyCommandLineOffHook_22Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_22Bytes, true
+ case "TelephonyCommandLineOffHook_23Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_23Bytes, true
+ case "TelephonyCommandLineOffHook_24Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_24Bytes, true
+ case "TelephonyCommandLineOffHook_25Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_25Bytes, true
+ case "TelephonyCommandLineOffHook_26Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_26Bytes, true
+ case "TelephonyCommandLineOffHook_27Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_27Bytes, true
+ case "TelephonyCommandLineOffHook_28Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_28Bytes, true
+ case "TelephonyCommandLineOffHook_29Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_29Bytes, true
+ case "TelephonyCommandLineOffHook_30Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_30Bytes, true
+ case "TelephonyCommandLineOffHook_31Bytes":
+ return TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_31Bytes, true
+ }
+ return 0, false
+}
+
+func TelephonyCommandTypeContainerKnows(value uint8) bool {
+ for _, typeValue := range TelephonyCommandTypeContainerValues {
+ if uint8(typeValue) == value {
+ return true
+ }
+ }
+ return false
+}
+
+func CastTelephonyCommandTypeContainer(structType interface{}) TelephonyCommandTypeContainer {
+ castFunc := func(typ interface{}) TelephonyCommandTypeContainer {
+ if sTelephonyCommandTypeContainer, ok := typ.(TelephonyCommandTypeContainer); ok {
+ return sTelephonyCommandTypeContainer
+ }
+ return 0
+ }
+ return castFunc(structType)
+}
+
+func (m TelephonyCommandTypeContainer) GetLengthInBits() uint16 {
+ return 8
+}
+
+func (m TelephonyCommandTypeContainer) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyCommandTypeContainerParse(readBuffer utils.ReadBuffer) (TelephonyCommandTypeContainer, error) {
+ val, err := readBuffer.ReadUint8("TelephonyCommandTypeContainer", 8)
+ if err != nil {
+ return 0, errors.Wrap(err, "error reading TelephonyCommandTypeContainer")
+ }
+ if enum, ok := TelephonyCommandTypeContainerByValue(val); !ok {
+ log.Debug().Msgf("no value %x found for RequestType", val)
+ return TelephonyCommandTypeContainer(val), nil
+ } else {
+ return enum, nil
+ }
+}
+
+func (e TelephonyCommandTypeContainer) Serialize(writeBuffer utils.WriteBuffer) error {
+ return writeBuffer.WriteUint8("TelephonyCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
+}
+
+// PLC4XEnumName returns the name that is used in code to identify this enum
+func (e TelephonyCommandTypeContainer) PLC4XEnumName() string {
+ switch e {
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOnHook:
+ return "TelephonyCommandLineOnHook"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_0Bytes:
+ return "TelephonyCommandLineOffHook_0Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_1Bytes:
+ return "TelephonyCommandLineOffHook_1Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_2Bytes:
+ return "TelephonyCommandLineOffHook_2Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_3Bytes:
+ return "TelephonyCommandLineOffHook_3Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_4Bytes:
+ return "TelephonyCommandLineOffHook_4Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_5Bytes:
+ return "TelephonyCommandLineOffHook_5Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_6Bytes:
+ return "TelephonyCommandLineOffHook_6Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_7Bytes:
+ return "TelephonyCommandLineOffHook_7Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_8Bytes:
+ return "TelephonyCommandLineOffHook_8Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_9Bytes:
+ return "TelephonyCommandLineOffHook_9Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_10Bytes:
+ return "TelephonyCommandLineOffHook_10Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_11Bytes:
+ return "TelephonyCommandLineOffHook_11Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_12Bytes:
+ return "TelephonyCommandLineOffHook_12Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_13Bytes:
+ return "TelephonyCommandLineOffHook_13Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_14Bytes:
+ return "TelephonyCommandLineOffHook_14Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_15Bytes:
+ return "TelephonyCommandLineOffHook_15Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_16Bytes:
+ return "TelephonyCommandLineOffHook_16Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_17Bytes:
+ return "TelephonyCommandLineOffHook_17Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_18Bytes:
+ return "TelephonyCommandLineOffHook_18Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_19Bytes:
+ return "TelephonyCommandLineOffHook_19Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_20Bytes:
+ return "TelephonyCommandLineOffHook_20Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_21Bytes:
+ return "TelephonyCommandLineOffHook_21Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_22Bytes:
+ return "TelephonyCommandLineOffHook_22Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_23Bytes:
+ return "TelephonyCommandLineOffHook_23Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_24Bytes:
+ return "TelephonyCommandLineOffHook_24Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_25Bytes:
+ return "TelephonyCommandLineOffHook_25Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_26Bytes:
+ return "TelephonyCommandLineOffHook_26Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_27Bytes:
+ return "TelephonyCommandLineOffHook_27Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_28Bytes:
+ return "TelephonyCommandLineOffHook_28Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_29Bytes:
+ return "TelephonyCommandLineOffHook_29Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_30Bytes:
+ return "TelephonyCommandLineOffHook_30Bytes"
+ case TelephonyCommandTypeContainer_TelephonyCommandLineOffHook_31Bytes:
+ return "TelephonyCommandLineOffHook_31Bytes"
+ }
+ return ""
+}
+
+func (e TelephonyCommandTypeContainer) String() string {
+ return e.PLC4XEnumName()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyData.go b/plc4go/protocols/cbus/readwrite/model/TelephonyData.go
new file mode 100644
index 000000000..9a8dc1df4
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyData.go
@@ -0,0 +1,291 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyData is the corresponding interface of TelephonyData
+type TelephonyData interface {
+ utils.LengthAware
+ utils.Serializable
+ // GetCommandTypeContainer returns CommandTypeContainer (property field)
+ GetCommandTypeContainer() TelephonyCommandTypeContainer
+ // GetArgument returns Argument (property field)
+ GetArgument() byte
+ // GetCommandType returns CommandType (virtual field)
+ GetCommandType() TelephonyCommandType
+}
+
+// TelephonyDataExactly can be used when we want exactly this type and not a type which fulfills TelephonyData.
+// This is useful for switch cases.
+type TelephonyDataExactly interface {
+ TelephonyData
+ isTelephonyData() bool
+}
+
+// _TelephonyData is the data-structure of this message
+type _TelephonyData struct {
+ _TelephonyDataChildRequirements
+ CommandTypeContainer TelephonyCommandTypeContainer
+ Argument byte
+}
+
+type _TelephonyDataChildRequirements interface {
+ utils.Serializable
+ GetLengthInBits() uint16
+ GetLengthInBitsConditional(lastItem bool) uint16
+}
+
+type TelephonyDataParent interface {
+ SerializeParent(writeBuffer utils.WriteBuffer, child TelephonyData, serializeChildFunction func() error) error
+ GetTypeName() string
+}
+
+type TelephonyDataChild interface {
+ utils.Serializable
+ InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte)
+ GetParent() *TelephonyData
+
+ GetTypeName() string
+ TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyData) GetCommandTypeContainer() TelephonyCommandTypeContainer {
+ return m.CommandTypeContainer
+}
+
+func (m *_TelephonyData) GetArgument() byte {
+ return m.Argument
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for virtual fields.
+///////////////////////
+
+func (m *_TelephonyData) GetCommandType() TelephonyCommandType {
+ return CastTelephonyCommandType(m.GetCommandTypeContainer().CommandType())
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyData factory function for _TelephonyData
+func NewTelephonyData(commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyData {
+ return &_TelephonyData{CommandTypeContainer: commandTypeContainer, Argument: argument}
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyData(structType interface{}) TelephonyData {
+ if casted, ok := structType.(TelephonyData); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyData); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyData) GetTypeName() string {
+ return "TelephonyData"
+}
+
+func (m *_TelephonyData) GetParentLengthInBits() uint16 {
+ lengthInBits := uint16(0)
+
+ // Simple field (commandTypeContainer)
+ lengthInBits += 8
+
+ // A virtual field doesn't have any in- or output.
+
+ // Simple field (argument)
+ lengthInBits += 8
+
+ return lengthInBits
+}
+
+func (m *_TelephonyData) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataParse(readBuffer utils.ReadBuffer) (TelephonyData, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyData"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyData")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Validation
+ if !(KnowsTelephonyCommandTypeContainer(readBuffer)) {
+ return nil, errors.WithStack(utils.ParseAssertError{"no command type could be found"})
+ }
+
+ // Simple Field (commandTypeContainer)
+ if pullErr := readBuffer.PullContext("commandTypeContainer"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for commandTypeContainer")
+ }
+ _commandTypeContainer, _commandTypeContainerErr := TelephonyCommandTypeContainerParse(readBuffer)
+ if _commandTypeContainerErr != nil {
+ return nil, errors.Wrap(_commandTypeContainerErr, "Error parsing 'commandTypeContainer' field of TelephonyData")
+ }
+ commandTypeContainer := _commandTypeContainer
+ if closeErr := readBuffer.CloseContext("commandTypeContainer"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for commandTypeContainer")
+ }
+
+ // Virtual field
+ _commandType := commandTypeContainer.CommandType()
+ commandType := TelephonyCommandType(_commandType)
+ _ = commandType
+
+ // Simple Field (argument)
+ _argument, _argumentErr := readBuffer.ReadByte("argument")
+ if _argumentErr != nil {
+ return nil, errors.Wrap(_argumentErr, "Error parsing 'argument' field of TelephonyData")
+ }
+ argument := _argument
+
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ type TelephonyDataChildSerializeRequirement interface {
+ TelephonyData
+ InitializeParent(TelephonyData, TelephonyCommandTypeContainer, byte)
+ GetParent() TelephonyData
+ }
+ var _childTemp interface{}
+ var _child TelephonyDataChildSerializeRequirement
+ var typeSwitchError error
+ switch {
+ case commandType == TelephonyCommandType_EVENT && argument == 0x01: // TelephonyDataLineOnHook
+ _childTemp, typeSwitchError = TelephonyDataLineOnHookParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x02: // TelephonyDataLineOffHook
+ _childTemp, typeSwitchError = TelephonyDataLineOffHookParse(readBuffer, commandTypeContainer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x03: // TelephonyDataDialOutFailure
+ _childTemp, typeSwitchError = TelephonyDataDialOutFailureParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x04: // TelephonyDataDialOutFailure
+ _childTemp, typeSwitchError = TelephonyDataDialOutFailureParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x05: // TelephonyDataRinging
+ _childTemp, typeSwitchError = TelephonyDataRingingParse(readBuffer, commandTypeContainer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x06: // TelephonyDataRecallLastNumber
+ _childTemp, typeSwitchError = TelephonyDataRecallLastNumberParse(readBuffer, commandTypeContainer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x07: // TelephonyDataInternetConnectionRequestMade
+ _childTemp, typeSwitchError = TelephonyDataInternetConnectionRequestMadeParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x80: // TelephonyDataIsolateSecondaryOutlet
+ _childTemp, typeSwitchError = TelephonyDataIsolateSecondaryOutletParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x81: // TelephonyDataRecallLastNumberRequest
+ _childTemp, typeSwitchError = TelephonyDataRecallLastNumberRequestParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x82: // TelephonyDataRejectIncomingCall
+ _childTemp, typeSwitchError = TelephonyDataRejectIncomingCallParse(readBuffer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x83: // TelephonyDataDivert
+ _childTemp, typeSwitchError = TelephonyDataDivertParse(readBuffer, commandTypeContainer)
+ case commandType == TelephonyCommandType_EVENT && argument == 0x84: // TelephonyDataClearDiversion
+ _childTemp, typeSwitchError = TelephonyDataClearDiversionParse(readBuffer)
+ default:
+ typeSwitchError = errors.Errorf("Unmapped type for parameters [commandType=%v, argument=%v]", commandType, argument)
+ }
+ if typeSwitchError != nil {
+ return nil, errors.Wrap(typeSwitchError, "Error parsing sub-type for type-switch of TelephonyData")
+ }
+ _child = _childTemp.(TelephonyDataChildSerializeRequirement)
+
+ if closeErr := readBuffer.CloseContext("TelephonyData"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyData")
+ }
+
+ // Finish initializing
+ _child.InitializeParent(_child, commandTypeContainer, argument)
+ return _child, nil
+}
+
+func (pm *_TelephonyData) SerializeParent(writeBuffer utils.WriteBuffer, child TelephonyData, serializeChildFunction func() error) error {
+ // We redirect all calls through client as some methods are only implemented there
+ m := child
+ _ = m
+ positionAware := writeBuffer
+ _ = positionAware
+ if pushErr := writeBuffer.PushContext("TelephonyData"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyData")
+ }
+
+ // Simple Field (commandTypeContainer)
+ if pushErr := writeBuffer.PushContext("commandTypeContainer"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for commandTypeContainer")
+ }
+ _commandTypeContainerErr := writeBuffer.WriteSerializable(m.GetCommandTypeContainer())
+ if popErr := writeBuffer.PopContext("commandTypeContainer"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for commandTypeContainer")
+ }
+ if _commandTypeContainerErr != nil {
+ return errors.Wrap(_commandTypeContainerErr, "Error serializing 'commandTypeContainer' field")
+ }
+ // Virtual field
+ if _commandTypeErr := writeBuffer.WriteVirtual("commandType", m.GetCommandType()); _commandTypeErr != nil {
+ return errors.Wrap(_commandTypeErr, "Error serializing 'commandType' field")
+ }
+
+ // Simple Field (argument)
+ argument := byte(m.GetArgument())
+ _argumentErr := writeBuffer.WriteByte("argument", (argument))
+ if _argumentErr != nil {
+ return errors.Wrap(_argumentErr, "Error serializing 'argument' 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("TelephonyData"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyData")
+ }
+ return nil
+}
+
+func (m *_TelephonyData) isTelephonyData() bool {
+ return true
+}
+
+func (m *_TelephonyData) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataClearDiversion.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataClearDiversion.go
new file mode 100644
index 000000000..895dccc8f
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataClearDiversion.go
@@ -0,0 +1,155 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataClearDiversion is the corresponding interface of TelephonyDataClearDiversion
+type TelephonyDataClearDiversion interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+}
+
+// TelephonyDataClearDiversionExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataClearDiversion.
+// This is useful for switch cases.
+type TelephonyDataClearDiversionExactly interface {
+ TelephonyDataClearDiversion
+ isTelephonyDataClearDiversion() bool
+}
+
+// _TelephonyDataClearDiversion is the data-structure of this message
+type _TelephonyDataClearDiversion struct {
+ *_TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataClearDiversion) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataClearDiversion) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+// NewTelephonyDataClearDiversion factory function for _TelephonyDataClearDiversion
+func NewTelephonyDataClearDiversion(commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataClearDiversion {
+ _result := &_TelephonyDataClearDiversion{
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataClearDiversion(structType interface{}) TelephonyDataClearDiversion {
+ if casted, ok := structType.(TelephonyDataClearDiversion); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataClearDiversion); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataClearDiversion) GetTypeName() string {
+ return "TelephonyDataClearDiversion"
+}
+
+func (m *_TelephonyDataClearDiversion) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataClearDiversion) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataClearDiversion) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataClearDiversionParse(readBuffer utils.ReadBuffer) (TelephonyDataClearDiversion, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataClearDiversion"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataClearDiversion")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataClearDiversion"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataClearDiversion")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataClearDiversion{
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataClearDiversion) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataClearDiversion"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataClearDiversion")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataClearDiversion"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataClearDiversion")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataClearDiversion) isTelephonyDataClearDiversion() bool {
+ return true
+}
+
+func (m *_TelephonyDataClearDiversion) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataDialOutFailure.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataDialOutFailure.go
new file mode 100644
index 000000000..e2c9739a7
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataDialOutFailure.go
@@ -0,0 +1,202 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataDialOutFailure is the corresponding interface of TelephonyDataDialOutFailure
+type TelephonyDataDialOutFailure interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetReason returns Reason (property field)
+ GetReason() DialInFailureReason
+}
+
+// TelephonyDataDialOutFailureExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataDialOutFailure.
+// This is useful for switch cases.
+type TelephonyDataDialOutFailureExactly interface {
+ TelephonyDataDialOutFailure
+ isTelephonyDataDialOutFailure() bool
+}
+
+// _TelephonyDataDialOutFailure is the data-structure of this message
+type _TelephonyDataDialOutFailure struct {
+ *_TelephonyData
+ Reason DialInFailureReason
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataDialOutFailure) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataDialOutFailure) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataDialOutFailure) GetReason() DialInFailureReason {
+ return m.Reason
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataDialOutFailure factory function for _TelephonyDataDialOutFailure
+func NewTelephonyDataDialOutFailure(reason DialInFailureReason, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataDialOutFailure {
+ _result := &_TelephonyDataDialOutFailure{
+ Reason: reason,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataDialOutFailure(structType interface{}) TelephonyDataDialOutFailure {
+ if casted, ok := structType.(TelephonyDataDialOutFailure); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataDialOutFailure); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataDialOutFailure) GetTypeName() string {
+ return "TelephonyDataDialOutFailure"
+}
+
+func (m *_TelephonyDataDialOutFailure) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataDialOutFailure) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (reason)
+ lengthInBits += 8
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataDialOutFailure) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataDialOutFailureParse(readBuffer utils.ReadBuffer) (TelephonyDataDialOutFailure, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataDialOutFailure"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataDialOutFailure")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (reason)
+ if pullErr := readBuffer.PullContext("reason"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for reason")
+ }
+ _reason, _reasonErr := DialInFailureReasonParse(readBuffer)
+ if _reasonErr != nil {
+ return nil, errors.Wrap(_reasonErr, "Error parsing 'reason' field of TelephonyDataDialOutFailure")
+ }
+ reason := _reason
+ if closeErr := readBuffer.CloseContext("reason"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for reason")
+ }
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataDialOutFailure"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataDialOutFailure")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataDialOutFailure{
+ Reason: reason,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataDialOutFailure) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataDialOutFailure"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataDialOutFailure")
+ }
+
+ // Simple Field (reason)
+ if pushErr := writeBuffer.PushContext("reason"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for reason")
+ }
+ _reasonErr := writeBuffer.WriteSerializable(m.GetReason())
+ if popErr := writeBuffer.PopContext("reason"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for reason")
+ }
+ if _reasonErr != nil {
+ return errors.Wrap(_reasonErr, "Error serializing 'reason' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataDialOutFailure"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataDialOutFailure")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataDialOutFailure) isTelephonyDataDialOutFailure() bool {
+ return true
+}
+
+func (m *_TelephonyDataDialOutFailure) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataDivert.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataDivert.go
new file mode 100644
index 000000000..b6284c337
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataDivert.go
@@ -0,0 +1,191 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataDivert is the corresponding interface of TelephonyDataDivert
+type TelephonyDataDivert interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetNumber returns Number (property field)
+ GetNumber() string
+}
+
+// TelephonyDataDivertExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataDivert.
+// This is useful for switch cases.
+type TelephonyDataDivertExactly interface {
+ TelephonyDataDivert
+ isTelephonyDataDivert() bool
+}
+
+// _TelephonyDataDivert is the data-structure of this message
+type _TelephonyDataDivert struct {
+ *_TelephonyData
+ Number string
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataDivert) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataDivert) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataDivert) GetNumber() string {
+ return m.Number
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataDivert factory function for _TelephonyDataDivert
+func NewTelephonyDataDivert(number string, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataDivert {
+ _result := &_TelephonyDataDivert{
+ Number: number,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataDivert(structType interface{}) TelephonyDataDivert {
+ if casted, ok := structType.(TelephonyDataDivert); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataDivert); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataDivert) GetTypeName() string {
+ return "TelephonyDataDivert"
+}
+
+func (m *_TelephonyDataDivert) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataDivert) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (number)
+ lengthInBits += uint16(int32(int32(int32(m.GetCommandTypeContainer().NumBytes())-int32(int32(1)))) * int32(int32(8)))
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataDivert) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataDivertParse(readBuffer utils.ReadBuffer, commandTypeContainer TelephonyCommandTypeContainer) (TelephonyDataDivert, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataDivert"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataDivert")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (number)
+ _number, _numberErr := readBuffer.ReadString("number", uint32(((commandTypeContainer.NumBytes())-(1))*(8)))
+ if _numberErr != nil {
+ return nil, errors.Wrap(_numberErr, "Error parsing 'number' field of TelephonyDataDivert")
+ }
+ number := _number
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataDivert"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataDivert")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataDivert{
+ Number: number,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataDivert) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataDivert"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataDivert")
+ }
+
+ // Simple Field (number)
+ number := string(m.GetNumber())
+ _numberErr := writeBuffer.WriteString("number", uint32(((m.GetCommandTypeContainer().NumBytes())-(1))*(8)), "UTF-8", (number))
+ if _numberErr != nil {
+ return errors.Wrap(_numberErr, "Error serializing 'number' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataDivert"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataDivert")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataDivert) isTelephonyDataDivert() bool {
+ return true
+}
+
+func (m *_TelephonyDataDivert) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataInternetConnectionRequestMade.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataInternetConnectionRequestMade.go
new file mode 100644
index 000000000..ccf67a334
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataInternetConnectionRequestMade.go
@@ -0,0 +1,155 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataInternetConnectionRequestMade is the corresponding interface of TelephonyDataInternetConnectionRequestMade
+type TelephonyDataInternetConnectionRequestMade interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+}
+
+// TelephonyDataInternetConnectionRequestMadeExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataInternetConnectionRequestMade.
+// This is useful for switch cases.
+type TelephonyDataInternetConnectionRequestMadeExactly interface {
+ TelephonyDataInternetConnectionRequestMade
+ isTelephonyDataInternetConnectionRequestMade() bool
+}
+
+// _TelephonyDataInternetConnectionRequestMade is the data-structure of this message
+type _TelephonyDataInternetConnectionRequestMade struct {
+ *_TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataInternetConnectionRequestMade) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+// NewTelephonyDataInternetConnectionRequestMade factory function for _TelephonyDataInternetConnectionRequestMade
+func NewTelephonyDataInternetConnectionRequestMade(commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataInternetConnectionRequestMade {
+ _result := &_TelephonyDataInternetConnectionRequestMade{
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataInternetConnectionRequestMade(structType interface{}) TelephonyDataInternetConnectionRequestMade {
+ if casted, ok := structType.(TelephonyDataInternetConnectionRequestMade); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataInternetConnectionRequestMade); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) GetTypeName() string {
+ return "TelephonyDataInternetConnectionRequestMade"
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataInternetConnectionRequestMadeParse(readBuffer utils.ReadBuffer) (TelephonyDataInternetConnectionRequestMade, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataInternetConnectionRequestMade"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataInternetConnectionRequestMade")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataInternetConnectionRequestMade"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataInternetConnectionRequestMade")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataInternetConnectionRequestMade{
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataInternetConnectionRequestMade"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataInternetConnectionRequestMade")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataInternetConnectionRequestMade"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataInternetConnectionRequestMade")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) isTelephonyDataInternetConnectionRequestMade() bool {
+ return true
+}
+
+func (m *_TelephonyDataInternetConnectionRequestMade) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataIsolateSecondaryOutlet.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataIsolateSecondaryOutlet.go
new file mode 100644
index 000000000..31c6ff825
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataIsolateSecondaryOutlet.go
@@ -0,0 +1,234 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataIsolateSecondaryOutlet is the corresponding interface of TelephonyDataIsolateSecondaryOutlet
+type TelephonyDataIsolateSecondaryOutlet interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetIsolateStatus returns IsolateStatus (property field)
+ GetIsolateStatus() byte
+ // GetIsBehaveNormal returns IsBehaveNormal (virtual field)
+ GetIsBehaveNormal() bool
+ // GetIsToBeIsolated returns IsToBeIsolated (virtual field)
+ GetIsToBeIsolated() bool
+}
+
+// TelephonyDataIsolateSecondaryOutletExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataIsolateSecondaryOutlet.
+// This is useful for switch cases.
+type TelephonyDataIsolateSecondaryOutletExactly interface {
+ TelephonyDataIsolateSecondaryOutlet
+ isTelephonyDataIsolateSecondaryOutlet() bool
+}
+
+// _TelephonyDataIsolateSecondaryOutlet is the data-structure of this message
+type _TelephonyDataIsolateSecondaryOutlet struct {
+ *_TelephonyData
+ IsolateStatus byte
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetIsolateStatus() byte {
+ return m.IsolateStatus
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for virtual fields.
+///////////////////////
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetIsBehaveNormal() bool {
+ return bool(bool((m.GetIsolateStatus()) == (0x00)))
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetIsToBeIsolated() bool {
+ return bool(bool((m.GetIsolateStatus()) == (0x01)))
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataIsolateSecondaryOutlet factory function for _TelephonyDataIsolateSecondaryOutlet
+func NewTelephonyDataIsolateSecondaryOutlet(isolateStatus byte, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataIsolateSecondaryOutlet {
+ _result := &_TelephonyDataIsolateSecondaryOutlet{
+ IsolateStatus: isolateStatus,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataIsolateSecondaryOutlet(structType interface{}) TelephonyDataIsolateSecondaryOutlet {
+ if casted, ok := structType.(TelephonyDataIsolateSecondaryOutlet); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataIsolateSecondaryOutlet); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetTypeName() string {
+ return "TelephonyDataIsolateSecondaryOutlet"
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (isolateStatus)
+ lengthInBits += 8
+
+ // A virtual field doesn't have any in- or output.
+
+ // A virtual field doesn't have any in- or output.
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataIsolateSecondaryOutletParse(readBuffer utils.ReadBuffer) (TelephonyDataIsolateSecondaryOutlet, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataIsolateSecondaryOutlet"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataIsolateSecondaryOutlet")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (isolateStatus)
+ _isolateStatus, _isolateStatusErr := readBuffer.ReadByte("isolateStatus")
+ if _isolateStatusErr != nil {
+ return nil, errors.Wrap(_isolateStatusErr, "Error parsing 'isolateStatus' field of TelephonyDataIsolateSecondaryOutlet")
+ }
+ isolateStatus := _isolateStatus
+
+ // Virtual field
+ _isBehaveNormal := bool((isolateStatus) == (0x00))
+ isBehaveNormal := bool(_isBehaveNormal)
+ _ = isBehaveNormal
+
+ // Virtual field
+ _isToBeIsolated := bool((isolateStatus) == (0x01))
+ isToBeIsolated := bool(_isToBeIsolated)
+ _ = isToBeIsolated
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataIsolateSecondaryOutlet"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataIsolateSecondaryOutlet")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataIsolateSecondaryOutlet{
+ IsolateStatus: isolateStatus,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataIsolateSecondaryOutlet"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataIsolateSecondaryOutlet")
+ }
+
+ // Simple Field (isolateStatus)
+ isolateStatus := byte(m.GetIsolateStatus())
+ _isolateStatusErr := writeBuffer.WriteByte("isolateStatus", (isolateStatus))
+ if _isolateStatusErr != nil {
+ return errors.Wrap(_isolateStatusErr, "Error serializing 'isolateStatus' field")
+ }
+ // Virtual field
+ if _isBehaveNormalErr := writeBuffer.WriteVirtual("isBehaveNormal", m.GetIsBehaveNormal()); _isBehaveNormalErr != nil {
+ return errors.Wrap(_isBehaveNormalErr, "Error serializing 'isBehaveNormal' field")
+ }
+ // Virtual field
+ if _isToBeIsolatedErr := writeBuffer.WriteVirtual("isToBeIsolated", m.GetIsToBeIsolated()); _isToBeIsolatedErr != nil {
+ return errors.Wrap(_isToBeIsolatedErr, "Error serializing 'isToBeIsolated' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataIsolateSecondaryOutlet"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataIsolateSecondaryOutlet")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) isTelephonyDataIsolateSecondaryOutlet() bool {
+ return true
+}
+
+func (m *_TelephonyDataIsolateSecondaryOutlet) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataLineOffHook.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataLineOffHook.go
new file mode 100644
index 000000000..dfa34560a
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataLineOffHook.go
@@ -0,0 +1,228 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataLineOffHook is the corresponding interface of TelephonyDataLineOffHook
+type TelephonyDataLineOffHook interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetReason returns Reason (property field)
+ GetReason() LineOffHookReason
+ // GetNumber returns Number (property field)
+ GetNumber() string
+}
+
+// TelephonyDataLineOffHookExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataLineOffHook.
+// This is useful for switch cases.
+type TelephonyDataLineOffHookExactly interface {
+ TelephonyDataLineOffHook
+ isTelephonyDataLineOffHook() bool
+}
+
+// _TelephonyDataLineOffHook is the data-structure of this message
+type _TelephonyDataLineOffHook struct {
+ *_TelephonyData
+ Reason LineOffHookReason
+ Number string
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataLineOffHook) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataLineOffHook) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataLineOffHook) GetReason() LineOffHookReason {
+ return m.Reason
+}
+
+func (m *_TelephonyDataLineOffHook) GetNumber() string {
+ return m.Number
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataLineOffHook factory function for _TelephonyDataLineOffHook
+func NewTelephonyDataLineOffHook(reason LineOffHookReason, number string, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataLineOffHook {
+ _result := &_TelephonyDataLineOffHook{
+ Reason: reason,
+ Number: number,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataLineOffHook(structType interface{}) TelephonyDataLineOffHook {
+ if casted, ok := structType.(TelephonyDataLineOffHook); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataLineOffHook); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataLineOffHook) GetTypeName() string {
+ return "TelephonyDataLineOffHook"
+}
+
+func (m *_TelephonyDataLineOffHook) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataLineOffHook) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (reason)
+ lengthInBits += 8
+
+ // Simple field (number)
+ lengthInBits += uint16(int32(int32(int32(m.GetCommandTypeContainer().NumBytes())-int32(int32(2)))) * int32(int32(8)))
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataLineOffHook) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataLineOffHookParse(readBuffer utils.ReadBuffer, commandTypeContainer TelephonyCommandTypeContainer) (TelephonyDataLineOffHook, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataLineOffHook"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataLineOffHook")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (reason)
+ if pullErr := readBuffer.PullContext("reason"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for reason")
+ }
+ _reason, _reasonErr := LineOffHookReasonParse(readBuffer)
+ if _reasonErr != nil {
+ return nil, errors.Wrap(_reasonErr, "Error parsing 'reason' field of TelephonyDataLineOffHook")
+ }
+ reason := _reason
+ if closeErr := readBuffer.CloseContext("reason"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for reason")
+ }
+
+ // Simple Field (number)
+ _number, _numberErr := readBuffer.ReadString("number", uint32(((commandTypeContainer.NumBytes())-(2))*(8)))
+ if _numberErr != nil {
+ return nil, errors.Wrap(_numberErr, "Error parsing 'number' field of TelephonyDataLineOffHook")
+ }
+ number := _number
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataLineOffHook"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataLineOffHook")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataLineOffHook{
+ Reason: reason,
+ Number: number,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataLineOffHook) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataLineOffHook"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataLineOffHook")
+ }
+
+ // Simple Field (reason)
+ if pushErr := writeBuffer.PushContext("reason"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for reason")
+ }
+ _reasonErr := writeBuffer.WriteSerializable(m.GetReason())
+ if popErr := writeBuffer.PopContext("reason"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for reason")
+ }
+ if _reasonErr != nil {
+ return errors.Wrap(_reasonErr, "Error serializing 'reason' field")
+ }
+
+ // Simple Field (number)
+ number := string(m.GetNumber())
+ _numberErr := writeBuffer.WriteString("number", uint32(((m.GetCommandTypeContainer().NumBytes())-(2))*(8)), "UTF-8", (number))
+ if _numberErr != nil {
+ return errors.Wrap(_numberErr, "Error serializing 'number' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataLineOffHook"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataLineOffHook")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataLineOffHook) isTelephonyDataLineOffHook() bool {
+ return true
+}
+
+func (m *_TelephonyDataLineOffHook) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataLineOnHook.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataLineOnHook.go
new file mode 100644
index 000000000..b6887a83d
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataLineOnHook.go
@@ -0,0 +1,155 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataLineOnHook is the corresponding interface of TelephonyDataLineOnHook
+type TelephonyDataLineOnHook interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+}
+
+// TelephonyDataLineOnHookExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataLineOnHook.
+// This is useful for switch cases.
+type TelephonyDataLineOnHookExactly interface {
+ TelephonyDataLineOnHook
+ isTelephonyDataLineOnHook() bool
+}
+
+// _TelephonyDataLineOnHook is the data-structure of this message
+type _TelephonyDataLineOnHook struct {
+ *_TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataLineOnHook) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataLineOnHook) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+// NewTelephonyDataLineOnHook factory function for _TelephonyDataLineOnHook
+func NewTelephonyDataLineOnHook(commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataLineOnHook {
+ _result := &_TelephonyDataLineOnHook{
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataLineOnHook(structType interface{}) TelephonyDataLineOnHook {
+ if casted, ok := structType.(TelephonyDataLineOnHook); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataLineOnHook); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataLineOnHook) GetTypeName() string {
+ return "TelephonyDataLineOnHook"
+}
+
+func (m *_TelephonyDataLineOnHook) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataLineOnHook) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataLineOnHook) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataLineOnHookParse(readBuffer utils.ReadBuffer) (TelephonyDataLineOnHook, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataLineOnHook"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataLineOnHook")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataLineOnHook"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataLineOnHook")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataLineOnHook{
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataLineOnHook) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataLineOnHook"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataLineOnHook")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataLineOnHook"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataLineOnHook")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataLineOnHook) isTelephonyDataLineOnHook() bool {
+ return true
+}
+
+func (m *_TelephonyDataLineOnHook) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataRecallLastNumber.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRecallLastNumber.go
new file mode 100644
index 000000000..598849142
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRecallLastNumber.go
@@ -0,0 +1,260 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataRecallLastNumber is the corresponding interface of TelephonyDataRecallLastNumber
+type TelephonyDataRecallLastNumber interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetRecallLastNumberType returns RecallLastNumberType (property field)
+ GetRecallLastNumberType() byte
+ // GetNumber returns Number (property field)
+ GetNumber() string
+ // GetIsNumberOfLastOutgoingCall returns IsNumberOfLastOutgoingCall (virtual field)
+ GetIsNumberOfLastOutgoingCall() bool
+ // GetIsNumberOfLastIncomingCall returns IsNumberOfLastIncomingCall (virtual field)
+ GetIsNumberOfLastIncomingCall() bool
+}
+
+// TelephonyDataRecallLastNumberExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataRecallLastNumber.
+// This is useful for switch cases.
+type TelephonyDataRecallLastNumberExactly interface {
+ TelephonyDataRecallLastNumber
+ isTelephonyDataRecallLastNumber() bool
+}
+
+// _TelephonyDataRecallLastNumber is the data-structure of this message
+type _TelephonyDataRecallLastNumber struct {
+ *_TelephonyData
+ RecallLastNumberType byte
+ Number string
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataRecallLastNumber) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataRecallLastNumber) GetRecallLastNumberType() byte {
+ return m.RecallLastNumberType
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetNumber() string {
+ return m.Number
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for virtual fields.
+///////////////////////
+
+func (m *_TelephonyDataRecallLastNumber) GetIsNumberOfLastOutgoingCall() bool {
+ return bool(bool((m.GetRecallLastNumberType()) == (0x01)))
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetIsNumberOfLastIncomingCall() bool {
+ return bool(bool((m.GetRecallLastNumberType()) == (0x02)))
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataRecallLastNumber factory function for _TelephonyDataRecallLastNumber
+func NewTelephonyDataRecallLastNumber(recallLastNumberType byte, number string, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataRecallLastNumber {
+ _result := &_TelephonyDataRecallLastNumber{
+ RecallLastNumberType: recallLastNumberType,
+ Number: number,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataRecallLastNumber(structType interface{}) TelephonyDataRecallLastNumber {
+ if casted, ok := structType.(TelephonyDataRecallLastNumber); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataRecallLastNumber); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetTypeName() string {
+ return "TelephonyDataRecallLastNumber"
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (recallLastNumberType)
+ lengthInBits += 8
+
+ // A virtual field doesn't have any in- or output.
+
+ // A virtual field doesn't have any in- or output.
+
+ // Simple field (number)
+ lengthInBits += uint16(int32(int32(int32(m.GetCommandTypeContainer().NumBytes())-int32(int32(2)))) * int32(int32(8)))
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataRecallLastNumber) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataRecallLastNumberParse(readBuffer utils.ReadBuffer, commandTypeContainer TelephonyCommandTypeContainer) (TelephonyDataRecallLastNumber, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataRecallLastNumber"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataRecallLastNumber")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (recallLastNumberType)
+ _recallLastNumberType, _recallLastNumberTypeErr := readBuffer.ReadByte("recallLastNumberType")
+ if _recallLastNumberTypeErr != nil {
+ return nil, errors.Wrap(_recallLastNumberTypeErr, "Error parsing 'recallLastNumberType' field of TelephonyDataRecallLastNumber")
+ }
+ recallLastNumberType := _recallLastNumberType
+
+ // Virtual field
+ _isNumberOfLastOutgoingCall := bool((recallLastNumberType) == (0x01))
+ isNumberOfLastOutgoingCall := bool(_isNumberOfLastOutgoingCall)
+ _ = isNumberOfLastOutgoingCall
+
+ // Virtual field
+ _isNumberOfLastIncomingCall := bool((recallLastNumberType) == (0x02))
+ isNumberOfLastIncomingCall := bool(_isNumberOfLastIncomingCall)
+ _ = isNumberOfLastIncomingCall
+
+ // Simple Field (number)
+ _number, _numberErr := readBuffer.ReadString("number", uint32(((commandTypeContainer.NumBytes())-(2))*(8)))
+ if _numberErr != nil {
+ return nil, errors.Wrap(_numberErr, "Error parsing 'number' field of TelephonyDataRecallLastNumber")
+ }
+ number := _number
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataRecallLastNumber"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataRecallLastNumber")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataRecallLastNumber{
+ RecallLastNumberType: recallLastNumberType,
+ Number: number,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataRecallLastNumber) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataRecallLastNumber"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataRecallLastNumber")
+ }
+
+ // Simple Field (recallLastNumberType)
+ recallLastNumberType := byte(m.GetRecallLastNumberType())
+ _recallLastNumberTypeErr := writeBuffer.WriteByte("recallLastNumberType", (recallLastNumberType))
+ if _recallLastNumberTypeErr != nil {
+ return errors.Wrap(_recallLastNumberTypeErr, "Error serializing 'recallLastNumberType' field")
+ }
+ // Virtual field
+ if _isNumberOfLastOutgoingCallErr := writeBuffer.WriteVirtual("isNumberOfLastOutgoingCall", m.GetIsNumberOfLastOutgoingCall()); _isNumberOfLastOutgoingCallErr != nil {
+ return errors.Wrap(_isNumberOfLastOutgoingCallErr, "Error serializing 'isNumberOfLastOutgoingCall' field")
+ }
+ // Virtual field
+ if _isNumberOfLastIncomingCallErr := writeBuffer.WriteVirtual("isNumberOfLastIncomingCall", m.GetIsNumberOfLastIncomingCall()); _isNumberOfLastIncomingCallErr != nil {
+ return errors.Wrap(_isNumberOfLastIncomingCallErr, "Error serializing 'isNumberOfLastIncomingCall' field")
+ }
+
+ // Simple Field (number)
+ number := string(m.GetNumber())
+ _numberErr := writeBuffer.WriteString("number", uint32(((m.GetCommandTypeContainer().NumBytes())-(2))*(8)), "UTF-8", (number))
+ if _numberErr != nil {
+ return errors.Wrap(_numberErr, "Error serializing 'number' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataRecallLastNumber"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataRecallLastNumber")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataRecallLastNumber) isTelephonyDataRecallLastNumber() bool {
+ return true
+}
+
+func (m *_TelephonyDataRecallLastNumber) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataRecallLastNumberRequest.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRecallLastNumberRequest.go
new file mode 100644
index 000000000..85dd984eb
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRecallLastNumberRequest.go
@@ -0,0 +1,234 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataRecallLastNumberRequest is the corresponding interface of TelephonyDataRecallLastNumberRequest
+type TelephonyDataRecallLastNumberRequest interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetRecallLastNumberType returns RecallLastNumberType (property field)
+ GetRecallLastNumberType() byte
+ // GetIsNumberOfLastOutgoingCall returns IsNumberOfLastOutgoingCall (virtual field)
+ GetIsNumberOfLastOutgoingCall() bool
+ // GetIsNumberOfLastIncomingCall returns IsNumberOfLastIncomingCall (virtual field)
+ GetIsNumberOfLastIncomingCall() bool
+}
+
+// TelephonyDataRecallLastNumberRequestExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataRecallLastNumberRequest.
+// This is useful for switch cases.
+type TelephonyDataRecallLastNumberRequestExactly interface {
+ TelephonyDataRecallLastNumberRequest
+ isTelephonyDataRecallLastNumberRequest() bool
+}
+
+// _TelephonyDataRecallLastNumberRequest is the data-structure of this message
+type _TelephonyDataRecallLastNumberRequest struct {
+ *_TelephonyData
+ RecallLastNumberType byte
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataRecallLastNumberRequest) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetRecallLastNumberType() byte {
+ return m.RecallLastNumberType
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for virtual fields.
+///////////////////////
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetIsNumberOfLastOutgoingCall() bool {
+ return bool(bool((m.GetRecallLastNumberType()) == (0x01)))
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetIsNumberOfLastIncomingCall() bool {
+ return bool(bool((m.GetRecallLastNumberType()) == (0x02)))
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataRecallLastNumberRequest factory function for _TelephonyDataRecallLastNumberRequest
+func NewTelephonyDataRecallLastNumberRequest(recallLastNumberType byte, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataRecallLastNumberRequest {
+ _result := &_TelephonyDataRecallLastNumberRequest{
+ RecallLastNumberType: recallLastNumberType,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataRecallLastNumberRequest(structType interface{}) TelephonyDataRecallLastNumberRequest {
+ if casted, ok := structType.(TelephonyDataRecallLastNumberRequest); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataRecallLastNumberRequest); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetTypeName() string {
+ return "TelephonyDataRecallLastNumberRequest"
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Simple field (recallLastNumberType)
+ lengthInBits += 8
+
+ // A virtual field doesn't have any in- or output.
+
+ // A virtual field doesn't have any in- or output.
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataRecallLastNumberRequestParse(readBuffer utils.ReadBuffer) (TelephonyDataRecallLastNumberRequest, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataRecallLastNumberRequest"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataRecallLastNumberRequest")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Simple Field (recallLastNumberType)
+ _recallLastNumberType, _recallLastNumberTypeErr := readBuffer.ReadByte("recallLastNumberType")
+ if _recallLastNumberTypeErr != nil {
+ return nil, errors.Wrap(_recallLastNumberTypeErr, "Error parsing 'recallLastNumberType' field of TelephonyDataRecallLastNumberRequest")
+ }
+ recallLastNumberType := _recallLastNumberType
+
+ // Virtual field
+ _isNumberOfLastOutgoingCall := bool((recallLastNumberType) == (0x01))
+ isNumberOfLastOutgoingCall := bool(_isNumberOfLastOutgoingCall)
+ _ = isNumberOfLastOutgoingCall
+
+ // Virtual field
+ _isNumberOfLastIncomingCall := bool((recallLastNumberType) == (0x02))
+ isNumberOfLastIncomingCall := bool(_isNumberOfLastIncomingCall)
+ _ = isNumberOfLastIncomingCall
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataRecallLastNumberRequest"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataRecallLastNumberRequest")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataRecallLastNumberRequest{
+ RecallLastNumberType: recallLastNumberType,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataRecallLastNumberRequest"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataRecallLastNumberRequest")
+ }
+
+ // Simple Field (recallLastNumberType)
+ recallLastNumberType := byte(m.GetRecallLastNumberType())
+ _recallLastNumberTypeErr := writeBuffer.WriteByte("recallLastNumberType", (recallLastNumberType))
+ if _recallLastNumberTypeErr != nil {
+ return errors.Wrap(_recallLastNumberTypeErr, "Error serializing 'recallLastNumberType' field")
+ }
+ // Virtual field
+ if _isNumberOfLastOutgoingCallErr := writeBuffer.WriteVirtual("isNumberOfLastOutgoingCall", m.GetIsNumberOfLastOutgoingCall()); _isNumberOfLastOutgoingCallErr != nil {
+ return errors.Wrap(_isNumberOfLastOutgoingCallErr, "Error serializing 'isNumberOfLastOutgoingCall' field")
+ }
+ // Virtual field
+ if _isNumberOfLastIncomingCallErr := writeBuffer.WriteVirtual("isNumberOfLastIncomingCall", m.GetIsNumberOfLastIncomingCall()); _isNumberOfLastIncomingCallErr != nil {
+ return errors.Wrap(_isNumberOfLastIncomingCallErr, "Error serializing 'isNumberOfLastIncomingCall' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataRecallLastNumberRequest"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataRecallLastNumberRequest")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) isTelephonyDataRecallLastNumberRequest() bool {
+ return true
+}
+
+func (m *_TelephonyDataRecallLastNumberRequest) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataRejectIncomingCall.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRejectIncomingCall.go
new file mode 100644
index 000000000..519b4a23e
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRejectIncomingCall.go
@@ -0,0 +1,155 @@
+/*
+ * 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
+ *
+ * https://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.
+
+// TelephonyDataRejectIncomingCall is the corresponding interface of TelephonyDataRejectIncomingCall
+type TelephonyDataRejectIncomingCall interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+}
+
+// TelephonyDataRejectIncomingCallExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataRejectIncomingCall.
+// This is useful for switch cases.
+type TelephonyDataRejectIncomingCallExactly interface {
+ TelephonyDataRejectIncomingCall
+ isTelephonyDataRejectIncomingCall() bool
+}
+
+// _TelephonyDataRejectIncomingCall is the data-structure of this message
+type _TelephonyDataRejectIncomingCall struct {
+ *_TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataRejectIncomingCall) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataRejectIncomingCall) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+// NewTelephonyDataRejectIncomingCall factory function for _TelephonyDataRejectIncomingCall
+func NewTelephonyDataRejectIncomingCall(commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataRejectIncomingCall {
+ _result := &_TelephonyDataRejectIncomingCall{
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataRejectIncomingCall(structType interface{}) TelephonyDataRejectIncomingCall {
+ if casted, ok := structType.(TelephonyDataRejectIncomingCall); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataRejectIncomingCall); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataRejectIncomingCall) GetTypeName() string {
+ return "TelephonyDataRejectIncomingCall"
+}
+
+func (m *_TelephonyDataRejectIncomingCall) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataRejectIncomingCall) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataRejectIncomingCall) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataRejectIncomingCallParse(readBuffer utils.ReadBuffer) (TelephonyDataRejectIncomingCall, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataRejectIncomingCall"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataRejectIncomingCall")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataRejectIncomingCall"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataRejectIncomingCall")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataRejectIncomingCall{
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataRejectIncomingCall) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataRejectIncomingCall"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataRejectIncomingCall")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataRejectIncomingCall"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataRejectIncomingCall")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataRejectIncomingCall) isTelephonyDataRejectIncomingCall() bool {
+ return true
+}
+
+func (m *_TelephonyDataRejectIncomingCall) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyDataRinging.go b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRinging.go
new file mode 100644
index 000000000..037b1af1c
--- /dev/null
+++ b/plc4go/protocols/cbus/readwrite/model/TelephonyDataRinging.go
@@ -0,0 +1,217 @@
+/*
+ * 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
+ *
+ * https://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"
+ "github.com/rs/zerolog/log"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// TelephonyDataRinging is the corresponding interface of TelephonyDataRinging
+type TelephonyDataRinging interface {
+ utils.LengthAware
+ utils.Serializable
+ TelephonyData
+ // GetNumber returns Number (property field)
+ GetNumber() string
+}
+
+// TelephonyDataRingingExactly can be used when we want exactly this type and not a type which fulfills TelephonyDataRinging.
+// This is useful for switch cases.
+type TelephonyDataRingingExactly interface {
+ TelephonyDataRinging
+ isTelephonyDataRinging() bool
+}
+
+// _TelephonyDataRinging is the data-structure of this message
+type _TelephonyDataRinging struct {
+ *_TelephonyData
+ Number string
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_TelephonyDataRinging) InitializeParent(parent TelephonyData, commandTypeContainer TelephonyCommandTypeContainer, argument byte) {
+ m.CommandTypeContainer = commandTypeContainer
+ m.Argument = argument
+}
+
+func (m *_TelephonyDataRinging) GetParent() TelephonyData {
+ return m._TelephonyData
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for property fields.
+///////////////////////
+
+func (m *_TelephonyDataRinging) GetNumber() string {
+ return m.Number
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+// NewTelephonyDataRinging factory function for _TelephonyDataRinging
+func NewTelephonyDataRinging(number string, commandTypeContainer TelephonyCommandTypeContainer, argument byte) *_TelephonyDataRinging {
+ _result := &_TelephonyDataRinging{
+ Number: number,
+ _TelephonyData: NewTelephonyData(commandTypeContainer, argument),
+ }
+ _result._TelephonyData._TelephonyDataChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastTelephonyDataRinging(structType interface{}) TelephonyDataRinging {
+ if casted, ok := structType.(TelephonyDataRinging); ok {
+ return casted
+ }
+ if casted, ok := structType.(*TelephonyDataRinging); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_TelephonyDataRinging) GetTypeName() string {
+ return "TelephonyDataRinging"
+}
+
+func (m *_TelephonyDataRinging) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_TelephonyDataRinging) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ // Reserved Field (reserved)
+ lengthInBits += 8
+
+ // Simple field (number)
+ lengthInBits += uint16(int32(int32(int32(m.GetCommandTypeContainer().NumBytes())-int32(int32(2)))) * int32(int32(8)))
+
+ return lengthInBits
+}
+
+func (m *_TelephonyDataRinging) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func TelephonyDataRingingParse(readBuffer utils.ReadBuffer, commandTypeContainer TelephonyCommandTypeContainer) (TelephonyDataRinging, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("TelephonyDataRinging"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for TelephonyDataRinging")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ reserved, _err := readBuffer.ReadByte("reserved")
+ if _err != nil {
+ return nil, errors.Wrap(_err, "Error parsing 'reserved' field of TelephonyDataRinging")
+ }
+ if reserved != byte(0x01) {
+ log.Info().Fields(map[string]interface{}{
+ "expected value": byte(0x01),
+ "got value": reserved,
+ }).Msg("Got unexpected response for reserved field.")
+ }
+ }
+
+ // Simple Field (number)
+ _number, _numberErr := readBuffer.ReadString("number", uint32(((commandTypeContainer.NumBytes())-(2))*(8)))
+ if _numberErr != nil {
+ return nil, errors.Wrap(_numberErr, "Error parsing 'number' field of TelephonyDataRinging")
+ }
+ number := _number
+
+ if closeErr := readBuffer.CloseContext("TelephonyDataRinging"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for TelephonyDataRinging")
+ }
+
+ // Create a partially initialized instance
+ _child := &_TelephonyDataRinging{
+ Number: number,
+ _TelephonyData: &_TelephonyData{},
+ }
+ _child._TelephonyData._TelephonyDataChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_TelephonyDataRinging) Serialize(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("TelephonyDataRinging"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for TelephonyDataRinging")
+ }
+
+ // Reserved Field (reserved)
+ {
+ _err := writeBuffer.WriteByte("reserved", byte(0x01))
+ if _err != nil {
+ return errors.Wrap(_err, "Error serializing 'reserved' field")
+ }
+ }
+
+ // Simple Field (number)
+ number := string(m.GetNumber())
+ _numberErr := writeBuffer.WriteString("number", uint32(((m.GetCommandTypeContainer().NumBytes())-(2))*(8)), "UTF-8", (number))
+ if _numberErr != nil {
+ return errors.Wrap(_numberErr, "Error serializing 'number' field")
+ }
+
+ if popErr := writeBuffer.PopContext("TelephonyDataRinging"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for TelephonyDataRinging")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_TelephonyDataRinging) isTelephonyDataRinging() bool {
+ return true
+}
+
+func (m *_TelephonyDataRinging) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec b/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
index cb0ad9d23..fa1533fac 100644
--- a/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
+++ b/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
@@ -1352,7 +1352,7 @@
[simple ClockAndTimekeepingData clockAndTimekeepingData]
]
['TELEPHONY_STATUS_AND_CONTROL' *TelephonyStatusAndControl
- [validation '1==2' "TELEPHONY_STATUS_AND_CONTROL Not yet implemented"] // TODO: implement me
+ [simple TelephonyData telephonyData]
]
['MEASUREMENT' *Measurement
[validation '1==2' "MEASUREMENT Not yet implemented"] // TODO: implement me
@@ -2527,6 +2527,121 @@
['0x01' REQUEST_REFRESH ]
]
+[type TelephonyData
+ //TODO: golang doesn't like checking for null so we use that static call to check that the enum is known
+ [validation 'STATIC_CALL("knowsTelephonyCommandTypeContainer", readBuffer)' "no command type could be found" shouldFail=false]
+ [simple TelephonyCommandTypeContainer commandTypeContainer ]
+ [virtual TelephonyCommandType commandType 'commandTypeContainer.commandType']
+ [simple byte argument]
+ [typeSwitch commandType, argument
+ ['EVENT', '0x01' *LineOnHook
+ ]
+ ['EVENT', '0x02' *LineOffHook(TelephonyCommandTypeContainer commandTypeContainer)
+ [simple LineOffHookReason reason]
+ [simple vstring '(commandTypeContainer.numBytes-2)*8' number ]
+ ]
+ ['EVENT', '0x03' *DialOutFailure
+ [simple DialOutFailureReason reason]
+ ]
+ ['EVENT', '0x04' *DialOutFailure
+ [simple DialInFailureReason reason]
+ ]
+ ['EVENT', '0x05' *Ringing(TelephonyCommandTypeContainer commandTypeContainer)
+ [reserved byte '0x01' ]
+ [simple vstring '(commandTypeContainer.numBytes-2)*8' number ]
+ ]
+ ['EVENT', '0x06' *RecallLastNumber(TelephonyCommandTypeContainer commandTypeContainer)
+ [simple byte recallLastNumberType ]
+ [virtual bit isNumberOfLastOutgoingCall 'recallLastNumberType == 0x01' ]
+ [virtual bit isNumberOfLastIncomingCall 'recallLastNumberType == 0x02' ]
+ [simple vstring '(commandTypeContainer.numBytes-2)*8' number ]
+ ]
+ ['EVENT', '0x07' *InternetConnectionRequestMade
+ ]
+ ['EVENT', '0x80' *IsolateSecondaryOutlet
+ [simple byte isolateStatus]
+ [virtual bit isBehaveNormal 'isolateStatus == 0x00']
+ [virtual bit isToBeIsolated 'isolateStatus == 0x01']
+ ]
+ ['EVENT', '0x81' *RecallLastNumberRequest
+ [simple byte recallLastNumberType ]
+ [virtual bit isNumberOfLastOutgoingCall 'recallLastNumberType == 0x01' ]
+ [virtual bit isNumberOfLastIncomingCall 'recallLastNumberType == 0x02' ]
+ ]
+ ['EVENT', '0x82' *RejectIncomingCall
+ ]
+ ['EVENT', '0x83' *Divert(TelephonyCommandTypeContainer commandTypeContainer)
+ [simple vstring '(commandTypeContainer.numBytes-1)*8' number ]
+ ]
+ ['EVENT', '0x84' *ClearDiversion
+ ]
+ ]
+]
+
+[enum uint 8 TelephonyCommandTypeContainer(TelephonyCommandType commandType, uint 5 numBytes)
+ ['0x09' TelephonyCommandLineOnHook ['EVENT', '1']]
+ ['0xA0' TelephonyCommandLineOffHook_0Bytes ['EVENT', '0']]
+ ['0xA1' TelephonyCommandLineOffHook_1Bytes ['EVENT', '1']]
+ ['0xA2' TelephonyCommandLineOffHook_2Bytes ['EVENT', '2']]
+ ['0xA3' TelephonyCommandLineOffHook_3Bytes ['EVENT', '3']]
+ ['0xA4' TelephonyCommandLineOffHook_4Bytes ['EVENT', '4']]
+ ['0xA5' TelephonyCommandLineOffHook_5Bytes ['EVENT', '5']]
+ ['0xA6' TelephonyCommandLineOffHook_6Bytes ['EVENT', '6']]
+ ['0xA7' TelephonyCommandLineOffHook_7Bytes ['EVENT', '7']]
+ ['0xA8' TelephonyCommandLineOffHook_8Bytes ['EVENT', '8']]
+ ['0xA9' TelephonyCommandLineOffHook_9Bytes ['EVENT', '9']]
+ ['0xAA' TelephonyCommandLineOffHook_10Bytes ['EVENT', '10']]
+ ['0xAB' TelephonyCommandLineOffHook_11Bytes ['EVENT', '11']]
+ ['0xAC' TelephonyCommandLineOffHook_12Bytes ['EVENT', '12']]
+ ['0xAD' TelephonyCommandLineOffHook_13Bytes ['EVENT', '13']]
+ ['0xAE' TelephonyCommandLineOffHook_14Bytes ['EVENT', '14']]
+ ['0xAF' TelephonyCommandLineOffHook_15Bytes ['EVENT', '15']]
+ ['0xB0' TelephonyCommandLineOffHook_16Bytes ['EVENT', '16']]
+ ['0xB1' TelephonyCommandLineOffHook_17Bytes ['EVENT', '17']]
+ ['0xB2' TelephonyCommandLineOffHook_18Bytes ['EVENT', '18']]
+ ['0xB3' TelephonyCommandLineOffHook_19Bytes ['EVENT', '19']]
+ ['0xB4' TelephonyCommandLineOffHook_20Bytes ['EVENT', '20']]
+ ['0xB5' TelephonyCommandLineOffHook_21Bytes ['EVENT', '21']]
+ ['0xB6' TelephonyCommandLineOffHook_22Bytes ['EVENT', '22']]
+ ['0xB7' TelephonyCommandLineOffHook_23Bytes ['EVENT', '23']]
+ ['0xB8' TelephonyCommandLineOffHook_24Bytes ['EVENT', '24']]
+ ['0xB9' TelephonyCommandLineOffHook_25Bytes ['EVENT', '25']]
+ ['0xBA' TelephonyCommandLineOffHook_26Bytes ['EVENT', '26']]
+ ['0xBB' TelephonyCommandLineOffHook_27Bytes ['EVENT', '27']]
+ ['0xBC' TelephonyCommandLineOffHook_28Bytes ['EVENT', '28']]
+ ['0xBD' TelephonyCommandLineOffHook_29Bytes ['EVENT', '29']]
+ ['0xBE' TelephonyCommandLineOffHook_30Bytes ['EVENT', '30']]
+ ['0xBF' TelephonyCommandLineOffHook_31Bytes ['EVENT', '31']]
+]
+
+[enum uint 4 TelephonyCommandType
+ ['0x00' EVENT ]
+]
+
+[enum uint 8 LineOffHookReason
+ ['0x01' INCOMING_VOICE_CALL ]
+ ['0x02' INCOMING_DATA_CALL ]
+ ['0x03' INCOMING_CALL ]
+ ['0x10' OUTGOING_VOICE_CALL ]
+ ['0x20' OUTGOING_DATA_CALL ]
+ ['0x30' OUTGOING_CALL ]
+ ['0x40' CBTI_IS_SETTING ]
+ ['0x50' CBTI_IS_CLEARING ]
+]
+
+[enum uint 8 DialOutFailureReason
+ ['0x01' NO_DIAL_TONE ]
+ ['0x02' NO_ANSWER ]
+ ['0x03' NO_VALID_ACKNOWLEDGEMENT_OF_PROMPTS ]
+ ['0x04' NUMBER_WAS_UNOBTAINABLE_DOES_NOT_EXIST ]
+ ['0x05' NUMBER_WAS_BUSY ]
+ ['0x06' INTERNAL_FAILURE ]
+]
+
+[enum uint 8 DialInFailureReason
+ ['0x01' PHONE_STOPPED_RINGING ]
+]
+
[type ReplyOrConfirmation(CBusOptions cBusOptions, uint 16 messageLength, RequestContext requestContext)
[peek byte peekedByte ]
[virtual bit isAlpha '(peekedByte >= 0x67) && (peekedByte <= 0x7A)' ]