> 14.1 | AT+CRSM Restricted SIM Access

> AT+CRSM offers easy access of the Elementary Files on the SIM. Access to the SIM database is restricted to the commands which are listed at <command>. However, additional SIM commands are available via AT^SXSM.
> All parameters of AT+CRSM are used as specified by GSM 11.11 [26]. TC65 handles internally all required SIM interface locking and file selection routines.
> As response to the command, the TC65 sends the actual SIM information parameters and response data. Error result code "+CME ERROR" may be returned if the command cannot be passed to the SIM, e.g. if the SIM is not inserted. However, failure in the execution of the command in the SIM is reported in <sw1> and <sw2> parameters.
> AT+CRSM requires PIN authentication. However, using <command> "READ BINARY" and <command> "READ RECORD" is possible before PIN authentication and if the SIM is blocked (state after three failed PIN authentication attempts) to access the contents of the following Elementary Files:

> EF Symbol | EF Name | EF ID (hex.) | EF ID (dec.)
> EF ICCID | ICC identification | 2FE2 | 12258
> EF ELP | Extended language preference | 2F05 | 12037
> EF LP | Language preference | 6F05 | 28421
> EF SPN | Service provider name | 6F46 | 28486
> EF AD | Administrative data | 6FAD | 28589
> EF Phase | Phase identification | 6FAE | 28590
> EF ECC | Emergency call codes | 6FB7 | 28599

> Please beware of possible changes to Elementary Files by the network at any time, refer Chapter 14., SIM related Commands.
> Syntax

> Test Command AT+CRSM=?
> Response(s)
> OK

> Write Command AT+CRSM=<command>[, <fileID>[, <P1>, <P2>, <P3>[, <data>]]]
> Response(s)
> +CRSM: <sw1>,<sw2>[,<response>]
> OK
> ERROR
> +CME ERROR: <err>

> Reference(s) |  | PIN |  | ASC0 | ASC1 | USB | MUX1 | MUX2 | MUX3 |  |  | Charge | Q | Last
> GSM 07.07 |  | ± |  | + | + | + | + | + | + |  |  | - | + | -

> Parameter Description

> <command>(num)

> SIM command number.
> 176
> READ BINARY
> 178
> READ RECORD
> 192
> GET RESPONSE
> 214
> UPDATE BINARY
> 220
> UPDATE RECORD
> 242
> STATUS

> <fileID>(num)

> Identifier for an elementary data file on SIM, if used by <command>.

> <P1>(num)

> Parameter to be passed on by the TC65 to the SIM.
> 0...255

> <P2>(num)

> Parameter to be passed on by the TC65 to the SIM.
> 0...255

> <P3>(num)

> Parameter to be passed on by the TC65 to the SIM.
> 0...255

> <data>(str)

> Information which shall be written to the SIM (hexadecimal character format).

> <sw1>(num)

> Status information from the SIM about the execution of the actual command. It is returned in both cases, on successful or failed execution of the command.
> 0...255

> <sw2>(num)

> Status information from the SIM about the execution of the actual command. It is returned in both cases, on successful or failed execution of the command.
> 0...255

> <response>(str)

> Response data in case of a successful completion of the previously issued command.
> "STATUS" and "GET RESPONSE" commands return data, which gives information about the currently selected elementary data field. This information includes the type of file and its size.
> After "READ BINARY" or "READ RECORD" commands the requested data will be returned.
> <response> is empty after "UPDATE BINARY" or "UPDATE RECORD" commands.