knx v1.0.3
Crystal KNX
Constructs KNX standard datagrams that make it easy to communicate with devices on KNX networks.
Usage
require "knx"
knx = KNX.new
datagram = knx.read(bytes)
datagram.source_address.to_s
# => "2.3.4"
datagram.destination_address.to_s
# => "3/4/5"
datagram.data # Returns a byte array
# => [1]
# ...
request = knx.action("1/2/0", true)
bytes = request.to_slice
request = knx.action("1/2/3", 150)
bytes = request.to_slice
# Send byte_string to KNX network to execute the request
# Supports multicast, unicast and TCP/IP tunnelling
There is also support for KNX BAOS devices devices:
require "knx/object_server"
os = KNX::ObjectServer.new
datagram = os.read(bytes)
# Can return multiple values
datagram.data.size #=> 1
# Get the item index we are reading
datagram.data[0].id
# => 12
datagram.data[0].value # Returns bytes
# => Bytes[1]
# ...
request = os.action(1, true)
bytes = request.to_slice
# Send byte_string to KNX BAOS server to execute the request
# This protocol was designed to be sent over TCP/IP
License
MIT
Repository
knx
Owner
Statistic
- 3
- 0
- 0
- 1
- 2
- 3 months ago
- December 15, 2019
License
MIT License
Links
Synced at
Wed, 01 May 2024 22:38:43 GMT
Languages