summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/gsm/files/0005-Add-ask-ds-option-forSMS.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/gsm/files/0005-Add-ask-ds-option-forSMS.patch')
-rw-r--r--meta/recipes-connectivity/gsm/files/0005-Add-ask-ds-option-forSMS.patch130
1 files changed, 130 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/gsm/files/0005-Add-ask-ds-option-forSMS.patch b/meta/recipes-connectivity/gsm/files/0005-Add-ask-ds-option-forSMS.patch
new file mode 100644
index 0000000000..e9f49bd7d2
--- /dev/null
+++ b/meta/recipes-connectivity/gsm/files/0005-Add-ask-ds-option-forSMS.patch
@@ -0,0 +1,130 @@
1diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h
2index 236ad78..66cdf48 100644
3--- a/include/gsmd/usock.h
4+++ b/include/gsmd/usock.h
5@@ -332,6 +332,7 @@ struct gsmd_sms {
6 struct gsmd_sms_submit {
7 struct gsmd_addr addr;
8 struct gsmd_sms payload;
9+ int ask_ds;
10 };
11
12 /* Refer to GSM 07.05 subclause 4.4 */
13diff --git a/include/libgsmd/sms.h b/include/libgsmd/sms.h
14index 3ada62d..9808442 100644
15--- a/include/libgsmd/sms.h
16+++ b/include/libgsmd/sms.h
17@@ -46,6 +46,7 @@ struct lgsm_sms {
18 enum gsmd_sms_alphabet alpha;
19 u_int8_t data[LGSM_SMS_DATA_MAXLEN+1];
20 int length;
21+ int ask_ds;
22 };
23
24 /* GSM 03.40 subclause 9.2.2.2 and GSM 07.05 subclause 4.4 and subclause 3.1 */
25diff --git a/src/gsmd/sms_pdu.c b/src/gsmd/sms_pdu.c
26index d1235dd..d461999 100644
27--- a/src/gsmd/sms_pdu.c
28+++ b/src/gsmd/sms_pdu.c
29@@ -247,7 +247,8 @@ int sms_pdu_make_smssubmit(char *dest, const struct gsmd_sms_submit *src)
30 GSMD_SMS_TP_MTI_SUBMIT |
31 (0 << 2) | /* Reject Duplicates: 0 */
32 GSMD_SMS_TP_VPF_NOT_PRESENT |
33- GSMD_SMS_TP_SRR_STATUS_REQUEST |
34+ (src->ask_ds ? GSMD_SMS_TP_SRR_STATUS_REQUEST :
35+ GSMD_SMS_TP_SRR_NOT_REQUEST) |
36 (src->payload.has_header ? GSMD_SMS_TP_UDHI_WITH_HEADER :
37 GSMD_SMS_TP_UDHI_NO_HEADER) |
38 GSMD_SMS_TP_RP_NOT_SET;
39diff --git a/src/libgsmd/libgsmd_sms.c b/src/libgsmd/libgsmd_sms.c
40index 22d7dbf..bbc8689 100644
41--- a/src/libgsmd/libgsmd_sms.c
42+++ b/src/libgsmd/libgsmd_sms.c
43@@ -126,6 +126,7 @@ int lgsm_sms_send(struct lgsm_handle *lh,
44 if (lgsm_number2addr(&gss->addr, sms->addr, 1))
45 return -EINVAL;
46
47+ gss->ask_ds = sms->ask_ds;
48 gss->payload.has_header = 0;
49 gss->payload.length = sms->length;
50 gss->payload.coding_scheme = sms->alpha;
51@@ -161,6 +162,7 @@ int lgsm_sms_write(struct lgsm_handle *lh,
52 if (lgsm_number2addr(&gsw->sms.addr, sms_write->sms.addr, 1))
53 return -EINVAL;
54
55+ gsw->sms.ask_ds = sms_write->sms.ask_ds;
56 gsw->sms.payload.has_header = 0;
57 gsw->sms.payload.length = sms_write->sms.length;
58 gsw->sms.payload.coding_scheme = sms_write->sms.alpha;
59diff --git a/src/util/shell.c b/src/util/shell.c
60index f902126..f26e17e 100644
61--- a/src/util/shell.c
62+++ b/src/util/shell.c
63@@ -355,7 +355,7 @@ static int shell_help(void)
64 "\tsd\tSMS Delete (sd=index,delflg)\n"
65 "\tsl\tSMS List (sl=stat)\n"
66 "\tsr\tSMS Read (sr=index)\n"
67- "\tss\tSMS Send (ss=number,text|[\"text\"])\n"
68+ "\tss\tSMS Send (ss=ask_ds,number,text|[\"text\"])\n"
69 "\tsw\tSMS Write (sw=stat,number,text)\n"
70 "\tsm\tSMS Storage stats\n"
71 "\tsM\tSMS Set preferred storage (sM=mem1,mem2,mem3)\n"
72@@ -563,33 +563,29 @@ int shell_main(struct lgsm_handle *lgsmh)
73 struct lgsm_sms sms;
74
75 ptr = strchr(buf, '=');
76+ sms.ask_ds = atoi(ptr+1);
77 fcomma = strchr(buf, ',');
78- if (!ptr || !fcomma) {
79- printf("Wrong command format\n");
80- } else {
81- strncpy(sms.addr, ptr+1, fcomma-ptr-1);
82- sms.addr[fcomma-ptr-1] = '\0';
83-
84- /* todo define \" to allow " in text */
85- if (fcomma[1] == '"' &&
86- !strchr(fcomma+2, '"')) {
87+ lcomma = strchr(fcomma+1, ',');
88+ strncpy(sms.addr, fcomma+1, lcomma-fcomma-1);
89+ sms.addr[lcomma-fcomma-1] = '\0';
90+ /* todo define \" to allow " in text */
91+ if (lcomma[1]=='"' &&
92+ !strchr(lcomma+2, '"')) {
93 /* read until closing '"' */
94 rc = fscanf(stdin, "%[^\"]\"",
95- fcomma+strlen(fcomma));
96+ lcomma+strlen(lcomma));
97 if (rc == EOF) {
98 printf("EOF\n");
99 return -1;
100 }
101 /* remove brackets */
102- fcomma++;
103- fcomma[strlen(fcomma)] = '\0';
104- }
105-
106- printf("Send SMS\n");
107- packing_7bit_character(fcomma+1, &sms);
108+ lcomma++;
109+ lcomma[strlen(lcomma)] = '\0';
110+ }
111+ printf("Send SMS\n");
112+ packing_7bit_character(lcomma+1, &sms);
113
114- lgsm_sms_send(lgsmh, &sms);
115- }
116+ lgsm_sms_send(lgsmh, &sms);
117 } else if ( !strncmp(buf, "sw", 2)) {
118 printf("Write SMS\n");
119 struct lgsm_sms_write sms_write;
120@@ -603,6 +599,7 @@ int shell_main(struct lgsm_handle *lgsmh)
121 sms_write.sms.addr[lcomma-fcomma-1] = '\0';
122 packing_7bit_character(
123 lcomma+1, &sms_write.sms);
124+ sms_write.sms.ask_ds = 0;
125
126 lgsm_sms_write(lgsmh, &sms_write);
127 } else if (!strncmp(buf, "sm", 2)) {
128--
1291.5.2.1
130