View Source KNXex.GenStageProducer (knxex v0.1.0)

KNX telegrams GenStage producer and broadcast dispatcher.

Link to this section Summary

Functions

Starts the GenStage producer and broadcast dispatcher.

Subscribes to the given KNX interface and thus receives KNX telegrams from it.

Unsubscribes from the given KNX interface. KNX telegrams cannot be received from it anymore.

Link to this section Functions

@spec start_link(Keyword.t()) :: {:ok, pid()} | {:error, {:already_started, pid()}}

Starts the GenStage producer and broadcast dispatcher.

Link to this function

subscribe_to(knx_interface, name_or_pid \\ nil, opts \\ [])

View Source
@spec subscribe_to(module(), atom() | pid(), Keyword.t()) :: :ok

Subscribes to the given KNX interface and thus receives KNX telegrams from it.

The received KNX telegrams are forwarded as GenStage events, in the form of {:knx, KNXex.Telegram.t()}.

This producer can also subscribe to GroupAddressServer, which will give you better information about the group address, but less information about the source. However said server uses a different struct and does not emit telegrams. You will receive {:knx_group, GroupAddressData.t()} events in that case.

Link to this function

unsubscribe_from(knx_interface, name_or_pid \\ nil, opts \\ [])

View Source
@spec unsubscribe_from(module(), atom() | pid(), Keyword.t()) :: :ok

Unsubscribes from the given KNX interface. KNX telegrams cannot be received from it anymore.