All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] Support text mode sms sending and receiving
@ 2010-08-24  6:35 Yong Su
  0 siblings, 0 replies; only message in thread
From: Yong Su @ 2010-08-24  6:35 UTC (permalink / raw)
  To: ofono

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

---
 gatchat/gatsyntax.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/gatchat/gatsyntax.c b/gatchat/gatsyntax.c
index 040a9a5..8fa8db4 100644
--- a/gatchat/gatsyntax.c
+++ b/gatchat/gatsyntax.c
@@ -276,8 +276,20 @@ static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax,
 			break;
 
 		case GSM_PERMISSIVE_STATE_GUESS_PDU:
-			if (byte != '\r' && byte != '\n')
+
+			/**
+			 * Modify for SMS text mode, check except message length
+			 * If >= 0, skip expect_msg_len bytes
+			 * If == -1, keep original design
+			 * TODO current GSMV1 syntax can't support
+			 */
+			if (syntax->expect_msg_len == -1) {
+				if (byte != '\r' && byte != '\n')
+					syntax->state = GSM_PERMISSIVE_STATE_PDU;
+			} else {
+				i += syntax->expect_msg_len;
 				syntax->state = GSM_PERMISSIVE_STATE_PDU;
+			}
 			break;
 
 		case GSM_PERMISSIVE_STATE_PDU:
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-24  6:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-24  6:35 [PATCH 3/4] Support text mode sms sending and receiving Yong Su

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.