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

**URL:** <https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527>\
**Category:** MC/EM Series\
**Created:** [May 1, 2018, 8:12pm UTC](https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527 "2018-05-01T20:12:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdong](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@sdong](https://forum.sierrawireless.com/u/sdong)\
**Post date:** [May 1, 2018, 8:12pm UTC](https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527/1 "2018-05-01T20:12:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon56110884](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@anon56110884](https://forum.sierrawireless.com/u/anon56110884)\
**Post date:** [May 2, 2018, 11:26pm UTC](https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527/2 "2018-05-02T23:26:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ErikDOlson](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@ErikDOlson](https://forum.sierrawireless.com/u/ErikDOlson)\
**Post date:** [August 17, 2018, 3:53pm UTC](https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527/3 "2018-08-17T15:53:57Z")

</div>

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. 🙂 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.

---

<div class="post-metadata">

**Author:** ![dl5162](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/dl5162/32/2169_2.png) [@dl5162](https://forum.sierrawireless.com/u/dl5162)\
**Post date:** [August 19, 2018, 5:18pm UTC](https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527/4 "2018-08-19T17:18:13Z")

</div>

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

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
```

---

<div class="post-metadata">

**Author:** ![ErikDOlson](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@ErikDOlson](https://forum.sierrawireless.com/u/ErikDOlson)\
**Post date:** [August 20, 2018, 8:14pm UTC](https://forum.sierrawireless.com/t/how-to-get-iccid-for-em7565-using-linux-qmi-sdk-api-function/12527/5 "2018-08-20T20:14:54Z")

</div>

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