From 377a33730d964a2854f519a95dde172d2ba4e2f5 Mon Sep 17 00:00:00 2001 From: Nicholas Smith Date: Fri, 10 Jul 2020 20:25:42 +1000 Subject: [PATCH] modemmanager: add error message notifications to proto handler Signed-off-by: Nicholas Smith --- net/modemmanager/Makefile | 2 +- net/modemmanager/files/modemmanager.proto | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index 5bd64bde8..9f1d33317 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=modemmanager PKG_VERSION:=1.14.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=ModemManager-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://www.freedesktop.org/software/ModemManager diff --git a/net/modemmanager/files/modemmanager.proto b/net/modemmanager/files/modemmanager.proto index 2e95d1e57..07147b1f3 100755 --- a/net/modemmanager/files/modemmanager.proto +++ b/net/modemmanager/files/modemmanager.proto @@ -327,6 +327,7 @@ modemmanager_disconnected_method_common() { local interface="$1" echo "running disconnection (common)" + proto_notify_error "${interface}" MM_DISCONNECT_IN_PROGRESS proto_init_update "*" 0 proto_send_update "${interface}" @@ -393,9 +394,11 @@ proto_modemmanager_setup() { # setup connect args; APN mandatory (even if it may be empty) echo "starting connection with apn '${apn}'..." + proto_notify_error "${interface}" MM_CONNECT_IN_PROGRESS + connectargs="apn=${apn}${iptype:+,ip-type=${iptype}}${cliauth:+,allowed-auth=${cliauth}}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}" mmcli --modem="${device}" --timeout 120 --simple-connect="${connectargs}" || { - proto_notify_error "${interface}" CONNECT_FAILED + proto_notify_error "${interface}" MM_CONNECT_FAILED proto_block_restart "${interface}" return 1 } @@ -497,6 +500,7 @@ proto_modemmanager_teardown() { json_get_vars device lowpower iptype echo "stopping network" + proto_notify_error "${interface}" MM_TEARDOWN_IN_PROGRESS # load connected bearer information, just the first one should be ok modemstatus=$(mmcli --modem="${device}" --output-keyvalue) @@ -525,6 +529,7 @@ proto_modemmanager_teardown() { # disable mmcli --modem="${device}" --disable + proto_notify_error "${interface}" MM_MODEM_DISABLED # low power, only if requested [ "${lowpower:-0}" -lt 1 ] ||