Skip to content

Commit

Permalink
Bacnet modules doesn't need to be a GenServer
Browse files Browse the repository at this point in the history
  • Loading branch information
abelino committed Sep 1, 2024
1 parent ad175d4 commit 797e765
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
12 changes: 0 additions & 12 deletions lib/bacnet.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ defmodule Bacnet do
BACNet client.
"""

use GenServer

require Logger

@spec start_link(any) :: GenServer.on_start()
def start_link(_opts) do
GenServer.start_link(__MODULE__, nil, name: __MODULE__)
end

@spec add_device(device :: term) :: :ok | {:error, term}
def add_device(device) do
GenServer.call({:global, :bacnetd}, {:add_device, device})
end

@impl GenServer
def init(_) do
{:ok, nil}
end

@doc false
defdelegate ei_log(level, term), to: Logger, as: :log
end
1 change: 0 additions & 1 deletion lib/bacnet/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ defmodule Bacnet.Application do

defp children() do
[
{Bacnet, nil},
{MuonTrap.Daemon, [bacnetd_exec(), bacnetd_args(), []]}
]
end
Expand Down

0 comments on commit 797e765

Please sign in to comment.