Skip to content

Commit 388fb0d

Browse files
jjcarstensfhunleth
authored andcommitted
add @impl to DeviceChannel
1 parent d9a56c1 commit 388fb0d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/nerves_hub_link/device_channel.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ defmodule NervesHubLink.DeviceChannel do
3939
GenServer.call(__MODULE__, :connected?)
4040
end
4141

42+
@impl GenServer
4243
def init(opts) do
4344
send(self(), :join)
4445
{:ok, struct(State, opts)}
4546
end
4647

48+
@impl GenServer
4749
def handle_call(:connected?, _from, %{connected?: connected?} = state) do
4850
{:reply, connected?, state}
4951
end
5052

53+
@impl GenServer
5154
def handle_cast({:send_update_progress, progress}, state) do
5255
Channel.push_async(state.channel, "fwup_progress", %{value: progress})
5356
{:noreply, state}
@@ -58,6 +61,7 @@ defmodule NervesHubLink.DeviceChannel do
5861
{:noreply, state}
5962
end
6063

64+
@impl GenServer
6165
def handle_info(%Message{event: "reboot"}, state) do
6266
Logger.warn("Reboot Request from NervesHubLink")
6367
Channel.push_async(state.channel, "rebooting", %{})
@@ -98,6 +102,7 @@ defmodule NervesHubLink.DeviceChannel do
98102
{:noreply, state}
99103
end
100104

105+
@impl GenServer
101106
def terminate(_reason, _state), do: NervesHubLink.Connection.disconnected()
102107

103108
defp handle_join_reply(%{"firmware_url" => _url} = update) do

0 commit comments

Comments
 (0)