# Remote SIM

- [API reference](https://docs.qualcomm.com/doc/80-41102-2/topic/_doxygen_rst_file__doxygen_sources_taf_simRsim_interface_h.html#file-taf-simrsim-interface-h)

The Remote SIM (RSIM) service allows apps to manage a remote SIM instead of the internal SIM card. This service allows a user application to convey APDU requests to the remote SIM and APDU responses to the modem through the RSIM service. The link between the application and the RSIM service is based on the SIM Access Profile (SAP) specification. A remote SIM service is needed for applications that want to communicate related to SIM I/O, e.g., APDU, ATR sends a message to the SIM located at the remote side.

## IPC interfaces binding

The functions of this API are provided by the **tafRemoteSimSvc** application service.

The following example illustrates how to bind to the remote SIM service.

bindings:
    {
        clientExe.clientComponent.taf_simRsim -> tafRemoteSimSvc.taf_simRsim
    }
    Copy to clipboard

## Communication

The communication between the application and the remote SIM service uses the SIM Access Profile (SAP) protocol.

The latest [V11r00 SAP specification](https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=158740) is supported by the remote SIM service. All client-mandatory features and some optional features are supported. The table below summarizes all SAP messages supported by the remote SIM service.

| Feature | Associated SAP messages | Support in SAP client | RSIM support |
| --- | --- | --- | --- |
| Connection management | MSGID\_CONNECT\_REQ | Mandatory | Supported |
| Connection management | MSGID\_CONNECT\_RESP | Mandatory | Supported |
| Connection management | MSGID\_DISCONNECT\_REQ | Mandatory | Supported |
| Connection management | MSGID\_DISCONNECT\_RESP | Mandatory | Supported |
| Connection management | MSGID\_DISCONNECT\_IND | Mandatory | Supported |
| Transfer APDU | MSGID\_TRANSFER\_APDU\_REQ | Mandatory | Supported |
| Transfer APDU | MSGID\_TRANSFER\_APDU\_RESP | Mandatory | Supported |
| Transfer ATR | MSGID\_TRANSFER\_ATR\_REQ | Mandatory | Supported |
| Transfer ATR | MSGID\_TRANSFER\_ATR\_RESP | Mandatory | Supported |
| Power SIM off | MSGID\_POWER\_SIM\_OFF\_REQ | Optional | Supported |
| Power SIM off | MSGID\_POWER\_SIM\_OFF\_RESP | Optional | Supported |
| Power SIM on | MSGID\_POWER\_SIM\_ON\_REQ | Mandatory | Supported |
| Power SIM on | MSGID\_POWER\_SIM\_ON\_RESP | Mandatory | Supported |
| Reset SIM | MSGID\_RESET\_SIM\_REQ | Optional | Supported |
| Reset SIM | MSGID\_RESET\_SIM\_RESP | Optional | Supported |
| Report Status | MSGID\_STATUS\_IND | Mandatory | Supported |
| Transfer Card Reader Status | MSGID\_TRANSFER\_CARD\_READER\_STATUS\_REQ | Optional | Supported |
| Transfer Card Reader Status | MSGID\_TRANSFER\_CARD\_READER\_STATUS\_RESP | Optional | Supported |
| Error handling | MSGID\_ERROR\_RESP | Mandatory | Supported |
| Set Transport Protocol | MSGID\_SET\_TRANSPORT\_PROTOCOL\_REQ | Optional | Not supported |
| Set Transport Protocol | MSGID\_SET\_TRANSPORT\_PROTOCOL\_RESP | Optional | Not supported |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |

A message can be sent to the service which the sends commands to the modem using [taf\_simRsim\_SendMessage()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00653_1aa7c1d339ee17422c3c8efb4f098e05ea.html#Documentationa00653_1aa7c1d339ee17422c3c8efb4f098e05ea) with the messagePtr, messageNumElements, callbackPtr and contextPtr passed as parameters. This message sending is an asynchronous process. A callback pointer can therefore be passed to [taf\_simRsim\_SendMessage()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00653_1aa7c1d339ee17422c3c8efb4f098e05ea.html#Documentationa00653_1aa7c1d339ee17422c3c8efb4f098e05ea) in order to receive the sending result for the message.

static le_mem_PoolRef_t RsimMsgsPool;
    static uint8_t APDUResp[60] = { 0x06, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
                               0x04, 0x00, 0x00, 0x29, 0x62, 0x25, 0x82, 0x02, 0x78, 0x21, 0x83, 0x02,
                               0x3F, 0x00, 0xA5, 0x0B, 0x80, 0x01, 0x71, 0x83, 0x03, 0x07, 0x93, 0x81,
                               0x87, 0x01, 0x01, 0x8A, 0x01, 0x05, 0x8B, 0x03, 0x2F, 0x06, 0x02, 0xC6,
                               0x06, 0x90, 0x01, 0x00, 0x83, 0x01, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00 };
    static uint8_t APDURespLength = 60;
    RsimMsg_t* rsimPtr1 = le_mem_ForceAlloc(RsimMsgsPool);
    memcpy(rsimPtr1->msg, APDUResp, APDURespLength);
    rsimPtr1->msgLength = APDURespLength;
    rsimPtr1->callback = CallbackHandler;
    rsimPtr1->contextPtr = NULL;
    le_result_t result = taf_simRsim_SendMessage(rsimPtr1->msg, rsimPtr1->msgLength, rsimPtr1->callback, rsimPtr1->contextPtr);
    LE_ASSERT(res == LE_OK);
    Copy to clipboard

Before the tafsimRsim message sending is started, an application registers a callback handler using [taf\_simRsim\_AddMessageHandler()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00653_1a5936f242291332238dd960282d6561fd.html#Documentationa00653_1a5936f242291332238dd960282d6561fd). Once the message is sent, the handler will be called indicating the sending status of the message. If sending the message failed, the handler will be called with the error code.

taf_simRsim_MessageHandlerRef_t msgHandlerRef = @ref taf_simRsim_AddMessageHandler(SAPMessageHandler, NULL);
    Copy to clipboard

Applications must use [taf\_simRsim\_RemoveMessageHandler()](https://docs.qualcomm.com/doc/80-41102-2/topic/function_a00653_1a07a6a7c1bd2dddea03512e128c06ca89.html#Documentationa00653_1a07a6a7c1bd2dddea03512e128c06ca89) to release [taf\_simRsim\_MessageHandlerRef\_t](https://docs.qualcomm.com/doc/80-41102-2/topic/typedef_a00650_1a4293df71f4dab61df054428d49f12b63.html#Documentationa00650_1a4293df71f4dab61df054428d49f12b63) message handler reference object when it is no longer used.

**WARNING:** The remote SIM service supports only one remote SIM card and can therefore be connected with only one application.

**NOTE:**

- The remote SIM service has to be supported by the modem to be used: check your platform documentation.
- The remote SIM card should be selected in order to use the remote SIM service.
- As runtime switch is not currently supported, the switch between local and remote SIM card requires a platform reset to take effect.

Last Published: Jun 09, 2026

[Previous Topic
SIM Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafsim.md) [Next Topic
Remote SIM Profile](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafSimRsp.md)

Source: [https://docs.qualcomm.com/doc/80-41102-2/topic/page_c_tafsimRsim.html](https://docs.qualcomm.com/doc/80-41102-2/topic/page_c_tafsimRsim.html)