[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multipart Messages
From: |
Pavel Machek |
Subject: |
Re: Multipart Messages |
Date: |
Fri, 31 May 2002 11:30:08 +0200 |
User-agent: |
Mutt/1.3.28i |
Hi!
> See these functions from gsm-sms.c:
>
> API GSM_Error SendLongSMS(GSM_Data *data, GSM_Statemachine *state)
> [...]
> count = (rawsms->UserDataLength + 127) / 128;
> printf("Will need %d sms-es\n", count);
> for (i=0; i<count; i++) {
> printf("Sending sms #%d\n", i);
> sms.UserData[0].Type = SMS_MultiData;
> sms.UserData[0].Length = 128;
> if (i+1 == count)
> sms.UserData[0].Length = rawsms->UserDataLength % 128;
> memcpy(sms.UserData[0].u.Multi.Binary, rawsms->UserData +
> i*128, 128);
> sms.UserData[0].u.Multi.this = i+1;
> sms.UserData[0].u.Multi.total = count;
> sms.UserData[1].Type = SMS_NoData;
> data->SMS = &sms;
> error = SendSMS(data, state);
> if (error != GE_NONE) return error;
> }
> return GE_NONE;
> [...]
> API GSM_Error SendSMS(GSM_Data *data, GSM_Statemachine *state)
> [...]
> if (data->RawSMS->Length > 171) {
> printf("SMS is too long? %d\n", data->RawSMS->Length);
> return SendLongSMS(data, state);
> }
> [...]
>
> Please explain:
> - where did you get "171", "127", "128" from?
171 is guessed and likely wrong. 128 is length mygnokii uses, and when
I send such image, nokia phone understands it, so it seems okay. 127
is 128-1 ;-).
> - how do you want to send concatenated messages (plain text
> (default alphabet or unicode) messages with encoded length greater then
> 140 octets, shown by Nokia phones as "Linked #/#"?
I have not experimented with this, yet.
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.