From e047bf6cc80903d8af86f72770f5923c7c8d81ca Mon Sep 17 00:00:00 2001 From: Frank Hunleth Date: Mon, 23 Jan 2023 12:10:31 -0500 Subject: [PATCH] Report more info when QMI goes offline --- lib/vintage_net_qmi/connectivity.ex | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/vintage_net_qmi/connectivity.ex b/lib/vintage_net_qmi/connectivity.ex index 4d97d71..becf7bd 100644 --- a/lib/vintage_net_qmi/connectivity.ex +++ b/lib/vintage_net_qmi/connectivity.ex @@ -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