All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] atmodem: Handle broken +CMT notifications of some cinterion modems
@ 2018-08-29 14:48 tournier.julien
  2018-08-29 21:12 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: tournier.julien @ 2018-08-29 14:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

From: Julien Tournier <tournier.julien@gmail.com>

Hi Denis,

Here is the fixed patch for the +CMT notification parsing on some cinterion
modems that have a leading coma. I hope i took all your remarks into account


 drivers/atmodem/sms.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

-- 
2.18.0

From 937a78ccdac4975e1a292a8e9259060d2d94adc2 Mon Sep 17 00:00:00 2001
From: Julien Tournier <tournier.julien@gmail.com>
Date: Wed, 29 Aug 2018 15:55:58 +0200
Subject: [PATCH 1/1] atmodem: Handle broken +CMT notifications of some cinterion modems
---
 drivers/atmodem/sms.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
index 68b89862..9c920667 100644
--- a/drivers/atmodem/sms.c
+++ b/drivers/atmodem/sms.c
@@ -412,9 +412,24 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
 
 	switch (data->vendor) {
 	case OFONO_VENDOR_CINTERION:
-		if (!g_at_result_iter_next_number(&iter, &tpdu_len))
-			goto err;
-		break;
+		if (!g_at_result_iter_next_number(&iter, &tpdu_len)) {
+			/*
+			 * On some cinterions modems (ALS3,PLS8...), we can't directly
+			 * get the PDU length, we need to skip the leading coma
+			 *  \r\n+CMT: ,23\r\nCAFECAFECAFE... ...\r\n
+			 *             ^------- PDU length
+			 */
+			DBG("Retrying to find the PDU length");
+
+			if (!g_at_result_iter_skip_next(&iter))
+				goto err;
+
+			/* Next attempt at finding the PDU length. */
+			if (!g_at_result_iter_next_number(&iter, &tpdu_len))
+				goto err;
+		}
+
+ 		break;
 	default:
 		if (!g_at_result_iter_skip_next(&iter))
 			goto err;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] atmodem: Handle broken +CMT notifications of some cinterion modems
  2018-08-29 14:48 [PATCH 0/1] atmodem: Handle broken +CMT notifications of some cinterion modems tournier.julien
@ 2018-08-29 21:12 ` Denis Kenzior
  2018-08-30  7:04   ` Julien Tournier
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2018-08-29 21:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Hi Julien,

On 08/29/2018 09:48 AM, tournier.julien(a)gmail.com wrote:
> From: Julien Tournier <tournier.julien@gmail.com>
> 
> Hi Denis,
> 
> Here is the fixed patch for the +CMT notification parsing on some cinterion
> modems that have a leading coma. I hope i took all your remarks into account
> 
> 
>   drivers/atmodem/sms.c | 21 ++++++++++++++++++---
>   1 file changed, 18 insertions(+), 3 deletions(-)
> 

I reworded the commit description and the comment in the code and 
applied this patch.  Thanks!

Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] atmodem: Handle broken +CMT notifications of some cinterion modems
  2018-08-29 21:12 ` Denis Kenzior
@ 2018-08-30  7:04   ` Julien Tournier
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Tournier @ 2018-08-30  7:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

Thank you Denis,
I'm trying to build up my poor git send-mail skill, so, sorry for my
previous email format.
It was ok when sending it to my gmail account for testing, but was
incorrectly displayed in the mailing list.

Le mer. 29 août 2018 à 23:12, Denis Kenzior <denkenz@gmail.com> a écrit :

> Hi Julien,
>
> On 08/29/2018 09:48 AM, tournier.julien(a)gmail.com wrote:
> > From: Julien Tournier <tournier.julien@gmail.com>
> >
> > Hi Denis,
> >
> > Here is the fixed patch for the +CMT notification parsing on some
> cinterion
> > modems that have a leading coma. I hope i took all your remarks into
> account
> >
> >
> >   drivers/atmodem/sms.c | 21 ++++++++++++++++++---
> >   1 file changed, 18 insertions(+), 3 deletions(-)
> >
>
> I reworded the commit description and the comment in the code and
> applied this patch.  Thanks!
>
> Regards,
> -Denis
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1358 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-30  7:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29 14:48 [PATCH 0/1] atmodem: Handle broken +CMT notifications of some cinterion modems tournier.julien
2018-08-29 21:12 ` Denis Kenzior
2018-08-30  7:04   ` Julien Tournier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.