From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 01/11] stkutil: Add SMS-PP Data Download envelope builder
Date: Thu, 03 Jun 2010 10:32:52 -0500 [thread overview]
Message-ID: <201006031032.52536.denkenz@gmail.com> (raw)
In-Reply-To: <AANLkTinJEYXi-lWywNEcwo8xufnysHxJEGQL1e4hgeDU@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]
Hi Andrew,
> > - When SMS is delivered, it is delivered in tpdu form, e.g. sc_address +
> > deliver pdu. To obtain the sc_address, we need to decode the deliver
> > tpdu anyway.
> > - Before we know this is an SMS-PP download, we must check the dcs / pid.
> > In order to check those, we must again decode the tpdu.
> > - SMS sc_address can actually be non-numeric. In that case the SMS-PP
> > download should simply be dropped.
>
> This means we have to decode the PDU, but re-encoding it is still an
> overhead having access to the TPDU.
Fair enough, I don't really feel strongly either way. However, encoding is
quite fast and we have to re-encode the sc_address in a different format anyway
because of the weird sc_addr encoding rules.
>
> > - Consistency with Send SMS proactive command.
>
> Ok, makes sense.
One thing that comes to mind is that we might have to modify sms_encode() with
the capability to skip encoding the sc_address field. Otherwise our pdu will
have some extra crap in the beginning.
>
> >> +
> >> +/* Returns TRUE on success */
> >> +ofono_bool_t stk_pdu_from_envelope(const struct stk_envelope *envelope,
> >> + unsigned char *pdu, unsigned int
> >> size, + unsigned char **out_pdu,
> >> + unsigned int *out_size);
> >
> > This part just looks ugly. Can't we hide the details of char buf[512]
> > somewhere inside stk_pdu_from_envelope?
>
> By that do you mean using a static buffer? I'll send a patch for
> that. I prefer a static buffer for the PDUs but thought you had
> argued against it :)
Don't recall :) I think in this case it is ok, or you can always make the
function re-entrant safe by making the buf argument in/out.
e.g.
char buf[512];
char *out = buf;
func(foo, bar, &out);
Regards,
-Denis
next prev parent reply other threads:[~2010-06-03 15:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 12:47 [PATCH 01/11] stkutil: Add SMS-PP Data Download envelope builder Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 02/11] test-stkutil: Tests for " Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 03/11] stkutil: Add CBS-PP " Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 04/11] stk: Use envelope encoding utility from stkutil.c Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 05/11] test-stkutil: Tests for CBS-PP Data Download envelope builder Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 06/11] stkutil: Add the Menu Selection " Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 07/11] test-stkutil: Tests for " Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 08/11] Add a buffer size parameter to convert_utf8_to_gsm Andrzej Zaborowski
2010-06-01 23:50 ` Denis Kenzior
2010-05-31 12:47 ` [PATCH 09/11] Add a "sim string" encoding utility Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 10/11] stkutil: Add the Call Control envelope builder Andrzej Zaborowski
2010-06-01 22:28 ` Andrzej Zaborowski
2010-05-31 12:47 ` [PATCH 11/11] test-stkutil: Tests for " Andrzej Zaborowski
2010-06-01 23:50 ` [PATCH 01/11] stkutil: Add SMS-PP Data Download " Denis Kenzior
2010-06-03 9:53 ` Andrzej Zaborowski
2010-06-03 15:32 ` Denis Kenzior [this message]
2010-06-07 13:25 ` Andrzej Zaborowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006031032.52536.denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox