nrf9160

Set command

The set command transmits restricted commands to the Subscriber Identity Module (SIM).

Syntax:

+CRSM=<command>[,<fileid>[,<P1>,<P2>,<P3>[,<data>[,<pathid>]]]]

Response syntax:

+CRSM: <sw1>,<sw2>[,<response>]
+CME ERROR code
11 – SIM PIN required.
12 – SIM PUK required.
13 – SIM failure.
14 – SIM busy.
17 – SIM PIN2 required.
18 – SIM PUK2 required.

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

<command>
Integer
176 – READ BINARY
178 – READ RECORD
192 – GET RESPONSE
214 – UPDATE BINARY
220 – UPDATE RECORD
242 – STATUS
203 – RETRIEVE DATA
219 – SET DATA
<fileid>
Integer. Identifier of an elementary data file on SIM. Mandatory for every command except STATUS. The range of valid file identifiers depends on the actual SIM and is defined in 3GPP TS 51.011. Optional files may not be present at all.
<P1>, <P2>, <P3>
Integer. Parameters passed on by the Mobile Termination (MT) to the SIM. These parameters are mandatory for every command, except GET RESPONSE and STATUS. The values are described in 3GPP TS 51.011.
<data>
String in hexadecimal format. Information that is written to the SIM.
<pathid>
String in hexadecimal format. Contains the path of an elementary file on the SIM/Universal Integrated Circuit Card (UICC) (for example, "7F205F70" in SIM and UICC case). The <pathid> is used only in the mode "select by path from MF" as defined in ETSI TS 102 221.
<sw1>, <sw2>
Integer. Information from the SIM about command execution. These parameters are delivered to the Terminal Equipment (TE) in both cases, on successful or failed command execution.
<response>
String in hexadecimal format. Issued once a command is successfully completed. STATUS and GET RESPONSE return data which provides information about the current elementary data field. This information includes file type and size (see 3GPP TS 51.011). After READ BINARY, READ RECORD, or RETRIEVE DATA command, the requested data is returned. <response> is not returned after a successful UPDATE BINARY, UPDATE RECORD, or SET DATA command.

The following command example reads the forbidden Public Land Mobile Network (PLMN) list:

AT+CRSM=176,28539,0,0,12
+CRSM: 144,0,"64F01064F040FFFFFFFFFFFF"
OK