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
bytesThe payload to initialize the telegram with.
typeThe 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 -> IntParameters
typeDPT 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 -> DoubleParameters
typeDPT 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 -> StringParameters
typeDPT 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
KnxTelegram Class Reference