Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] Present list of preferred languages on SimManager interface.
Date: Mon, 14 Sep 2009 11:06:47 -0500	[thread overview]
Message-ID: <200909141106.48522.denkenz@gmail.com> (raw)
In-Reply-To: <1252946269-5745-1-git-send-email-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3248 bytes --]

Hi Andrew,

> It does not look like the list can be used directly for filtering CBs
> because for that, the ME should choose one language, if there is one
> that is supported by the UI (aka MMI).

It actually can, since the preferred language list for cell broadcasts can be 
of any length...

And now for some nitpicks:

> +static int parse_language_list(char **out_list, const unsigned char
> *sim_list, +				int length)
> +{
> +	unsigned char code[3];
> +	int count, i;
> +	long written;
> +
> +	count = 0;
> +	length--;
> +
> +	for (i = 0; i < length; i += 2) {
> +		code[0] = sim_list[i + 0];
> +		code[1] = sim_list[i + 1];
> +		code[2] = 0;
> +
> +		if (code[0] == 0xff || code[1] == 0xff)
> +			continue;
> +
> +		out_list[count] = convert_gsm_to_utf8(code, 2,
> +							NULL, &written, 0);

Lets skip the gsm conversion.  The ISO639 standard only uses latin characters 
which are guaranteed to be the same between utf8 / gsm.

> +static void sim_efpl_read_cb(int ok,
> +				enum ofono_sim_file_structure structure,
> +				int length, int record,
> +				const unsigned char *data,
> +				int record_length, void *userdata)
> +{
> +	struct ofono_sim *sim = userdata;
> +	unsigned char *efli = sim->efli;
> +	const unsigned char *efpl = data;
> +	int efli_length = sim->efli_length;
> +	int efpl_length = length;
> +	int count;
> +	const char *path = __ofono_atom_get_path(sim->atom);
> +	DBusConnection *conn = ofono_dbus_get_connection();
> +
> +	if (!ok || structure != OFONO_SIM_FILE_STRUCTURE_TRANSPARENT)
> +		efpl = NULL;
> +
> +	if (length < 2)
> +		efpl = NULL;
> +
> +	sim->language_prefs = g_malloc(((efli_length + efpl_length) / 2 + 1) *
> +			sizeof(char *));
> +
> +	count = 0;
> +
> +	/* Make a list of languages in both files in order of preferences
> +	 * following 31.102.
> +	 */
> +
> +	if (efli && efpl && efli[0] == 0xff && efli[1] == 0xff) {
> +		count += parse_language_list(sim->language_prefs + count,
> +						efpl, efpl_length);
> +		efpl = NULL;
> +	}
> +
> +	if (efli) {
> +		count += parse_language_list(sim->language_prefs + count,
> +						efli, efli_length);
> +		g_free(efli);
> +		sim->efli = NULL;
> +	}
> +
> +	if (efpl)
> +		count += parse_language_list(sim->language_prefs + count,
> +						efpl, efpl_length);

If we're going down the path of preserving both EFli and EFpl, then you should 
make sure no duplicates exist. Alternatively we can assume that oFono/UI will 
support all languages and simply not read EFpl if there is useable information 
in EFli.

> +static void sim_retrieve_efli(struct ofono_sim *sim)
> +{
> +	/* According to 31.102 the EFli is read first and EFpl is then
> +	 * only read if none of the EFli languages are supported by user
> +	 * interface.  51.011 mandates the exact opposite, making EFpl/EFelp
> +	 * preferred over EFlp (same ID as EFli, different format).
> +	 * However we don't depend on the user interface and so
> +	 * need to read both files now.
> +	 */
> +	ofono_sim_read(sim, SIM_EFLI_FILEID, sim_efli_read_cb, sim);
> +	ofono_sim_read(sim, SIM_EFPL_FILEID, sim_efpl_read_cb, sim);

Strictly speaking 31.101 & 31.102 supersede 51.011.

Regards,
-Denis

  reply	other threads:[~2009-09-14 16:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 16:37 [PATCH] Present list of preferred languages on SimManager interface Andrzej Zaborowski
2009-09-14 16:06 ` Denis Kenzior [this message]
2009-09-14 17:33   ` Andrzej Zaborowski
2009-09-16 12:54     ` Andrzej Zaborowski
2009-09-17 18:49       ` Andrzej Zaborowski
2009-09-17 19:50         ` Denis Kenzior
2009-09-23 20:52           ` andrzej zaborowski
2009-09-23 20:05             ` Denis Kenzior
2009-09-23 22:01               ` andrzej zaborowski
2009-09-23 22:30                 ` Denis Kenzior
2009-09-25 18:56                   ` andrzej zaborowski
2009-09-28 18:29                     ` Denis Kenzior

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=200909141106.48522.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