knx

KNX protocol support
1.0.0 Latest release released

Crystal KNX

Constructs KNX standard datagrams that make it easy to communicate with devices on KNX networks.

Build Status

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

knx:
  github: spider-gazelle/knx
  version: ~> 1.0.0
License MIT
Crystal none

Dependencies 2

  • bindata ~> 1.5
    {'github' => 'spider-gazelle/bindata', 'version' => '~> 1.5'}
  • cmac ~> 1.0
    {'github' => 'spider-gazelle/cmac', 'version' => '~> 1.0'}

Development Dependencies 1

  • ameba
    {'github' => 'veelenga/ameba'}

Dependents 0

Last synced .
search fire star recently