diff mbox series

[05/10] sim7100: fix going offline for A76XX modems

Message ID 20240430115234.180185-5-martin@geanix.com (mailing list archive)
State Accepted
Commit cbafc2eaf6def5dc3ee50ae70cfb961b8f748eab
Headers show
Series [01/10] sim7100: simplify serial device opening | expand

Commit Message

Martin Hundebøll April 30, 2024, 11:52 a.m. UTC
When tearing down the PPP context, the SIMCom A7672 modem issues a NO
CARRIER event on the control channel, which is detected as an error when
processing the AT+CFUN=4 respones.

Make the set_online(false) call succed by ignoring the NO CARRIER event.
---
 plugins/sim7100.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/plugins/sim7100.c b/plugins/sim7100.c
index f4979ffe..2e9d0eb3 100644
--- a/plugins/sim7100.c
+++ b/plugins/sim7100.c
@@ -151,6 +151,16 @@  static void cgmm_cb(gboolean ok, GAtResult *result, gpointer user_data)
 		break;
 	}
 
+	switch (data->model) {
+	case SIMCOM_A76XX:
+		/* ignore NO CARRIER on the AT channel when disconnecting PPP */
+		g_at_chat_blacklist_terminator(data->at,
+					G_AT_CHAT_TERMINATOR_NO_CARRIER);
+		break;
+	default:
+		break;
+	}
+
 	/* power up modem */
 	g_at_chat_send(data->at, "AT+CFUN=4", NULL, cfun_set_on_cb, modem,
 									NULL);