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

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 type. 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 type. 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 shall be written to the SIM.
<pathid>
String type. Contains the path of an elementary file on the SIM/Universal Integrated Circuit Card (UICC) in hexadecimal format (e.g. "7F205F70" in SIM and UICC case). The <pathid> shall only be used in the mode "select by path from MF" as defined in ETSI TS 102 221.
<sw1>, <sw2>
Integer type. 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 will be returned. <response> is not returned after a successful UPDATE BINARY, UPDATE RECORD, or SET DATA command.

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

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