Re: [MM 0.6] Plumb up the SPN display-rule bits
- From: Aleksander Morgado <aleksander lanedo com>
- To: Nathan Williams <njw google com>
- Cc: networkmanager-list gnome org
- Subject: Re: [MM 0.6] Plumb up the SPN display-rule bits
- Date: Fri, 09 Mar 2012 14:19:47 +0100
Hey Nathan,
> Also, if we do expose these two properties we also need to load and
> expose the SPDI network list, or the properties will be useless.
>
>
> Here's a patch to do that. There's a bit of annoying fighting with gchar
> ** and gdbus's idea of constness, but it seems reasonable otherwise.
> It works for me on SIMs with no SPDI information at all and on those
> with extant empty lists; I'd appreciate a test on a SIM known to have a
> non-empty list.
>
The command to get the SPDI in the code didn't work for me:
--> AT+CRSM=176,28621,0,0,255
<-- +CRSM: 103,0
OK
I can get the SPDI list here (Cinterion modem) using a shorter length to
read, even if it's not the exact one; so instead of 255 I can use 60,
40, 30, 15... If I modify that in the code:
--> AT+CRSM=176,28621,0,0,15
<-- +CRSM: 144,0,A308800612F41012F470FFFFFFFFFF
OK
With that change on, the list is properly parsed:
$ mmcli -i 0
SIM '/org/freedesktop/ModemManager1/SIM/0'
-------------------------
Properties | imsi : '214040106373910'
| id : '8934041110059281105'
| operator id : '21404'
| operator name : 'Yoigo'
| operator SPDI list : '21401,21407'
| show PLMN at home : no
| show op name roaming : no
My operator is Yoigo (21404), and I get 2 operators in the SPDI list:
21401 (Vodafone) and 21407 (Movistar). But, I'm not sure about the
flags, I believe I should have gotten a 'yes' in 'show PLMN at home',
will check that later.
A possible fix to handle the case where we don't know how much we can
read would be to try to read the first bytes of the record (3 or 4 or 5
just in case) to get the full record length of the record, assuming 1-3
bytes max for the size field, so we read "A3" + size encoded in 1 or 2
or 3 bytes + "80"); and once we know the whole record size, read the
exact list size.
Don't know, but that very first read may fail I guess, if an empty SPDI
list is found (not sure if that will be "A3028000" or "A300") and we try
to read more than that and the modem doesn't allow it.
---
And a side note; it seems that the SIM initialization sequence is not
properly run after getting SIM-PIN unlocked, will take care of that myself.
--
Aleksander
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]