File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,18 @@ defmodule NervesHubLink.DeviceChannel do
39
39
GenServer . call ( __MODULE__ , :connected? )
40
40
end
41
41
42
+ @ impl GenServer
42
43
def init ( opts ) do
43
44
send ( self ( ) , :join )
44
45
{ :ok , struct ( State , opts ) }
45
46
end
46
47
48
+ @ impl GenServer
47
49
def handle_call ( :connected? , _from , % { connected?: connected? } = state ) do
48
50
{ :reply , connected? , state }
49
51
end
50
52
53
+ @ impl GenServer
51
54
def handle_cast ( { :send_update_progress , progress } , state ) do
52
55
Channel . push_async ( state . channel , "fwup_progress" , % { value: progress } )
53
56
{ :noreply , state }
@@ -58,6 +61,7 @@ defmodule NervesHubLink.DeviceChannel do
58
61
{ :noreply , state }
59
62
end
60
63
64
+ @ impl GenServer
61
65
def handle_info ( % Message { event: "reboot" } , state ) do
62
66
Logger . warn ( "Reboot Request from NervesHubLink" )
63
67
Channel . push_async ( state . channel , "rebooting" , % { } )
@@ -98,6 +102,7 @@ defmodule NervesHubLink.DeviceChannel do
98
102
{ :noreply , state }
99
103
end
100
104
105
+ @ impl GenServer
101
106
def terminate ( _reason , _state ) , do: NervesHubLink.Connection . disconnected ( )
102
107
103
108
defp handle_join_reply ( % { "firmware_url" => _url } = update ) do
You can’t perform that action at this time.
0 commit comments