Skip to contentSkip to conversation

atmodem/sms: no mms support for gemalto

PATCH In review Giacinto Cifelli 2 participants 3 messages Sep 25, 2018 – Sep 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atmodem/sms: no mms support for gemalto

---
 drivers/atmodem/sms.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/atmodem/sms.c +10 -4
index 64169086..64d0f6e8 100644
@@ -219,10 +219,16 @@ static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu,
 	char buf[512];
 	int len;
 
-	if (mms) {
-		snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
-		g_at_chat_send(data->chat, buf, none_prefix,
-				NULL, NULL, NULL);
+	switch(data->vendor) {
+	case OFONO_VENDOR_GEMALTO:
+		break;
+	default:
+		if (mms) {
+			snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
+			g_at_chat_send(data->chat, buf, none_prefix,
+					NULL, NULL, NULL);
+		}
+		break;
 	}
 
 	len = snprintf(buf, sizeof(buf), "AT+CMGS=%d\r", tpdu_len);
Signature · 1 line
2.17.1
#1 lore raw

Hi Giacinto,

Quoted 9 lines · Giacinto Cifelli
---
  drivers/atmodem/sms.c | 14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)
drivers/atmodem/sms.c +0 -0
index 64169086..64d0f6e8 100644

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu, · line 222

Quoted 8 lines
drivers/atmodem/sms.c +1 -4
@@ -219,10 +219,16 @@ static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu,
  	char buf[512];
  	int len;
 
-	if (mms) {
-		snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
-		g_at_chat_send(data->chat, buf, none_prefix,
-				NULL, NULL, NULL);
+	switch(data->vendor) {

Space after switch

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu, · line 232

Quoted 10 lines
drivers/atmodem/sms.c +9 -0
+	case OFONO_VENDOR_GEMALTO:
+		break;
+	default:
+		if (mms) {
+			snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
+			g_at_chat_send(data->chat, buf, none_prefix,
+					NULL, NULL, NULL);
+		}
+		break;
  	}

Hmm, wouldn't this be more logical & readable this way:

if (mms) {
	switch (data->vendor) {
	case:
	default:
	}
}

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu, · line 234

Quoted 3 lines
drivers/atmodem/sms.c +0 -0
  	len = snprintf(buf, sizeof(buf), "AT+CMGS=%d\r", tpdu_len);
 

Regards,
-Denis

#2 lore raw
Quoted 16 lines · On Tue, 25 Sep 2018, 16:49 Denis Kenzior, <[email protected]> wrote:

Hi Giacinto,

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const

Quoted 9 lines · Giacinto Cifelli
---
  drivers/atmodem/sms.c | 14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)
drivers/atmodem/sms.c +0 -0
index 64169086..64d0f6e8 100644
@@ -219,10 +219,16 @@ static void at_cmgs(struct ofono_sms *sms, const

unsigned char *pdu,

Quoted 3 lines
drivers/atmodem/sms.c +0 -0
      char buf[512];
      int len;
 
Quoted 8 lines

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu, · line 222

Quoted 5 lines
drivers/atmodem/sms.c +1 -4
-     if (mms) {
-             snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
-             g_at_chat_send(data->chat, buf, none_prefix,
-                             NULL, NULL, NULL);
+     switch(data->vendor) {

Space after switch

ok. I thought it was after the entire structure, ie, after the closing }.

Quoted 11 lines

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu, · line 232

Quoted 10 lines
drivers/atmodem/sms.c +9 -0
+     case OFONO_VENDOR_GEMALTO:
+             break;
+     default:
+             if (mms) {
+                     snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
+                     g_at_chat_send(data->chat, buf, none_prefix,
+                                     NULL, NULL, NULL);
+             }
+             break;
      }
Quoted 9 lines

Hmm, wouldn't this be more logical & readable this way:

if (mms) {
        switch (data->vendor) {
        case:
        default:
        }
}

that is a good idea. I will change and submit shortly

Quoted 7 lines

drivers/atmodem/sms.c static void at_cmgs(struct ofono_sms *sms, const · line 234

Quoted 3 lines
drivers/atmodem/sms.c +0 -0
      len = snprintf(buf, sizeof(buf), "AT+CMGS=%d\r", tpdu_len);
 

Regards,
-Denis

regards,
Giacinto