diff options
Diffstat (limited to 'meta/recipes-connectivity/gsm/files/025_sms-status-report.patch')
-rw-r--r-- | meta/recipes-connectivity/gsm/files/025_sms-status-report.patch | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/meta/recipes-connectivity/gsm/files/025_sms-status-report.patch b/meta/recipes-connectivity/gsm/files/025_sms-status-report.patch deleted file mode 100644 index a0f466a00e..0000000000 --- a/meta/recipes-connectivity/gsm/files/025_sms-status-report.patch +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | Upstream-Status: Inappropriate [not used] | ||
2 | |||
3 | From: Erin Yueh <erin_yueh@openmoko.com> | ||
4 | Subject: [PATCH] SMS status report | ||
5 | |||
6 | I made a patch for SMS status report. It can change SMS-Submit messages | ||
7 | and ask for a status report. When the destination address receives our | ||
8 | message, the service center will send a SMS-STATUS-REPORT to us. We can | ||
9 | tell what messages we sent by TP-MR (message reference number) value and | ||
10 | can know the sending result by TP-ST (Status) value from status report | ||
11 | messages. | ||
12 | |||
13 | PS. if you don't want to ask a status report, you can change this value | ||
14 | back. Replace "GSMD_SMS_TP_SRR_STATUS_REQUEST" with | ||
15 | "GSMD_SMS_TP_SRR_NOT_REQUEST". | ||
16 | header[pos ++] = | ||
17 | GSMD_SMS_TP_MTI_SUBMIT | | ||
18 | (0 << 2) | /* Reject Duplicates: 0 */ | ||
19 | GSMD_SMS_TP_VPF_NOT_PRESENT | | ||
20 | - GSMD_SMS_TP_SRR_NOT_REQUEST | | ||
21 | + GSMD_SMS_TP_SRR_STATUS_REQUEST | | ||
22 | (src->payload.has_header ? GSMD_SMS_TP_UDHI_WITH_HEADER : | ||
23 | GSMD_SMS_TP_UDHI_NO_HEADER) | | ||
24 | GSMD_SMS_TP_RP_NOT_SET; | ||
25 | |||
26 | Signed-off-by: Jim Huang <jserv@openmoko.org> | ||
27 | --- | ||
28 | src/gsmd/sms_pdu.c | 54 +++++++++++++++++++++++++++++++++++++++++++----------- | ||
29 | src/util/event.c | 6 +++++- | ||
30 | 2 files changed, 48 insertions(+), 12 deletions(-) | ||
31 | |||
32 | Index: gsm/src/gsmd/sms_pdu.c | ||
33 | =================================================================== | ||
34 | --- gsm.orig/src/gsmd/sms_pdu.c 2007-09-06 11:14:34.000000000 +0800 | ||
35 | +++ gsm/src/gsmd/sms_pdu.c 2007-09-17 23:39:20.000000000 +0800 | ||
36 | @@ -139,6 +139,17 @@ | ||
37 | /* Skip TP-PID */ | ||
38 | len -= 9; | ||
39 | src += 9; | ||
40 | + | ||
41 | + /* TP-UDL */ | ||
42 | + dst->payload.length = src[0]; | ||
43 | + i = sms_data_bytelen(dst->payload.coding_scheme, src[0]); | ||
44 | + | ||
45 | + /* TP-UD */ | ||
46 | + if (len < 1 + i || i > GSMD_SMS_DATA_MAXLEN) | ||
47 | + return 1; | ||
48 | + memcpy(dst->payload.data, src + 1, i); | ||
49 | + dst->payload.data[i] = 0; | ||
50 | + | ||
51 | break; | ||
52 | case GSMD_SMS_TP_MTI_SUBMIT: | ||
53 | if (len < 4) | ||
54 | @@ -179,23 +190,44 @@ | ||
55 | src += vpf ? 3 : 2; | ||
56 | |||
57 | memset(dst->time_stamp, 0, 7); | ||
58 | + | ||
59 | + /* TP-UDL */ | ||
60 | + dst->payload.length = src[0]; | ||
61 | + i = sms_data_bytelen(dst->payload.coding_scheme, src[0]); | ||
62 | + | ||
63 | + /* TP-UD */ | ||
64 | + if (len < 1 + i || i > GSMD_SMS_DATA_MAXLEN) | ||
65 | + return 1; | ||
66 | + memcpy(dst->payload.data, src + 1, i); | ||
67 | + dst->payload.data[i] = 0; | ||
68 | break; | ||
69 | case GSMD_SMS_TP_MTI_STATUS_REPORT: | ||
70 | - /* TODO */ | ||
71 | + if (len < 3) | ||
72 | + return 1; | ||
73 | + | ||
74 | + /* TP-MR set it gsmd_sms_list.index*/ | ||
75 | + dst->index = (int) src[1]; | ||
76 | + /* TP-STATUS set it to coding_scheme */ | ||
77 | + dst->payload.coding_scheme = (int) src[len-1]; | ||
78 | + /* TP-RA */ | ||
79 | + i = sms_number_bytelen(src[3], src[2]); | ||
80 | + if (len < 13 + i) | ||
81 | + return 1; | ||
82 | + if (sms_address2ascii(&dst->addr, src + 2)) | ||
83 | + return 1; | ||
84 | + len -= 4 + i; | ||
85 | + src += 4 + i; | ||
86 | + /* TP-SCTS */ | ||
87 | + memcpy(dst->time_stamp, src, 7); | ||
88 | + /* TP-UD */ | ||
89 | + dst->payload.length = 0; | ||
90 | + dst->payload.data[0] = 0; | ||
91 | + break; | ||
92 | default: | ||
93 | /* Unknown PDU type */ | ||
94 | return 1; | ||
95 | } | ||
96 | |||
97 | - /* TP-UDL */ | ||
98 | - dst->payload.length = src[0]; | ||
99 | - i = sms_data_bytelen(dst->payload.coding_scheme, src[0]); | ||
100 | - | ||
101 | - /* TP-UD */ | ||
102 | - if (len < 1 + i || i > GSMD_SMS_DATA_MAXLEN) | ||
103 | - return 1; | ||
104 | - memcpy(dst->payload.data, src + 1, i); | ||
105 | - dst->payload.data[i] = 0; | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | @@ -215,7 +247,7 @@ | ||
110 | GSMD_SMS_TP_MTI_SUBMIT | | ||
111 | (0 << 2) | /* Reject Duplicates: 0 */ | ||
112 | GSMD_SMS_TP_VPF_NOT_PRESENT | | ||
113 | - GSMD_SMS_TP_SRR_NOT_REQUEST | | ||
114 | + GSMD_SMS_TP_SRR_STATUS_REQUEST | | ||
115 | (src->payload.has_header ? GSMD_SMS_TP_UDHI_WITH_HEADER : | ||
116 | GSMD_SMS_TP_UDHI_NO_HEADER) | | ||
117 | GSMD_SMS_TP_RP_NOT_SET; | ||
118 | Index: gsm/src/util/event.c | ||
119 | =================================================================== | ||
120 | --- gsm.orig/src/util/event.c 2007-09-06 11:14:34.000000000 +0800 | ||
121 | +++ gsm/src/util/event.c 2007-09-17 23:39:47.000000000 +0800 | ||
122 | @@ -128,8 +128,12 @@ | ||
123 | static int inds_handler(struct lgsm_handle *lh, int evt, | ||
124 | struct gsmd_evt_auxdata *aux) | ||
125 | { | ||
126 | - if (aux->u.ds.inlined) | ||
127 | + if (aux->u.ds.inlined) { | ||
128 | + struct gsmd_sms_list *sms; | ||
129 | + sms = (struct gsmd_sms_list *) aux->data; | ||
130 | printf("EVENT: Incoming Status Report\n"); | ||
131 | + printf("message ref = %d, status = %d\n", sms->index,sms->payload.coding_scheme); | ||
132 | + } | ||
133 | else | ||
134 | printf("EVENT: Incoming Status Report stored at location %i\n", | ||
135 | aux->u.ds.index); | ||