How to get ICCID for EM7565 using Linux QMI SDK api function

Hello,

We are using EM7565 modem, and Linux QMI SDK (slqssdk) version 4.00.11.
We are not able to use SDK api function “UIMGetICCID” to get ICCID on EM7565. The return value of this function is 1094 - Not Supported.

We are able to get ICCID using at+iccid AT command.

Is UIMGetICCID the correct SDK function I should use to get ICCID on EM7565?
Also, the “UIMGetICCID” function is not defined on SDK api (header) directory. But it is for sure implemented because it didn’t give any error when compiling and linking my software.

Regards,
Shuo

UIMGetICCID is deprecated. You will have to read it directly from the SIM elementary file using SLQSUIMReadTransparent.

Returns the UIM ICCID. This API is deprecated on MC73xx/EM73xx/WP76xx modules since firmware version SWI9X15C_05_xx_xx_xx, all EM74xx and WP76xx firmware versions. Please use SLQSUIMReadTransparent()(EF ID: 3F00 2FE2) instead for new firmware versions and new modules.

Please refer the Connection_Manager sample application for a code sample.

Is there a piece of sample code out there in “Pure QMI” (i.e., building the appropriate TLVs to make the UIMReadTransparent call)? I’m unfortunately needing to do this under Windows, and where don’t have use of the Sierra Linux SDK. :slight_smile: Have been using Qualcomm’s QMI library + sample connection manager for the last 7 years. Trying to code from scratch, and I’m clearly not versed in the exact incantation for reading UIM data.

You can look at how libqmi does it. But you shouldn’t copy the code unless your WIndows application is GPL :slight_smile:

Or just use the debug output, which should be safe license-wise:

  root@miraculix:/tmp# qmicli -v -p -d /dev/cdc-wdm0 --device-open-mbim --uim-read-transparent=0x3F00,0x2FE2

[..]

  [19 Aug 2018, 16:56:18] [Debug] [/dev/cdc-wdm0] sent generic request (translated)...
    <<<<<< QMUX:
    <<<<<<   length  = 32
    <<<<<<   flags   = 0x00
    <<<<<<   service = "uim"
    <<<<<<   client  = 3
    <<<<<< QMI:
    <<<<<<   flags       = "none"
    <<<<<<   transaction = 1
    <<<<<<   tlv_length  = 20
    <<<<<<   message     = "Read Transparent" (0x0020)
    <<<<<< TLV:
    <<<<<<   type       = "Read Information" (0x03)
    <<<<<<   length     = 4
    <<<<<<   value      = 00:00:00:00
    <<<<<<   translated = [ offset = '0' length = '0' ]
    <<<<<< TLV:
    <<<<<<   type       = "File" (0x02)
    <<<<<<   length     = 5
    <<<<<<   value      = E2:2F:02:00:3F
    <<<<<<   translated = [ file_id = '12258' file_path = '{ [0] = '0 ' [1] = '63 '}' ]
    <<<<<< TLV:
    <<<<<<   type       = "Session Information" (0x01)
    <<<<<<   length     = 2
    <<<<<<   value      = 00:00
    <<<<<<   translated = [ session_type = 'primary-gw-provisioning' application_identifier = '' ]

    [19 Aug 2018, 16:56:18] [Debug] [/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<<   length  = 39
<<<<<<   flags   = 0x80
<<<<<<   service = "uim"
<<<<<<   client  = 3
<<<<<< QMI:
<<<<<<   flags       = "response"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 27
<<<<<<   message     = "Read Transparent" (0x0020)
<<<<<< TLV:
<<<<<<   type       = "Result" (0x02)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = SUCCESS
<<<<<< TLV:
<<<<<<   type       = "Read result" (0x11)
<<<<<<   length     = 12
<<<<<<   value      = 0A:00:98:74:30:50:21:01:11:00:18:59
<<<<<<   translated = { [0] = '152 ' [1] = '116 ' [2] = '48 ' [3] = '80 ' [4] = '33 ' [5] = '1 ' [6] = '17 ' [7] = '0 ' [8] = '24 ' [9] = '89 '}
<<<<<< TLV:
<<<<<<   type       = "Card result" (0x10)
<<<<<<   length     = 2
<<<<<<   value      = 90:00
    <<<<<<   translated = [ sw1 = '144' sw2 = '0' ]

[/dev/cdc-wdm0] Successfully read information from the UIM:
Card result:
        SW1: '0x90'
        SW2: '0x00'
Read result:
        98:74:30:50:21:01:11:00:18:59
1 Like

Thank you! Turns out I was quite close, mostly just some struct packing issues.