[PATCH] huawei: fix ^ICCID parsing

Dan Williams dcbw at redhat.com
Wed Sep 25 09:36:18 PDT 2013


On Wed, 2013-09-25 at 09:08 -0700, Ben Chan wrote:
> On Wed, Sep 25, 2013 at 7:09 AM, Aleksander Morgado
> <aleksander at lanedo.com> wrote:
> > On 09/25/2013 02:56 PM, Dan Williams wrote:
> >>> Seems like some modems swap digits in ^ICCID response and some don't.
> >>> > We may need to compute the check digit to determine which format to
> >>> > use.
> >> Ben and I talked about this yesterday; every Huawei modem I have, from
> >> the E160g (really old) to a new E397 (recent) swaps the digits in the
> >> ^ICCID response.  These are all Qualcomm-based devices.
> >>
> >> But I think the E3xxx devices are HiSilicon-based devices, not Qualcomm
> >> ones.  Which would mean completely different firmware, and probably a
> >> completely different team, which probably interpreted the ICCID command
> >> specs completely differently (if there were any).  Not sure about the
> >> MU736 though.
> >
> > Using the checksum in the ICCID would be a good way, and easy to
> > implement I guess. Another option would be to just check the first two
> > digits to see if they're 89 or 98 :) '89' is the ISO 7812 Major Industry
> > Identifier for telecomm purposes. Have you guys ever seen a ICCID in a
> > SIM card not starting with 89?
> 
> Dan, that's an interesting observation. All the modems I've tested so
> far are non-Qualcomm based. I'll test a Qualcomm-based modem today.
> 
> Regarding the check digit approach, it may depend on the SIM issuers.
> Some ICCIDs have 19+1 digits or 18+1 digits. Some may not have the
> check digit?

As far as I know, they have to have the check digit...

But here's why we want ^ICCID:

at+CRSM=176,12258,0,0,10
+CME ERROR: SIM PIN required
at^iccid?
^iccid: "9810xxxxxxxxxxxxxxxx"
OK

Not having to unlock the modem before getting the ICCID means that
userspace can use the SimIdentifier property to retrieve the right PIN
for auto-unlock or other operations.

Dan



More information about the ModemManager-devel mailing list