Skip to content

Commit

Permalink
Report more info when QMI goes offline
Browse files Browse the repository at this point in the history
  • Loading branch information
fhunleth committed Jan 23, 2023
1 parent 00f57f2 commit e047bf6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/vintage_net_qmi/connectivity.ex
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,22 @@ defmodule VintageNetQMI.Connectivity do
packet_data_connection: :connected
} = state
) do
RouteManager.set_connection_status(state.ifname, :internet)
RouteManager.set_connection_status(
state.ifname,
:internet,
"QMI reports Internet-connectivity"
)

%{state | cached_status: :internet}
end

defp update_connection_status(%{cached_status: :internet} = state) do
RouteManager.set_connection_status(state.ifname, :disconnected)
RouteManager.set_connection_status(
state.ifname,
:disconnected,
"QMI(lan?=#{state.lan?},serving_system?=#{state.serving_system?},ip?=#{state.ip_address?},packet_data=#{state.packet_data_connection}"
)

%{state | cached_status: :disconnected}
end

Expand Down

0 comments on commit e047bf6

Please sign in to comment.