KnxTelegram

open class KnxTelegram

Class representing a KNX telegram.

  • Default initializer.

    Declaration

    Swift

    public init()
  • Intializes a telegram instance with the given data and type.

    Declaration

    Swift

    public init(bytes: [UInt8], type: KnxTelegramType = .unknown)

    Parameters

    bytes

    The payload to initialize the telegram with.

    type

    The DPT type to set for the telegram.

  • Returns the group address of the telegram.

    Declaration

    Swift

    open func getGroupAddress() -> KnxGroupAddress
  • Returns the data value in the telegram as a specific DPT.

    Throws

    IllformedTelegramForType, UnknownTelegramType

    Declaration

    Swift

    open func getValueAsType(type: KnxTelegramType) throws -> Int

    Parameters

    type

    DPT type to decode the telegram according to.

    Return Value

    The decoded value as an integer.

  • Returns the data value in the telegram as a specific DPT.

    Throws

    IllformedTelegramForType, UnknownTelegramType

    Declaration

    Swift

    open func getValueAsType(type: KnxTelegramType) throws -> Double

    Parameters

    type

    DPT type to decode the telegram according to.

    Return Value

    The decoded value as a float.

  • Returns the data value in the telegram as a specific DPT.

    Throws

    IllformedTelegramForType, UnknownTelegramType

    Declaration

    Swift

    open func getValueAsType(type: KnxTelegramType) throws -> String

    Parameters

    type

    DPT type to decode the telegram according to.

    Return Value

    The decoded value as a string.

  • Read-only property indicating whether the telegram contains a write request or value response, i.e. not a read request.

    Declaration

    Swift

    open var isWriteRequestOrValueResponse: Bool