Re: MNC/MCC as string?

2009-06-12 Thread Denis Kenzior
Hi Aki, > Take two attached. I've pushed the patch out as well as an addendum patch that took care of some new and existing style issues. Also a small fix to the test case as a result of the API changes. Regards, -Denis ___ ofono mailing list ofono

Re: MNC/MCC as string?

2009-06-12 Thread Rémi Denis-Courmont
On Fri, 12 Jun 2009 12:12:33 +0200, Marcel Holtmann wrote: > Hi Aki, > >> Anyway, here it is. Please test; seems to work for me on my N95. > > +static void extract_mcc_mnc(const char *str, char *mcc, char *mnc) > { > - int num = 0; > - unsigned int i; > - > /* Three digit

Re: MNC/MCC as string?

2009-06-12 Thread Aki Niemi
On Fri, 12 Jun 2009 12:12:33 +0200, Marcel Holtmann wrote: > + strncpy(mcc, str, sizeof(mcc)); > + mcc[3] = '\0'; > > maybe I am blind, but how is this suppose to work. The sizeof(mmc) is 1 > byte. Actually, sizeof(mmc) is 4 bytes. Coincidentally, so is the char array in mcc. ;) Tak

Re: MNC/MCC as string?

2009-06-12 Thread Marcel Holtmann
Hi Aki, > Anyway, here it is. Please test; seems to work for me on my N95. +static void extract_mcc_mnc(const char *str, char *mcc, char *mnc) { - int num = 0; - unsigned int i; - /* Three digit country code */ - for (i = 0; i < 3; i++) - num = num * 10 +

Re: MNC/MCC as string?

2009-06-12 Thread Aki Niemi
On Thu, 11 Jun 2009 15:08:08 -0500, Denis Kenzior wrote: >> What part of this is unclear? > > Please submit a patch to the mailing list reflecting how you think it > should be > implemented. If it looks reasonable then I'll integrate it. Uh. You know I am one of the co-maintainers here? ;) An

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Aki, > >> For geolocation help, sure, but there are other places where MNC/MCC are > >> used as keys to databases containing operator-specific information, like > >> default Internet APN names and such. > > > > shouldn't we just integrate that database into oFono directly or as > > something l

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Remi, > > > >> For geolocation help, sure, but there are other places where MNC/MCC > > > >> are used as keys to databases containing operator-specific > > > >> information, like default Internet APN names and such. > > > > > > > > shouldn't we just integrate that database into oFono directly o

Re: MNC/MCC as string?

2009-06-11 Thread Denis Kenzior
Aki, On Thursday 11 June 2009 14:38:49 Aki Niemi wrote: > On Thu, 11 Jun 2009 21:18:02 +0200, Marcel Holtmann > > wrote: > >> However, this wouldn't be the only database ever, so we would still need > >> a > >> way to reliably identify a specific operator. > > > > if we are unclear about the form

Re: MNC/MCC as string?

2009-06-11 Thread Rémi Denis-Courmont
Le jeudi 11 juin 2009 22:18:02 Marcel Holtmann, vous avez écrit : > Hi Aki, > > > >> For geolocation help, sure, but there are other places where MNC/MCC > > >> are used as keys to databases containing operator-specific > > >> information, like default Internet APN names and such. > > > > > > shoul

Re: MNC/MCC as string?

2009-06-11 Thread Aki Niemi
On Thu, 11 Jun 2009 21:18:02 +0200, Marcel Holtmann wrote: >> However, this wouldn't be the only database ever, so we would still need >> a >> way to reliably identify a specific operator. > > if we are unclear about the format and the users at this moment, The format should be 's' in D-Bus and

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Aki, > >> For geolocation help, sure, but there are other places where MNC/MCC are > >> used as keys to databases containing operator-specific information, like > >> default Internet APN names and such. > > > > shouldn't we just integrate that database into oFono directly or as > > something l

Re: MNC/MCC as string?

2009-06-11 Thread Aki Niemi
On Thu, 11 Jun 2009 20:10:27 +0200, Marcel Holtmann wrote: >> For geolocation help, sure, but there are other places where MNC/MCC are >> used as keys to databases containing operator-specific information, like >> default Internet APN names and such. > > shouldn't we just integrate that database

Re: MNC/MCC as string?

2009-06-11 Thread Denis Kenzior
Aki, On Thursday 11 June 2009 13:00:48 Aki Niemi wrote: > On Thu, 11 Jun 2009 09:32:38 -0500, Denis Kenzior > > wrote: > > About the only thing that MCC/MNC is useful for is to display it during > > manual > > operator selection. > > That's not true. In fact, I'd say manual operator selection is

Re: MNC/MCC as string?

2009-06-11 Thread Aki Niemi
On Thu, 11 Jun 2009 13:46:55 +0200, Marcel Holtmann wrote: > That said, we do want some exposure of these values since it is an easy > way to determine geo location help and switch timezones etc. For geolocation, cell ID and LAC are more useful, especially coupled with information on neighborin

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Aki, > > About the only thing that MCC/MNC is useful for is to display it during > > manual > > operator selection. > > That's not true. In fact, I'd say manual operator selection is just about > the last > place where the codes should be displayed. > > > MCC/MNC is not helpful at all for

Re: MNC/MCC as string?

2009-06-11 Thread Aki Niemi
On Thu, 11 Jun 2009 09:32:38 -0500, Denis Kenzior wrote: > About the only thing that MCC/MNC is useful for is to display it during > manual > operator selection. That's not true. In fact, I'd say manual operator selection is just about the last place where the codes should be displayed. > MC

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Denis, > > I wasn't aware of this and so it might be better to just expose these as > > an operator id string. So we might not even split into MCC/MNC at all > > since it is meaning less anyway. > > I'm tending to agree, which is why I wanted to start the conversation. > > By the way, just

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Jan, > > > The attributes are really only for informational purposes only. The > > > user would not base his decision on the mcc/mnc, but on the operator > > > name. > > > > > > So before we start changing the D-Bus APIs, we need to answer these > > > two questions: > > > - Can a country/

Re: MNC/MCC as string?

2009-06-11 Thread Denis Kenzior
Hi Marcel, > I wasn't aware of this and so it might be better to just expose these as > an operator id string. So we might not even split into MCC/MNC at all > since it is meaning less anyway. I'm tending to agree, which is why I wanted to start the conversation. By the way, just so that we're

Re: MNC/MCC as string?

2009-06-11 Thread Jan Luebbe
On Thu, 2009-06-11 at 13:46 +0200, Marcel Holtmann wrote: > Hi Denis, > > > The attributes are really only for informational purposes only. The > > user would not base his decision on the mcc/mnc, but on the operator > > name. > > > > So before we start changing the D-Bus APIs, we need to answ

Re: MNC/MCC as string?

2009-06-11 Thread Marcel Holtmann
Hi Denis, > I understand perfectly. But remember, oFono does not expose the user > to such details. Manual registration is accomplished by using > Register() method (with no arguments) of the NetworkOperator > interface. The internal storage representation is never exposed. > Thus it doesn't ma

Re: MNC/MCC as string?

2009-06-10 Thread Aki Niemi
On Wed, 10 Jun 2009 11:15:19 -0500, Denis Kenzior wrote: > It doesn't seem this clear-cut. E.g. according to my Neo on with T-Mobile > US > SIM: > > AT+COPS? > +COPS: 0,0,"T-Mobile" > OK > AT+COPS=3,2 > OK > AT+COPS? > +COPS: 0,2,"31026" > OK > AT+COPS=2 > OK > +CREG: 0 > AT+COPS=1,2,"31026" >

Re: MNC/MCC as string?

2009-06-10 Thread Denis Kenzior
Hi Remi, Well, the point is that leading zeroes are meaningful (much like with phone > numbers in fact). The API, not just the implementation, must distinguish > network "xy" from network "0xy", so that manual selection remains > unambiguous. > A D-Bus string is probably nicer to use than an integ

Re: MNC/MCC as string?

2009-06-10 Thread Rémi Denis-Courmont
Le mercredi 10 juin 2009 19:15:19 Denis Kenzior, vous avez écrit : > > Nokia modems both send and receive MNC/MCC pairs as Binary Coded Decimal > > (BCD) strings. Any 2 digit MNC is padded with 0xF. Problem is, when > > listing operators, the conversion of MNC codes from BCD to short loses > > this

Re: MNC/MCC as string?

2009-06-10 Thread Denis Kenzior
Aki, On Wednesday 10 June 2009 06:26:07 Aki Niemi wrote: > Hi, > > Currently, the MNC and MCC values are of type short, which is a little > problematic. > > The MNC code can either be 2 or 3 digits, and it would be quite natural to > assume the logic is that 3 digits are used for codes > 99. Howev

MNC/MCC as string?

2009-06-10 Thread Aki Niemi
Hi, Currently, the MNC and MCC values are of type short, which is a little problematic. The MNC code can either be 2 or 3 digits, and it would be quite natural to assume the logic is that 3 digits are used for codes > 99. However, this is not correct -- it depends on the MCC. It seems mostly Am