[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnokii/common gsm-sms.c,1.139,1.140
From: |
Pawel Kot <address@hidden> |
Subject: |
gnokii/common gsm-sms.c,1.139,1.140 |
Date: |
Wed, 08 Oct 2003 16:24:08 +0000 |
Update of /cvsroot/gnokii/gnokii/common
In directory subversions:/tmp/cvs-serv6908/common
Modified Files:
gsm-sms.c
Log Message:
Fix concatenated sms support for unicode sms
Index: gsm-sms.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/gsm-sms.c,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -d -r1.139 -r1.140
*** gsm-sms.c 22 Aug 2003 10:34:48 -0000 1.139
--- gsm-sms.c 8 Oct 2003 16:24:04 -0000 1.140
***************
*** 1240,1246 ****
}
- #ifdef DEBUG
static void sms_dump_raw(gn_sms_raw *rawsms)
{
char buf[10240];
--- 1240,1246 ----
}
static void sms_dump_raw(gn_sms_raw *rawsms)
{
+ #ifdef DEBUG
char buf[10240];
***************
*** 1253,1260 ****
bin2hex(buf, rawsms->user_data, rawsms->user_data_length);
dprintf("user_data: %s\n", buf);
- }
- #else
- static void sms_dump_raw(gn_sms_raw *rawsms) {}
#endif
static gn_error sms_send_long(gn_data *data, struct gn_statemachine *state);
--- 1253,1258 ----
bin2hex(buf, rawsms->user_data, rawsms->user_data_length);
dprintf("user_data: %s\n", buf);
#endif
+ }
static gn_error sms_send_long(gn_data *data, struct gn_statemachine *state);
***************
*** 1291,1295 ****
sms_dump_raw(data->raw_sms);
if (data->raw_sms->user_data_length > MAX_SMS_PART) {
! dprintf("SMS is too long? %d\n", data->raw_sms->length);
error = sms_send_long(data, state);
goto cleanup;
--- 1289,1294 ----
sms_dump_raw(data->raw_sms);
if (data->raw_sms->user_data_length > MAX_SMS_PART) {
! dprintf("SMS is too long? %d\n",
data->raw_sms->user_data_length);
! sleep(5);
error = sms_send_long(data, state);
goto cleanup;
***************
*** 1336,1339 ****
--- 1335,1341 ----
total += ((data->sms->udh.length+1) % 8 +
data->sms->user_data[i].length) * 7 / 8;
break;
+ case GN_SMS_DCS_UCS2:
+ total += (data->sms->user_data[i].length * 2);
+ break;
default:
total += data->sms->user_data[i].length;
***************
*** 1362,1365 ****
--- 1364,1384 ----
if (copied == 0)
copied = ((MAX_SMS_PART -
(data->sms->udh.length+1)) * 8 / 7);
+ memset(&data->sms->user_data[0], 0,
sizeof(gn_sms_user_data));
+ data->sms->user_data[0].type = ud[0].type;
+ data->sms->user_data[0].length = copied;
+ memcpy(data->sms->user_data[0].u.text,
ud[0].u.text+start, copied);
+ break;
+ case GN_SMS_DCS_UCS2:
+ start += copied;
+ copied = (ud[0].length - start) % ((MAX_SMS_PART -
(data->sms->udh.length+1)));
+ if (copied == 0)
+ copied = (MAX_SMS_PART -
(data->sms->udh.length+1));
+ if (copied > (MAX_SMS_PART - (data->sms->udh.length+1))
/ 2) {
+ copied = copied / 2;
+ if (copied < (MAX_SMS_PART -
(data->sms->udh.length+1)) / 2)
+ copied = (MAX_SMS_PART -
(data->sms->udh.length+1)) / 2;
+
+ }
+ dprintf("%d\n", copied);
memset(&data->sms->user_data[0], 0,
sizeof(gn_sms_user_data));
data->sms->user_data[0].type = ud[0].type;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnokii/common gsm-sms.c,1.139,1.140,
Pawel Kot <address@hidden> <=