12 Commands for USIM application toolkit

27.0073GPPAT command set for User Equipment (UE)Release 18TS

12.1 General

If a UICC connected to an MT uses USIM Application Toolkit (USAT), some USAT features can be provided by the MT itself, whereas other features can be implemented in the TE. This applies especially to MTs with limited capabilities, where the user interface could be provided by the TE.

If there are multiple entities inside the TE providing USAT services, for the purpose of this specification, the TE is visible as one entity handling AT commands and responses on the interface to the TA/MT, see figure 12.1-1.

Figure 12.1-1: Overview of the interfaces between TE, TA/MT and UICC for USAT

The AT commands for definition of the USAT profiles and transmission of USAT proactive commands, USAT terminal responses and USAT envelope commands between the TE and UICC are specified in the subsequent clauses.

Compared to APDUs, where the MT is the initiator, USAT defines logic where the UICC is the initiator of the USAT proactive commands and the MT sends responses to these commands. Due to that, USAT proactive commands are sent in unsolicited result codes, whereas the associated responses are transported in subsequent AT commands.

12.2 Commands specific to MTs supporting USAT

12.2.1 Read USAT profile +CUSATR

Table 12.2.1-1: +CUSATR action command syntax

Command

Possible response(s)

+CUSATR[=<profile_storage>]

[+CUSATR: <profile_storage>,<profile>]

[<CR><LF>+CUSATR: <profile_storage>,<profile>

[…]]

+CME ERROR: <err>

+CUSATR=?

+CUSATR: (list of supported <profile_storage>s)

Execution command +CUSATR=<profile_storage> returns the profile specified by <profile_storage>. Execution command issued without parameter; +CUSATR, returns all profiles.

Test command returns values supported as a compound value.

Refer clause 9.2 for possible <err> values.

Defined values

<profile_storage>: integer type.

0 TE profile that can be set with +CUSATW.

1 MT profile that can be set with +CUSATW.

2 MT default profile that reflects the inherent, default supported facilities of the MT.

3 UICC profile that reflects the currently active UICC profile that was sent to the UICC in the last TERMINAL PROFILE command.

4 UICC EFUST. The elementary file that indicates services available in the USIM.

5 List of MT only facilities (facilities that are not allowed to be assigned to the TE, see 3GPP TS 31.111 [92]).

<profile>: string type in hexadecimal character format. The profile describing the supported facilities of the referenced <profile_storage> as specified for the Terminal Profile in 3GPP TS 31.111 [92] or for the related EF in 3GPP TS 31.102 [59].

Implementation

Optional.

12.2.2 Write USAT profile +CUSATW

Table 12.2.2-1: +CUSATW action command syntax

Command

Possible response(s)

+CUSATW[=<profile_storage>[,<profile>]]

+CUSATW: <profile_storage>,<conflict_profile>

+CME ERROR: <err>

+CUSATW=?

+CUSATW: (list of supported <profile_storage>s)

Description

Execution command without parameters resets stored TE and MT profiles to their default values. Adding parameter <profile_storage> to the AT command resets only the referred storage to its default value. Execution command issued with accompanied parameter <profile>, stores the given <profile> to non-volatile memory in the MT.

Upon an attempt to store or reset a profile that conflicts with an already stored profile or the list of MT only facilities, the operation fails and the profile referred to by command parameter <profile_storage> remains unchanged. The MT responds with +CUSATW: <profile_storage>,<conflict_profile> where <profile_storage> refers the conflicting profile followed by the final result code +CME ERROR: 3 (Operation not allowed). If there is a conflict with the MT only facilities, <profile_storage> is set to 5; otherwise <profile_storage> indicates the profile already stored for the TE or for the MT. The rules for detecting conflicts are defined in 3GPP TS 31.111 [92].

Successful execution of the command does not result in any information response.

Test command returns supported values as a compound value.

Refer clause 9.2 for possible <err> values.

Defined values

<profile_storage>: integer type.

0 TE. Refers profile storage for the facilities supported by the TE. Default value is a blank profile with all bits set to zero. This value is applicable both in the execution command and in the information response.

1 MT. Refers profile storage for the facilities to be supported by MT, which can be a subset of the default MT facilities. The TE can choose to register a subset of the MT default profile, typically omitting facilities also supported by the TE profile. Default value is the MT default profile. This value is applicable both in the execution command and in the information response.

5 Refers to a conflict between the TE profile and the list of MT only facilities. This value is not applicable in the execution command.

<profile>: string type in hexadecimal character format. The profile describing the supported USAT facilities of the referenced <profile_storage> as specified for the Terminal Profile in 3GPP TS 31.111 [92].

<conflict_profile>: string type in hexadecimal character format. A bitwise AND of two profiles, showing the conflicts, that is, USAT facilities supported by both profiles. See description of Terminal Profile in 3GPP TS 31.111 [92].

Implementation

Optional.

12.2.3 Profile download upon start-up +CUSATD

Table 12.2.3-1: +CUSATD parameter command syntax

Command

Possible response(s)

+CUSATD=[<download>[,<reporting>]]

+CME ERROR: <err>

+CUSATD?

+CUSATD: <download>,<reporting>

+CUSATD=?

+CUSATD: (list of supported <download>s),(list of supported <reporting>s)

Description

This command determines if, and optionally which profile should be downloaded to the UICC automatically upon start-up. If, prior to a restart/start-up, the +CUSATD settings have not been altered, then the default settings determine the behaviour upon start-up. However, if the parameters of +CUSATD has been set to other than default and then a restart is performed (e.g. by +CFUN), these values determine the behaviour. This is true for one restart only after altering +CUSATD parameters as they are always reset to default at the end of the next UICC start-up (i.e. when the USIM initialisation as specified in 3GPP TS 31.102 [98] has been completed).

The command without parameters resets the parameters to their default values.

The command can only be used if the UICC is already in active state (<UICC_state> 4, e.g. upon +CUSATA) or in download completed state (<UICC_state> 2) and the UICC does not support the "Additional TERMINAL PROFILE after UICC activation" feature (see 3GPP TS 31.111 [92]). In all other cases the command responds with +CME ERROR: 14 (SIM busy).

+CUSATD=<download>,1 also enables the unsolicited result code +CUSATS: <UICC_state>. The MT uses this unsolicited result code to indicate that a profile download is performed (setting +CUSATD=0,1 or +CUSATD=1,1) or that it is ready for profile download (setting +CUSATD=2,1). In both cases, the MT also indicates the end of UICC start-up by the unsolicited result code +CUSATS: 4. If the UICC is awaiting PIN verification during start-up, this is also reported.

When using +CUSATD=1, the +CUSATA=1 command has to be used to enable TE profile facility handling after restart. In the time between profile download and issuance of +CUSATA=1, the UICC may already attempt to issue proactive commands. The MT will not send these to the TE, but rather give the UICC the response "terminal currently unable to process command" autonomously. The UICC may implement only a limited number of retries, which can potentially leave USAT in an unwanted state if the +CUSATA=1 command arrives late.

NOTE: Care has to be taken when using +CUSATD=2. If no +CUSATA=2 or +CUSATA=3 is sent during start-up, USAT is also blocked for the MT.

Test command returns supported values as compound values.

Refer clause 9.2 for possible <err> values.

Defined values

<download>: integer type. Parameter decides when/if to perform a profile download to UICC and which profile to download. The default value is implementation specific.

0 Download MT default profile automatically during next start-up.

1 Download the combined TE and MT profile (merger of the profiles written by +CUSATW) automatically during next start-up. The rules for merging profiles are defined in 3GPP TS 31.111 [92].

2 Halt next UICC start-up when ready for profile download. Profile to download will be selected and download will be triggered by +CUSATA.

<reporting>: integer type. Parameter enables unsolicited result code +CUSATS: <UICC_state> to notify the TE about a new state during start-up.

0 Disable +CUSATS, i.e. no notification.

1 Enable +CUSATS, i.e. notify TE.

<UICC_state>: integer type. Parameter reports that the UICC entered a new state during start-up or that the UICC ended startup and entered active state.

0 UICC start-up in progress, before profile download.

1 UICC start-up halted and ready for profile download. This state is reached if +CUSATD=2 was issued before restart. UICC start-up will continue upon +CUSATA=2 or +CUSATA=3.

2 Profile download completed, UICC startup continuing.

3 UICC awaiting PIN verification.

4 UICC active.

Implementation

Optional.

12.2.4 Activate USAT profile +CUSATA

Table 12.2.4-1: +CUSATA action command syntax

Command

Possible response(s)

+CUSATA[=<activation>]

+CUSATA: <UICC_state>[,<additional_profile_support>]

+CME ERROR: <err>

+CUSATA=?

+CUSATA: (list of supported <activation>s)

Description

Execution command +CUSATA retrieves the current UICC state or downloads a profile to the UICC and/or activates handling of the TE profile facilities.

A positive result upon a +CUSATA=1 or +CUSATA=3 command (also) enables TE profile facility handling via unsolicited result codes +CUSATP: <proactive_command> and +CUSATEND. The MT uses the unsolicited result code +CUSATP: <proactive_command> to forward to the TE proactive commands issued by the UICC. The unsolicited result code +CUSATEND is issued by the MT when the UICC indicates that the proactive command session is terminated, i.e. in response to a USAT terminal response, the UICC indicates that no other USAT proactive command is pending. Lastly, terminal responses to the proactive commands can now be issued with +CUSATT=<terminal_response> and envelope commands can be issued with +CUSATE=<envelope_command>.

If the action requested by the +CUSATA command can not be performed, the information response +CUSATA: <UICC_state>,[<additional_profile_support>] is returned with appropriate values, followed by the final result code +CME ERROR: 4 (Operation not supported) in case the UICC does not support USAT at all, or the final result code +CME ERROR: 3 (Operation not allowed) in all other cases.

If the UICC is already in active state and the UICC does not support the "Additional TERMINAL PROFILE after UICC activation" feature (see 3GPP TS 31.111 [92]), the TE has the option to perform a reset of the UICC or use +CFUN to get back to an initial non-active UICC state. The +CUSATD command can be used to set profile handling upon the next restart.

All USAT proactive commands that the MT does not process itself and all terminal responses from the TE are transparently forwarded by the MT. The routing mechanism for USAT commands supported by both entities is specified in 3GPP TS 31.111 [92].

Test command returns values supported as a compound value.

Refer clause 9.2 for possible <err> values.

Defined values

<activation>: integer type.

0 Return status information only, in information response: +CUSATA: <UICC_state>[,<additional_profile_support>].

1 Enable TE profile facility handling only, no profile download. This action can only be used if the combined TE and MT profile was downloaded during start-up (setting +CUSATD=1).

2 Download MT default profile.

3 Download the combined TE and MT profile (merger of the profiles written by +CUSATW) an enable TE profile facility handling. The rules for merging profiles are defined in 3GPP TS 31.111 [92].

<UICC_state>: integer type. Parameter reports that the UICC entered a new state during start-up or that the UICC ended startup and entered active state.

0 UICC start-up in progress, before profile download.

1 UICC start-up halted and ready for profile download. This state is reached if +CUSATD=2 was issued before restart. UICC start-up will continue upon +CUSATA=2 or +CUSATA=3.

2 Profile download completed, UICC startup continuing.

3 UICC awaiting PIN verification.

4 UICC active.

<additional_profile_support>: integer type. Indicates whether the UICC supports the "Additional TERMINAL PROFILE after UICC activation" feature (see 3GPP TS 31.111 [92]). The value may not be available during early phases of start-up.

0 No support.

1 Supported.

<proactive_command>: string type in hexadecimal character format. Proactive command as defined in 3GPP TS 31.111 [92], consisting of the full BER-TLV data object.

Implementation

Optional.

12.2.5 Send USAT terminal response +CUSATT

Table 12.2.5-1: +CUSATT action command syntax

Command

Possible response(s)

+CUSATT=<terminal_response>

+CME ERROR: <err>

+CUSATT=?

Description

Execution command sends a USAT terminal response to the MT as an answer to a preceding USAT proactive command sent from the UICC with unsolicited result code +CUSATP: <proactive_command> (see +CUSATA command description).

Refer clause 9.2 for possible <err> values.

Defined values

<terminal_response>: string type in hexadecimal character format. Terminal response to a proactive command as defined in 3GPP TS 31.111 [92], consisting of the full BER-TLV data object.

Implementation

Optional.

12.2.6 Send USAT envelope command +CUSATE

Table 12.2.6-1: +CUSATE action command syntax

Command

Possible response(s)

+CUSATE=<envelope_command>

+CUSATE: <envelope_response>[,<busy>]

[<CR><LF>+CUSATE2: <sw1>,<sw2>]

+CME ERROR: <err>

+CUSATE=?

Description

Execution command allows the TE to send a USAT envelope command to the MT. If the UICC provides response data to the command or indicates that USAT is busy, the information response +CUSATE: <envelope_response>[,<busy>] is returned. A second line of information response +CUSATE2: <sw1>,<sw2> may be provided if the MT presents the status words provided by the UICC.

Refer clause 9.2 for possible <err> values.

Defined values

<envelope_command>: string type in hexadecimal character format. Envelope command as defined in 3GPP TS 31.111 [92], consisting of the full BER-TLV data object.

<envelope_response>: string type in hexadecimal character format. Response to the envelope command as defined in 3GPP TS 31.111 [92], consisting of the full BER-TLV data object. An empty string is provided if the UICC does not have any response data to provide.

<busy>: integer type.

0 UICC indicated normal ending of the command.

1 UICC responded with USAT is busy, no retry by the MT.

2 UICC responded with USAT is busy even after one or more retries by the MT.

<sw1>: integer type. Status word information from the envelope response returned by the UICC as defined in ETSI TS 102 221 [60], clause 10.2. The parameter can be delivered to the TE both in the case of successful and failed execution of the envelope command.

<sw2>: integer type. For description see <sw1>.

Implementation

Optional.

12.3 Informative examples

These examples provide a sequence of interactions where USAT commands and responses are transmitted in AT commands. As it would make the examples unreadable, USAT data is not given in its hexadecimal representation (which is found in 3GPP TS 31.111 [92]), but in abstract textual form. For readability, only a subset of USAT facilities typically provided in a profile is given in the examples. Resulting or triggering actions on the MT-UICC interface are also indicated in the examples.

First, the TE reads the MT default profile:

AT+CUSATR=2

+CUSATR: 2,<PLAY TONE, SET UP MENU, DISPLAY TEXT, EVENT MENU SELECTION, …>

OK

The TE removes some USAT facilities in the MT by writing a new MT profile, which contains those facilities that are to be handled by the MT:

AT+CUSATW=1,<PLAY TONE, …>

OK

Now the TE tries to write a TE profile that conflicts with the MT profile. The MT responds with the conflict information and rejects the command.

AT+CUSATW=0,<PLAY TONE, SET UP MENU, DISPLAY TEXT, EVENT MENU SELECTION, …>

+CUSATW: 1,<PLAY TONE>

+CME ERROR: 3

The next attempt to write a TE profile is successful and the TE activates the profiles.

AT+CUSATW=0,<SET UP MENU, DISPLAY TEXT, EVENT MENU SELECTION, …>

OK

AT+CUSATA=3

MT -> UICC: TERMINAL PROFILE

UICC -> ME: proactive command pending

OK

The UICC sends a SET UP MENU proactive command, resulting in the command being transferred to the TE and the latter confirming it with a terminal response; thereafter the proactive session ends.

UICC -> MT: SET UP MENU

+CUSATP: <SET UP MENU>

AT+CUSATT=<OK>

MT -> UICC: TERMINAL RESPONSE: OK

UICC -> ME: no proactive command pending

OK

+CUSATEND

A selection by the subscriber in the menu results in an ENVELOPE being sent to the MT and forwarded to the UICC. The UICC responds with the next proactive command DISPLAY TEXT. After the terminal response, the proactive session ends.

AT+CUSATE=<MENU SELECTION, item=1>

MT -> UICC: ENVELOPE(MENU SELECTION, item=1)

UICC -> ME: proactive command pending

OK

UICC -> MT: DISPLAY TEXT

+CUSATP: <DISPLAY TEXT>

AT+CUSATT=<OK>

MT -> UICC: TERMINAL RESPONSE: OK

UICC -> ME: no proactive command pending

OK

+CUSATEND

The TE defines UICC profile download options. The definition is effective for the next UICC start-up.

AT+CUSATD=1,1

OK

The UICC restarts. The MT reports the start-up. During start-up the profile download definition cannot be altered and the MT responds error code 14 (SIM busy).

+CUSATS: 0

AT+CUSATD=2,1

+CME ERROR: 14

The UICC is awaiting PIN verification. During PIN verification the profile download definition cannot be altered and the MT responds error code 14 (SIM busy).

+CUSATS: 3

AT+CUSATD=2,1

+CME ERROR: 14

The UICC becomes active and the profile download definition can be changed.

+CUSATS: 4

AT+CUSATD=2,1

OK

The TE enables the downloaded profile.

AT+CUSATA=1

OK

The TE reads the TE profile:

AT+CUSATR=0

+CUSATR: 0,<PLAY TONE, SET UP MENU, DISPLAY TEXT, EVENT MENU SELECTION, …>

OK

Now the TE tries to write a MT profile that conflicts with the TE profile. The MT responds with the conflict information and rejects the command.

AT+CUSATW=1,<DISPLAY TEXT, …>

+CUSATW: 0,<DISPLAY TEXT>

+CME ERROR: 3

The next attempt to write a MT profile is successful.

AT+CUSATW=1,<SET UP MENU, EVENT MENU SELECTION, …>

OK

The TE reads the List of MT only facilities:

AT+CUSATR=5

+CUSATR: 5,<POLL INTERVAL, POLLING OFF, PROVIDE LOCAL INFORMATION (NMR), …>

OK

Now the TE tries to write a TE profile that conflicts with the MT only facilities. The MT responds with the conflict information and rejects the command.

AT+CUSATW=0,<POLL INTERVAL, …>

+CUSATW: 5,<POLL INTERVAL>

+CME ERROR: 3

The next attempt to write a TE profile is successful.

AT+CUSATW=0,<SET UP MENU, DISPLAY TEXT, EVENT MENU SELECTION, …>

OK