nrf9160

Set command

The set command allows locking the modem to work with predefined Universal Subscriber Identity Module (USIM) cards. Using the command, the modem can be personalized, depersonalized, or the lock of a category can be disabled if the category is not depersonalized.

It is also possible to configure USIM personalization so that the device is locked to the first USIM that is inserted to it.

According to 3GPP TS 22.022, the following personalization options are available:

Syntax:

%XUSIMLCK=<command>,<facility>,[<pwd>,[<permanent>,[<pers_data>]]]

The modem supports a maximum of 24 personalization codes.

+CME ERROR codev1.3.x≥2
518 – Not allowed in active state.
528 – Not allowed when power off warning is active.

The set command parameters and their defined values are the following:

<command>
1 – Personalize
2 – Depersonalize
3 – Disable
4 – Lock device to the first inserted USIM. The value of <facility> must be PS.
<facility>
String
PN – Network personalization
PU – Network subset personalization
PP – Service provider personalization
PC – Corporate personalization
PS – USIM personalization
<pwd>
String. A password for enabling or disabling personalization. Used for <command> values 1, 2, or 4. The length of the password is 6–16 digits.
If PN Network Control Key, (NCK)
If PU Network Subset Control Key, (NSCK)
If PP Service Provider Control Key, (SPCK)
If PC Corporate Control Key, (CCK)
If PS Personalization Control Key, (PCK)
<permanent>
Programmable selection of the Control Key. Used only when the value of <command> is 1. The permanent Control Key can be programmed once, and it is therefore immutable once programmed.
0 – Nonpermanent Control Key
1 – Permanent Control Key
<pers_data>
String. Used only when the value of <command> is 1.
When <facility> is PN, <pers_data> can contain a maximum of 24 pairs of Mobile Country Code (MCC) and Mobile Network Code (MNC) in the following format: MCC1.MNC1:MCC2.MNC2:…:MCCn.MNCn.
When <facility> is PU, <pers_data> can contain a maximum of 24 pairs of MCC+MNC+Network Subset Code (digits 6 and 7 of International Mobile Subscriber Identity (IMSI)) in the following format: MCC1.MNC1.D61.D71:MCC2.MNC2.D62.D72:...:MCCn.MNCn.D6n.D7n, where D6x and D7x represent the sixth and seventh digits of IMSI.
When <facility> is PP, <pers_data> can contain a maximum of 24 USIM group identifiers for service provider personalization in the following format: MCC1.MNC1.GID11:MCC2.MNC2.GID12:...:MCCn.MNCn.GID1n. GID1x represents the first byte of EF_GID1 in USIM, see 3GPP TS 31.102 Ch. 4.2.10 EFGID1.
When <facility> is PC, <pers_data> can contain a maximum of 24 pairs of USIM group identifiers from EFGID1 and 4.2.11 EFGID2 for corporate personalization in the following format: MCC1.MNC1.GID11.GID21:MCC2.MNC2.GID12.GID22:...: MCCn.MNCn.GID1n.GID2n.

GID1x and GID2x represent the first bytes of EF_GID1 and EF_GID2, see 3GPP TS 31.102 Ch. 4.2.10 EFGID1 and 4.2.11 EFGID2.

When <facility> is PS, <pers_data> can contain a maximum of 24 IMSIs as specified in 3GPP TS 31.102 Ch. 4.2.2 EFIMSI. Fifteen IMSI digits can be given. The format is the following: IMSI1:IMSI2:...:IMSIn.

The following command example creates a nonpermanent network personalization:

AT%XUSIMLCK=1,"PN","12345678",0,"100.200"
OK

The following command depersonalizes the network personalization:

AT%XUSIMLCK=2,"PN","12345678"
OK

This command disables network personalization:

AT%XUSIMLCK=3,"PN"
OK

This command locks device to the first inserted USIM in a nonpermanent manner:

AT%XUSIMLCK=4,"PS","12345678",0
OK

This command personalizes USIM to IMSI 100200777777777 (MCC=100, MNC=200, other digits are 7). The facility PS is permanently locked to password "12345678". After depersonalization, no other keys can be used for this facility:

AT%XUSIMLCK=1,"PS","12345678",1,"100200777777777"
OK