# SIM card services

**Detailed Description**

This section contains APIs related to Card Services.

- *group* Telematics\_card

    - Typedefs

- using PinOperationResponseCb = std::function&lt;void(int retryCount, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to pin operations like change pin password, unlock card and set card lock.

- Param retryCount:

    - **[in]** No of retry attempts left

- Param error:

    - **[in]** Return code for whether the operation succeeded or failed

- using QueryFdnLockResponseCb = std::function&lt;void(bool isAvailable, bool isEnabled, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to queryFdnLockState API.

- Param isAvailable:

    - **[in]** Determine FDN lock state availability

- Param isEnabled:

    - **[in]** Determine FDN lock state i.e enable or disable

- Param error:

    - **[in]** Return code for whether the operation succeeded or failed

- using QueryPin1LockResponseCb = std::function&lt;void(bool state, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to queryPin1LockState API.

- Param state:

    - **[in]** Determine state whether enabled or disabled

- Param error:

    - **[in]** Return code for whether the operation succeeded or failed

- using EfOperationCallback = std::function&lt;void(telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error, IccResult result)&gt;

    - This function is invoked when elementary file(EF) operations like either reading/writing a single record to a linear fixed file or reading/writing the data to the transparent file are performed.

- Param error:

    - **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d)

- Param result:

    - **[in]** For read operation [telux::tel::IccResult::data](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646_1a5760495436dec14d9e7c2bf52fb3c266) contains either record corresponding to linear fixed file or data corresponding to the transparent file. For write operation [telux::tel::IccResult::data](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646_1a5760495436dec14d9e7c2bf52fb3c266) and [telux::tel::IccResult::payload](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646_1a7fdd8235d4631fadc25ab7e02f337451) is empty.

- using EfReadAllRecordsCallback = std::function&lt;void(telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error, std::vector&lt;IccResult&gt; records)&gt;

    - This function is called when an elementary file(EF) operation like reading all records from a linear fixed file is performed.

- Param error:

    - **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d)

- Param records:

    - **[in]** List of records returned for EF read operation from a linear fixed file. If the reading of any of the records from the file fails then the records returned will be empty.

- using EfGetFileAttributesCallback = std::function&lt;void(telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error, IccResult result, FileAttributes attributes)&gt;

    - This function is called when an elementary file operation like getting file attributes is performed.

- Param error:

    - **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d)

- Param result:

    - **[in]** [telux::tel::IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646) for elementary file operation like get SIM file attributes.

- Param attributes:

    - **[in]** [telux::tel::FileAttributes](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00649.html#a00649) contain EF file information like file type and file size etc.

- using EidResponseCallback = std::function&lt;void(const std::string &eid, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to requestEid API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

- Param eid:

    - **[in]** eUICC identifier.

- Param error:

    - **[in]** Return code which indicates whether the operation succeeded or not. ErrorCode

- using refreshLastEventResponseCallback = std::function&lt;void(RefreshStage stage, RefreshMode mode, std::vector&lt;IccFile&gt; efFiles, RefreshParams refreshParams, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to requestLastRefreshEvent API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Param stage:

    - **[in]** Card refresh stage RefreshStage

- Param mode:

    - **[in]** Card refresh mode RefreshMode

- Param efFiles:

    - **[in]** List of the elementary file path and identifier

- Param refreshParams:

    - **[in]** Session type [telux::tel::RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#a00648). Client provides the session type, application identifier to listen for the corresponding refresh event.

- Param error:

    - **[in]** Return code which indicates whether the operation succeeded or not. ErrorCode

- using SapStateResponseCallback = std::function&lt;void([SapState](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#_CPPv48SapState) sapState, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error)&gt;

    - This function is called with the response to requestSapState API.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

- Param sapState:

    - **[in]** [SapState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa2849d33e59d6928632970acffc4dd26.html#a00014_1gaa2849d33e59d6928632970acffc4dd26) of SIM access profile (SAP) connection

- Param error:

    - **[in]** Return code for whether the operation succeeded or failed

Enums

- enum CardState

    - Defines all state of Card like absent, present etc

*Values:*

- enumerator CARDSTATE\_UNKNOWN

    - Unknown card state

- enumerator CARDSTATE\_ABSENT

    - Card is absent

- enumerator CARDSTATE\_PRESENT

    - Card is present

- enumerator CARDSTATE\_ERROR

    - Card is having error, either card is removed and not readable

- enumerator CARDSTATE\_RESTRICTED

    - Card is present but not usable due to carrier restrictions.

- enum CardError

    - Defines the reasons for error in CardState

*Values:*

- enumerator UNKNOWN

    - Unknown error

- enumerator POWER\_DOWN

    - Power down

- enumerator POLL\_ERROR

    - Poll error

- enumerator NO\_ATR\_RECEIVED

    - No ATR received

- enumerator VOLT\_MISMATCH

    - Volt mismatch

- enumerator PARITY\_ERROR

    - Parity error

- enumerator POSSIBLY\_REMOVED

    - Unknown, possibly removed

- enumerator TECHNICAL\_PROBLEMS

    - Card returned technical problems

- enumerator NULL\_BYTES

    - Card returned NULL bytes

- enumerator SAP\_CONNECTED

    - Terminal in SAP mode

- enumerator CMD\_TIMEOUT

    - Command timeout error

- enum CardLockType

    - Defines all types of card locks which uses in PIN management APIs

*Values:*

- enumerator PIN1

    - Lock type is PIN1

- enumerator PIN2

    - Lock type is PIN2

- enumerator PUK1

    - Lock type is Pin Unblocking Key1

- enumerator PUK2

    - Lock type is Pin Unblocking Key2

- enumerator FDN

    - Lock type is Fixed Dialing Number

- enum AppType

    - Defines all type of UICC application such as SIM, RUIM, USIM, CSIM and ISIM.

*Values:*

- enumerator APPTYPE\_UNKNOWN

    - Unknown application type

- enumerator APPTYPE\_SIM

    - UICC application type is SIM

- enumerator APPTYPE\_USIM

    - UICC application type is USIM

- enumerator APPTYPE\_RUIM

    - UICC application type is RSIM

- enumerator APPTYPE\_CSIM

    - UICC application type is CSIM

- enumerator APPTYPE\_ISIM

    - UICC application type is ISIM

- enum AppState

    - Defines all application states.

*Values:*

- enumerator APPSTATE\_UNKNOWN

    - Unknown application state

- enumerator APPSTATE\_DETECTED

    - Application state is detected

- enumerator APPSTATE\_PIN

    - If PIN1 or UPin is required

- enumerator APPSTATE\_PUK

    - If PUK1 or Puk for UPin is required

- enumerator APPSTATE\_SUBSCRIPTION\_PERSO

    - PersoSubstate should be look at when application state is assigned to this value

- enumerator APPSTATE\_READY

    - Application state is ready

- enumerator APPSTATE\_ILLEGAL

    - Application state is illegal

- enum EfType

    - Defines supported elementary file(EF) types.

*Values:*

- enumerator UNKNOWN

    - Unknown EF type

- enumerator TRANSPARENT

    - Transparent EF

- enumerator LINEAR\_FIXED

    - Linear Fixed EF

- enum SapState

    - Defines all SIM access profile (SAP) connection states.

*Values:*

- enumerator SAP\_STATE\_NOT\_ENABLED

    - SAP connection not enabled

- enumerator SAP\_STATE\_CONNECTING

    - SAP State is connecting

- enumerator SAP\_STATE\_CONNECTED\_SUCCESSFULLY

    - SAP connection is successful

- enumerator SAP\_STATE\_CONNECTION\_ERROR

    - SAP connection error

- enumerator SAP\_STATE\_DISCONNECTING

    - SAP state is disconnecting

- enumerator SAP\_STATE\_DISCONNECTED\_SUCCESSFULLY

    - SAP state disconnection is successful

- enum SapCondition

    - Indicates type of connection required, default behavior is to block a SAP connection when a voice or data call is active.

*Values:*

- enumerator SAP\_CONDITION\_BLOCK\_VOICE\_OR\_DATA

    - Block a SAP connection when a voice or data call is active (Default)

- enumerator SAP\_CONDITION\_BLOCK\_DATA

    - Block a SAP connection when a data call is active

- enumerator SAP\_CONDITION\_BLOCK\_VOICE

    - Block a SAP connection when a voice call is active

- enumerator SAP\_CONDITION\_BLOCK\_NONE

    - Allow Sap connection in all cases

- class ICardApp

    - Represents a single card application.

Public Functions

- virtual [AppType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga883fc8497a98170b6d1fbefea8a5a43d.html#_CPPv4N5telux3tel7AppTypeE) getAppType() = 0

    - Get Application type like SIM, USIM, RUIM, CSIM or ISIM.

- Returns:

    - [AppType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga883fc8497a98170b6d1fbefea8a5a43d.html#a00014_1ga883fc8497a98170b6d1fbefea8a5a43d).

- virtual [AppState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga6f2e13d90c589973b815deab1a6b2454.html#_CPPv4N5telux3tel8AppStateE) getAppState() = 0

    - Get Application state like PIN1, PUK required and others.

- Returns:

    - [AppState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga6f2e13d90c589973b815deab1a6b2454.html#a00014_1ga6f2e13d90c589973b815deab1a6b2454).

- virtual std::string getAppId() = 0

    - Get application identifier.

- Returns:

    - Application Id.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) changeCardPassword([CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#_CPPv4N5telux3tel12CardLockTypeE) lockType, std::string oldPwd, std::string newPwd, [PinOperationResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga2902300917d20b5f7caceed361c9b072.html#_CPPv4N5telux3tel22PinOperationResponseCbE) callback) = 0

    - Change the password used in PIN1/PIN2 lock.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_PRIVILEGED\_OPS permission to invoke this API successfully.

- Parameters:

    - - **lockType** – **[in]** [CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112). Applicable lock types are PIN1 and PIN2.
- **oldPwd** – **[in]** Old password
- **newPwd** – **[in]** New password
- **callback** – **[in]** Callback function to get the response of change pin password.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) unlockCardByPuk([CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#_CPPv4N5telux3tel12CardLockTypeE) lockType, std::string puk, std::string newPin, [PinOperationResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga2902300917d20b5f7caceed361c9b072.html#_CPPv4N5telux3tel22PinOperationResponseCbE) callback) = 0

    - Unlock the Sim card for an app by entering PUK and new pin.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_PRIVILEGED\_OPS permission to invoke this API successfully.

- Parameters:

    - - **lockType** – **[in]** [CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112). Applicable lock types are PUK1 and PUK2
- **puk** – **[in]** PUK1/PUK2
- **newPin** – **[in]** New PIN1/PIN2
- **callback** – **[in]** Callback function to get the response of unlock card lock.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) unlockCardByPin([CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#_CPPv4N5telux3tel12CardLockTypeE) lockType, std::string pin, [PinOperationResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga2902300917d20b5f7caceed361c9b072.html#_CPPv4N5telux3tel22PinOperationResponseCbE) callback) = 0

    - Unlock the Sim card for an app by entering PIN.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_PRIVILEGED\_OPS permission to invoke this API successfully.

- Parameters:

    - - **lockType** – **[in]** [CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112). Applicable lock types are PIN1 and PIN2.
- **pin** – **[in]** New PIN1/PIN2
- **callback** – **[in]** Callback function to get the response of unlock card lock.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) queryPin1LockState([QueryPin1LockResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga317255e4c7ad5713202daf18e193708f.html#_CPPv4N5telux3tel23QueryPin1LockResponseCbE) callback) = 0

    - Query Pin1 lock state.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Callback function to get the response of query pin1 lock state.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) queryFdnLockState([QueryFdnLockResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1gaaca9c820ee3075ba716fb35b4089474c.html#_CPPv4N5telux3tel22QueryFdnLockResponseCbE) callback) = 0

    - Query FDN lock state.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Callback function to get the response of query fdn lock state.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) setCardLock([CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#_CPPv4N5telux3tel12CardLockTypeE) lockType, std::string password, bool isEnabled, [PinOperationResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga2902300917d20b5f7caceed361c9b072.html#_CPPv4N5telux3tel22PinOperationResponseCbE) callback) = 0

    - Enable or disable FDN or Pin1 lock.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_PRIVILEGED\_OPS permission to invoke this API successfully.

- Parameters:

    - - **lockType** – **[in]** [CardLockType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112.html#a00014_1gaa136ad7e02a8e2dbfd983cb81a0b1112). Applicable lock type such as PIN1 and FDN
- **password** – **[in]** Password of PIN1 and FDN
- **isEnabled** – **[in]** If true then enable else disable.
- **callback** – **[in]** Callback function to get the response of set card lock.

- inline virtual ~ICardApp()

    -

- struct IccResult

    - The APDU response with status for transmit APDU operation.

Public Functions

- inline const std::string toString() const

    -

Public Members

- int sw1

    - Status word 1 for command processing status

- int sw2

    - Status word 2 for command processing qualifier

- std::string payload

    - response as a hex string

- std::vector&lt;int&gt; data

    - vector of raw data received as part of response to the card services request

- struct FileAttributes

    - SIM Elementary file attributes.

Public Members

- uint16\_t fileSize

    - File size of transparent or linear fixed file.

- uint16\_t recordSize

    - Size of the file record. Applicable only for
    Copy to clipboard

 telux::tel::EfType::LINEAR\_FIXED.

- uint16\_t recordCount

    - The number of records in a file. Applicable only for
    Copy to clipboard

 telux::tel::EfType::LINEAR\_FIXED.

- class ICardFileHandler

    - [ICardFileHandler](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00650) provides APIs for reading from an elementary file(EF) on SIM and writing to EF on SIM. Provide API to get EF attributes like file size, record size, and the number of records in EF.

Public Functions

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) readEFLinearFixed(std::string filePath, uint16\_t fileId, int recordNum, std::string aid, [EfOperationCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga4b8f56e6f532f3357d886ce8d4c70c5b.html#_CPPv4N5telux3tel19EfOperationCallbackE) callback) = 0

    - Read a record from a SIM linear fixed elementary file (EF).

- Parameters:

    - - **filePath** – **[in]** File path of the elementary file to be read Refer ETSI GTS GSM 11.11 V5.3.0 6.5. For example to read EF FDN corresponding to USIM app the file path is “3F007FFF”
- **fileId** – **[in]** Elementary file identifier. For example File Id for EF FDN is 0x6F3B
- **recordNum** – **[in]** Record number is 1-based (not 0-based)
- **aid** – **[in]** Application identifier is optional for reading EF that is not part of card application
- **callback** – **[in]** Callback function to get the response of readEFLinearFixed request

- Returns:

    - - Status of readEFLinearFixed i.e. success or suitable status code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) readEFLinearFixedAll(std::string filePath, uint16\_t fileId, std::string aid, [EfReadAllRecordsCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga4bcb0b686fce29d1152f328e5aea1f08.html#_CPPv4N5telux3tel24EfReadAllRecordsCallbackE) callback) = 0

    - Read all records from a SIM linear fixed elementary file (EF).

- Parameters:

    - - **filePath** – **[in]** File path of the elementary file to be read Refer ETSI GTS GSM 11.11 V5.3.0 6.5. For example to read EF FDN corresponding to USIM app the file path is “3F007FFF”
- **fileId** – **[in]** Elementary file identifier. For example File Id for EF FDN is 0x6F3B
- **aid** – **[in]** Application identifier is optional for reading EF that is not part of card application
- **callback** – **[in]** Callback function to get the response of readEFLinearFixedAll request

- Returns:

    - - Status of readEFLinearFixedAll i.e. success or suitable status code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) readEFTransparent(std::string filePath, uint16\_t fileId, int size, std::string aid, [EfOperationCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga4b8f56e6f532f3357d886ce8d4c70c5b.html#_CPPv4N5telux3tel19EfOperationCallbackE) callback) = 0

    - Read from a SIM transparent elementary file (EF).

- Parameters:

    - - **filePath** – **[in]** File path of the elementary file to be read Refer ETSI GTS GSM 11.11 V5.3.0 6.5. For example to read EF ICCID the file path is “3F00”
- **fileId** – **[in]** Elementary file identifier. For example File Id for EF ICCID is 0x2FE2
- **size** – **[in]** If the size is zero then read the complete file otherwise, read the first size bytes from EF.
- **aid** – **[in]** Application identifier is optional for reading EF that is not part of card application
- **callback** – **[in]** Callback function to get the response of readEFTransparent request

- Returns:

    - - Status of readEFTransparent i.e. success or suitable status code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) writeEFLinearFixed(std::string filePath, uint16\_t fileId, int recordNum, std::vector&lt;uint8\_t&gt; data, std::string pin2, std::string aid, [EfOperationCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga4b8f56e6f532f3357d886ce8d4c70c5b.html#_CPPv4N5telux3tel19EfOperationCallbackE) callback) = 0

    - Write a record in a SIM linear fixed elementary file (EF).

- Parameters:

    - - **filePath** – **[in]** File path of the elementary file to be written. Refer ETSI GTS GSM 11.11 V5.3.0 6.5. For example to update record to EF FDN corresponding to USIM app the file path is “3F007FFF”
- **fileId** – **[in]** Elementary file identifier. For example File Id for EF FDN is 0x6F3B
- **recordNum** – **[in]** Record number is 1-based (not 0-based)
- **data** – **[in]** Data represents record in the EF
- **pin2** – **[in]** Pin2 for card holder verification(CHV2) operations, otherwise must be empty.
- **aid** – **[in]** Application identifier is optional for writing to EF that is not part of card application.
- **callback** – **[in]** Callback function to get the response of writeEFLinearFixed request

- Returns:

    - - Status of writeEFLinearFixed i.e. success or suitable status code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) writeEFTransparent(std::string filePath, uint16\_t fileId, std::vector&lt;uint8\_t&gt; data, std::string aid, [EfOperationCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga4b8f56e6f532f3357d886ce8d4c70c5b.html#_CPPv4N5telux3tel19EfOperationCallbackE) callback) = 0

    - Write in a SIM transparent elementary file (EF).

- Parameters:

    - - **filePath** – **[in]** File path of the elementary file to be written Refer ETSI GTS GSM 11.11 V5.3.0 6.5. For example to write to EF ICCID the file path is “3F00”
- **fileId** – **[in]** Elementary file identifier. For example File Id for EF ICCID is 0x2FE2
- **data** – **[in]** Binary data to be written on the EF
- **aid** – **[in]** Application identifier is optional for writing to EF that is not part of card application.
- **callback** – **[in]** Callback function to get the response of writeEFTransparent request

- Returns:

    - - Status of writeEFTransparent i.e. success or suitable status code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestEFAttributes([EfType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaceb634e733c69a8c87d4b4d4169c17d2.html#_CPPv4N5telux3tel6EfTypeE) efType, std::string filePath, uint16\_t fileId, std::string aid, [EfGetFileAttributesCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1gaec6b67a9b9ee1d9cb442550231dcd94c.html#_CPPv4N5telux3tel27EfGetFileAttributesCallbackE) callback) = 0

    - Get file attributes for SIM elementary file(EF).

- Parameters:

    - - **efType** – **[in]** Elementary file type i.e. [telux::tel::EfType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaceb634e733c69a8c87d4b4d4169c17d2.html#a00014_1gaceb634e733c69a8c87d4b4d4169c17d2)
- **filePath** – **[in]** File path of the elementary file to read file attributes Refer ETSI GTS GSM 11.11 V5.3.0 6.5. For example to read file attributes of EF ICCID the file path is “3F00”
- **fileId** – **[in]** Elementary file identifier. For example File Id for EF ICCID is 0x2FE2
- **aid** – **[in]** Application identifier is optional for EF that is not part of card application.
- **callback** – **[in]** Callback function to get the response of requestEFAttributes request

- Returns:

    - - Status of requestEFAttributes i.e. success or suitable status code

- virtual [SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) getSlotId() = 0

    - Get associated slot identifier for [ICardFileHandler](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00650)

- Returns:

    - telux::common::SlotId

- inline virtual ~ICardFileHandler()

    -

- class ICardManager

    - [ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651) provide APIs for slot count, retrieve slot ids, get card state and get card.

Public Functions

- virtual bool isSubsystemReady() = 0

    - Checks the status of telephony subsystems and returns the result.

Deprecated Use [ICardManager::getServiceStatus()](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651_1a4ca7151cb84cd967e69bd3c207d19706) API.

- Returns:

    - If true then CardManager is ready for service.

- virtual std::future&lt;bool&gt; onSubsystemReady() = 0

    - Wait for telephony subsystem to be ready.

Deprecated Use InitResponseCb in [PhoneFactory::getCardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/phone.html#a00732_1add4a8a961cfb693677cf2e4eef6784ef) instead, to get notified about subsystem readiness.

- Returns:

    - A future that caller can wait on to be notified when card manager is ready.

- virtual telux::common::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

    - This status indicates whether the [ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651) object is in a usable state.

- Returns:

    - SERVICE\_AVAILABLE - If Card Manager is ready for service. SERVICE\_UNAVAILABLE - If Card Manager is temporarily unavailable. SERVICE\_FAILED - If Card Manager encountered an irrecoverable failure.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getSlotCount(int &count) = 0

    - Get SIM slot count.

- Parameters:

    - **count** – **[out]** SIM slot count.

- Returns:

    - Status of getSlotCount i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getSlotIds(std::vector&lt;int&gt; &slotIds) = 0

    - Get list of SIM slots.

- Parameters:

    - **slotIds** – **[out]** List of SIM slot ids.

- Returns:

    - Status of getSlotIds i.e. success or suitable status code.

- virtual std::shared\_ptr&lt;[ICard](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00652.html#_CPPv4N5telux3tel5ICardE)&gt; getCard(int slotId = [DEFAULT\_SLOT\_ID](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv4N6SlotId15DEFAULT_SLOT_IDE), telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) \*status = nullptr) = 0

    - Get the Card corresponding to SIM slot.

- Parameters:

    - - **slotId** – **[in]** Slot id corresponding to the card.
- **status** – **[out]** Status of getCard i.e. success or suitable status code.

- Returns:

    - Pointer to [ICard](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00652) object.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) cardPowerUp([SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) slotId, telux::common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Power on the SIM card.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_POWER permission to invoke this API successfully.

- Parameters:

    - - **slotId** – **[in]** Slot identifier corresponding to the card which needs to be powered up.
- **callback** – **[in]** Optional callback pointer to get the result of cardPowerUp

- Returns:

    - Status of cardPowerUp i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) cardPowerDown([SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) slotId, telux::common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Power off the SIM card. When the SIM card is powered down, the card state is absent and the SIM IO operations, PIN management API’s like unlock card by pin, change card pin will fail.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_POWER permission to invoke this API successfully.

- Parameters:

    - - **slotId** – **[in]** Slot identifier corresponding to the card which needs to be powered down.
- **callback** – **[in]** Optional callback pointer to get the result of CardPowerDown

- Returns:

    - Status of cardPowerDown i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) setupRefreshConfig([SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) slotId, bool isRegister, bool doVoting, std::vector&lt;[IccFile](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00647.html#_CPPv4N5telux3tel7IccFileE)&gt; efFiles, [RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#_CPPv4N5telux3tel13RefreshParamsE) refreshParams, common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Register and deregister for refresh events from card and optionally allow client to participate in voting. The client is notified to participate in voting through [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff) with telux::tel::RefreshStage::WAITING\_FOR\_VOTES. The client must then invoke the allowCardRefresh API to permit the refresh. For the refresh procedure to continue, all clients participating in the voting must allow the refresh, if any client disallows it, the refresh process will fail and be communicated to the card. The API also allow to register for file change notification triggered due to change in EFs in the card application. This API can be invoked multiple times to register with different session types, as specified in [telux::tel::SessionType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00033_1ac95386f094f2e6b6361e1ef8a4d719fe.html#a00033_1ac95386f094f2e6b6361e1ef8a4d719fe). If the API is invoked twice with the same session type, the new values will overwrite the previous ones.

On platforms with access control enabled, the caller must have the TELUX\_TEL\_CARD\_REFRESH and TELUX\_TEL\_CARD\_REFRESH\_VOTING permission to successfully invoke this API.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - - **slotId** – **[in]** Slot identifier corresponding to the card which needs to be refreshed.
- **isRegister** – **[in]** If true register for refresh events to be received through [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff), otherwise, deregister for refresh events that will not be delivered.
- **doVoting** – **[in]** If true, then participate in voting to allow refresh procedure otherwise do not participate.
- **efFiles** – **[in]** List of the elementary file path and identifier, and this parameter only needs to be set to get refresh events for refresh modes such as telux::tel::RefreshMode::INIT, telux::tel::RefreshMode::FCN and telux::tel::RefreshMode::INIT\_FULL\_FCN.
- **refreshParams** – **[in]** Session type [telux::tel::RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#a00648). Client provides the session type, application identifier to listen for the corresponding refresh event.
- **callback** – **[in]** Optional callback pointer to get the result of setupRefreshConfig

- Returns:

    - Status of setupRefreshConfig i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) allowCardRefresh([SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) slotId, bool allowRefresh, [RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#_CPPv4N5telux3tel13RefreshParamsE) refreshParams, common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Allow or disallow the initiation of the card refresh procedure. This function enables the client to vote on whether it is acceptable to start the refresh procedure. The refresh will only commence once all registered clients (on HLOS or modem) have voted in favor of starting. This API should only be used after the client receives the card refresh notification via [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff), which indicates the stage of waiting for approval to refresh (telux::tel::RefreshStage::WAITING\_FOR\_VOTES). This API must be called within a specified time frame (default is 10 seconds) using allowRefresh(true) after receiving the notification, otherwise, the modem will consider the refresh as failed, and the client will be notified of the failure through the card refresh failure notification via [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff) and telux::tel::RefreshStage::ENDED\_WITH\_FAILURE after the timer in modem expires.

On platforms with access control enabled, the caller must have the TELUX\_TEL\_CARD\_REFRESH\_VOTING permission to successfully invoke this API.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - - **slotId** – **[in]** Slot identifier corresponding to the card which needs to be refreshed.
- **allowRefresh** – **[in]** If true, allow the SIM refresh otherwise, disallow it.
- **refreshParams** – **[in]** Session type [telux::tel::RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#a00648). Client provides the session type, application identifier to listen for the corresponding refresh event.
- **callback** – **[in]** Optional callback pointer to get the result of allowCardRefresh

- Returns:

    - Status of allowCardRefresh i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) confirmRefreshHandlingCompleted([SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) slotId, bool isCompleted, [RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#_CPPv4N5telux3tel13RefreshParamsE) refreshParams, common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Indicates that the card refresh procedure is completed from the client application’s perspective to the modem. This API should only be used after the client receives the card refresh notification via [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff), which indicates the stage of starting the refresh procedure(telux::tel::RefreshStage::STARTING) and the client has invalidated the cache or reread the cache for the session type. This API must be called within a specified time frame (default is 120 seconds) after receiving the notification, otherwise, the modem will consider the refresh as failed, and the client will be notified of the failure through the card refresh failure notification via [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff) and telux::tel::RefreshStage::ENDED\_WITH\_FAILURE after the timer in modem expires.

Below table describes describes the session type and refresh mode in which the client needs to call this API after the stage of starting the refresh (telux::tel::RefreshStage::STARTING).

Mode \* Stage

*WAIT      *                                  *
      *FOR_VOTES *           STARTING               *
    Copy to clipboard

FCN \* Vote if \* Reread the files (EFs) being \*

- it is OK \* refreshed and then invoke the \*
- to \* [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651) \*
- continue \* ::confirmRefreshHandlingCompleted\* with the \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Init \* refresh. \* Provisioning session: Invalidate \*
- \* all cached values. \*
- \* Nonprovisioning session: Reread \*
- \* the files (EFs), and then invoke \*
- \* the [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\*
- \* ::confirmRefreshHandlingCompleted\*

    Init + \* \* Provisioning session:Invalidate \* FCN \* \* cached values of files (EFs) in \*
- \* the FCN list. \*
- \* Nonprovisioning session: Reread \*
- \* the files (EFs) in the FCN list, \*
- \* and then invoke the \*
- \* [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651) \*
- \* ::confirmRefreshHandlingCompleted\*

    Init + \* \* Provisioning session: Invalidate \* Full \* \* all cached values. \* FCN \* \* Nonprovisioning session: Reread \*
- \* the files (EFs), and then invoke \*
- \* the [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\*
- \* ::confirmRefreshHandlingCompleted\*

    App \* \* Provisioning session: Invalidate \* reset \* \* all cached values. \*
- \* Nonprovisioning session: invoke \*
- \* the [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\*
- \* ::confirmRefreshHandlingCompleted\*
- \* and wait for End Stage. \*
- \* Provisioning session: Wait for \*
- \* the application state to be Ready\*
- \* or End Stage. \*

    3G \* \* Delete all cached values. \* session\* \* Nonprovisioning session: invoke \* reset \* \* the

[telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\*
- \* ::confirmRefreshHandlingCompleted\*

On platforms with access control enabled, the caller must have the TELUX\_TEL\_CARD\_REFRESH permission to successfully invoke this API.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - - **slotId** – **[in]** Slot identifier corresponding to the card which needs to be refreshed.
- **isCompleted** – **[in]** If true, the refresh handling is completed; otherwise, it is not completed due to an error in invalidating the cache or rereading the files.
- **refreshParams** – **[in]** Session type [telux::tel::RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#a00648). Client provides the session type, application identifier to listen for the corresponding refresh event.
- **callback** – **[in]** Optional callback pointer to get the result of confirmRefreshHandlingCompleted

- Returns:

    - Status of confirmRefreshHandlingCompleted i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestLastRefreshEvent([SlotId](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00074_1a04bc541ec544188a3bc649001a8a0111.html#_CPPv46SlotId) slotId, [RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#_CPPv4N5telux3tel13RefreshParamsE) refreshParams, [refreshLastEventResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga12a40914670f90136fc9c63a2f101332.html#_CPPv4N5telux3tel32refreshLastEventResponseCallbackE) callback) = 0

    - Provides ability to retrieve content similar to that previously received on [telux::tel::ICardListener::onRefreshEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655_1ad8bee80693e1c29a37f5801561e07cff).

On platforms with access control enabled, the caller must have the TELUX\_TEL\_CARD\_REFRESH permission to successfully invoke this API.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - - **slotId** – **[in]** Slot identifier corresponding to the card which needs to be refreshed.
- **refreshParams** – **[in]** Session type [telux::tel::RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#a00648). Client provides the session type, application identifier to listen for the corresponding refresh event.
- **callback** – **[in]** Callback function to get the result of request the last event of card refresh.

- Returns:

    - Status of requestLastRefreshEvent i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) registerListener(std::shared\_ptr&lt;[ICardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00655.html#_CPPv4N5telux3tel13ICardListenerE)&gt; listener) = 0

    - Register a listener for card events.

- Parameters:

    - **listener** – **[in]** Pointer to [ICardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655) object that processes the notification.

- Returns:

    - Status of registerListener i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) removeListener(std::shared\_ptr&lt;[ICardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00655.html#_CPPv4N5telux3tel13ICardListenerE)&gt; listener) = 0

    - Remove a previously added listener.

- Parameters:

    - **listener** – **[in]** Pointer to [ICardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00655) object that needs to be removed.

- Returns:

    - Status of removeListener i.e. success or suitable status code.

- inline virtual ~ICardManager()

    -

- class ICard

    - [ICard](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00652) represents currently inserted UICC or eUICC.

Public Functions

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getState([CardState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gabcfbfe07af603ba0d76e9111578f5c4f.html#_CPPv4N5telux3tel9CardStateE) &cardState) = 0

    - Get the card state for the slot id.

- Parameters:

    - **cardState** – **[out]** [CardState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gabcfbfe07af603ba0d76e9111578f5c4f.html#a00014_1gabcfbfe07af603ba0d76e9111578f5c4f) - state of the card.

- Returns:

    - Status of getCardState i.e. success or suitable status code.

- virtual std::vector&lt;std::shared\_ptr&lt;[ICardApp](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00645.html#_CPPv4N5telux3tel8ICardAppE)&gt;&gt; getApplications(telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) \*status = nullptr) = 0

    - Get card applications.

- Parameters:

    - **status** – **[out]** Status of getApplications i.e. success or suitable status code.

- Returns:

    - List of card applications.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) openLogicalChannel(std::string applicationId, std::shared\_ptr&lt;[ICardChannelCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00653.html#_CPPv4N5telux3tel20ICardChannelCallbackE)&gt; callback = nullptr) = 0

    - Open a logical channel to the SIM.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - - **applicationId** – **[in]** Application Id.
- **callback** – **[in]** Optional callback pointer to get the response of open logical channel request.

- Returns:

    - Status of openLogicalChannel i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) closeLogicalChannel(int channelId, std::shared\_ptr&lt;telux::common::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; callback = nullptr) = 0

    - Close a previously opened logical channel to the SIM.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - - **channelId** – **[in]** The channel ID to be closed.
- **callback** – **[in]** Optional callback pointer to get the response of close logical channel request.

- Returns:

    - Status of closeLogicalChannel i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) transmitApduLogicalChannel(int channel, uint8\_t cla, uint8\_t instruction, uint8\_t p1, uint8\_t p2, uint8\_t p3, std::vector&lt;uint8\_t&gt; data, std::shared\_ptr&lt;[ICardCommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00654.html#_CPPv4N5telux3tel20ICardCommandCallbackE)&gt; callback = nullptr) = 0

    - Transmit an APDU to the ICC card over a logical channel.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - - **channel** – **[in]** Channel Id of the channel to use for communication. Has to be greater than zero.
- **cla** – **[in]** Class of the APDU command.
- **instruction** – **[in]** Instruction of the APDU command.
- **p1** – **[in]** Instruction Parameter 1 value of the APDU command.
- **p2** – **[in]** Instruction Parameter 2 value of the APDU command.
- **p3** – **[in]** Number of bytes present in the data field of the APDU command. If p3 is negative, a 4 byte APDU is sent to the SIM.
- **data** – **[in]** Data to be sent with the APDU.
- **callback** – **[in]** Optional callback pointer to get the response of transmit APDU request.

- Returns:

    - Status of transmitApduLogicalChannel i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) transmitApduBasicChannel(uint8\_t cla, uint8\_t instruction, uint8\_t p1, uint8\_t p2, uint8\_t p3, std::vector&lt;uint8\_t&gt; data, std::shared\_ptr&lt;[ICardCommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00654.html#_CPPv4N5telux3tel20ICardCommandCallbackE)&gt; callback = nullptr) = 0

    - Exchange APDUs with the SIM on a basic channel.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - - **cla** – **[in]** Class of the APDU command.
- **instruction** – **[in]** Instruction of the APDU command.
- **p1** – **[in]** Instruction Param1 value of the APDU command.
- **p2** – **[in]** Instruction Param1 value of the APDU command.
- **p3** – **[in]** Number of bytes present in the data field of the APDU command. If p3 is negative, a 4 byte APDU is sent to the SIM.
- **data** – **[in]** Data to be sent with the APDU.
- **callback** – **[in]** Optional callback pointer to get the response of transmit APDU request.

- Returns:

    - Status of transmitApduBasicChannel i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) exchangeSimIO(uint16\_t fileId, uint8\_t command, uint8\_t p1, uint8\_t p2, uint8\_t p3, std::string filePath, std::vector&lt;uint8\_t&gt; data, std::string pin2, std::string aid, std::shared\_ptr&lt;[ICardCommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00654.html#_CPPv4N5telux3tel20ICardCommandCallbackE)&gt; callback = nullptr) = 0

    - Performs SIM IO operation, This is similar to the TS 27.007 “restricted SIM” operation where it assumes all of the EF selection will be done by the callee.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_CARD\_OPS permission to invoke this API successfully.

- Parameters:

    - - **fileId** – **[in]** Elementary File Identifier
- **command** – **[in]** APDU Command for SIM IO operation
- **p1** – **[in]** Instruction Param1 value of the APDU command
- **p2** – **[in]** Instruction Param2 value of the APDU command
- **p3** – **[in]** Number of bytes present in the data field of APDU command. If p3 is negative, a 4 byte APDU is sent to the SIM.
- **filePath** – **[in]** Path of the file
- **data** – **[in]** Data to be sent with the APDU, send empty or null string in case no data
- **pin2** – **[in]** Pin value of the SIM. Invalid attempt of PIN2 value will lock the SIM. send empty or null string in case of no Pin2 value
- **aid** – **[in]** Application identifier, send empty or null string in case of no aid
- **callback** – **[in]** Optional callback pointer to get the response of SIM IO request

- Returns:

    - - Status of exchangeSimIO i.e. success or suitable status code

- virtual int getSlotId() = 0

    - Get associated slot id for [ICard](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00652)

- Returns:

    - SlotId

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestEid([EidResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga9315312bcc227cdf4f4c1bb307afed02.html#_CPPv4N5telux3tel19EidResponseCallbackE) callback) = 0

    - Request eUICC identifier (EID) of eUICC card.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_PRIVATE\_INFO\_READ permission to invoke this API successfully.

- **Dependencies Card should be eUICC capable**
    - 

- Parameters:

    - **callback** – **[in]** Callback function to get the result of request EID.

- Returns:

    - Status of request EID i.e. success or suitable error code.

- virtual std::shared\_ptr&lt;[ICardFileHandler](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00650.html#_CPPv4N5telux3tel16ICardFileHandlerE)&gt; getFileHandler() = 0

    - Get file handler for reading or writing to EF on SIM.

- Returns:

    - [ICardFileHandler](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00650)

- virtual bool isNtnProfileActive() = 0

    - Checks whether the NTN profile is activated on a given slot.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Returns:

    - If true NTN profile is activated or else not-activated.

- inline virtual ~ICard()

    -

- class ICardChannelCallback : public telux::common::[ICommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00279.html#_CPPv4N5telux6common16ICommandCallbackE)

    - Interface for Card callback object. Client needs to implement this interface to get single shot responses for commands like open logical channel and close logical channel.

The methods in callback can be invoked from multiple different threads. The implementation should be thread safe.

Public Functions

- virtual void onChannelResponse(int channel, [IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#_CPPv4N5telux3tel9IccResultE) result, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error) = 0

    - This function is called with the response to the open logical channel operation.

- Parameters:

    - - **channel** – **[in]** Channel Id for the logical channel.
- **result** – **[in]** [IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646) of open logical channel.
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d) of the request.

- class ICardCommandCallback : public telux::common::[ICommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00279.html#_CPPv4N5telux6common16ICommandCallbackE)

    - Public Functions

- virtual void onResponse([IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#_CPPv4N5telux3tel9IccResultE) result, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error) = 0

    - This function is called when SIM Card transmit APDU over Logical, Basic Channel and Exchange Sim IO.

- Parameters:

    - - **result** – **[in]** [IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646) of transmit APDU command
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d) of the request, Possible error codes are

    - telux::common::ErrorCode::SUCCESS
    - telux::common::ErrorCode::INTERNAL
    - telux::common::ErrorCode::NO\_MEMORY
    - telux::common::ErrorCode::INVALID\_ARG
    - telux::common::ErrorCode::MISSING\_ARG

- class ICardListener : public telux::common::[IServiceStatusListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00049.html#_CPPv4N5telux6common22IServiceStatusListenerE)

    - Interface for SIM Card Listener object. Client needs to implement this interface to get access to card services notifications on card state change.

The methods in listener can be invoked from multiple different threads. The implementation should be thread safe.

Public Functions

- inline virtual void onCardInfoChanged(int slotId)

    - This function is called when info of card gets updated.

- Parameters:

    - **slotId** – **[in]** Slot identifier.

- inline virtual void onRefreshEvent(int slotId, [RefreshStage](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00033_1af089e811fc1786b6bba6ed71839659e7.html#_CPPv4N5telux3tel12RefreshStageE) stage, [RefreshMode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00033_1ac40058aaf302fbd2f9ebacffeeb93e9c.html#_CPPv4N5telux3tel11RefreshModeE) mode, std::vector&lt;[IccFile](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00647.html#_CPPv4N5telux3tel7IccFileE)&gt; efFiles, [RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#_CPPv4N5telux3tel13RefreshParamsE) refreshParams)

    - This function is called when a card refresh notification comes from the card.

Below table describes the expected behavior of a client when it receives a refresh indication after registering for it. The behavior depends on the mode and the stage, as indicated in the refresh indication.The refresh will only commence once all registered clients (on HLOS or modem) have voted in favor of starting. On receiving this refresh stage WAIT\_FOR\_VOTES, client is expected to call [telux::tel::ICardManager::allowCardRefresh](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651_1acd4542e85452178cc40d0cc376b6641d) to allow refresh procedure to start.

Mode \* Stage \*

*WAIT      *                                  *                              *
      *FOR_VOTES *           STARTING               *         END SUCCESS          *
                                                                                   *
    Copy to clipboard
Reset \* \* Delete all cached values. The \* This event might be missing. \*
- \* card is reinitialized and its \* The client should look at \*
- \* status is updated. \* the card status and \*
- \* \* application status. \* Vote if \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* FCN \* it is OK \* Reread the files (EFs) being \* No action is required. \*
- to \* refreshed and then invoke the \* \*
- continue \* [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651) \* \*
- with the \* ::confirmRefreshHandlingCompleted\* \* refresh. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Init \* \* Provisioning session: Invalidate \* Provisioning session: Reread \*
- \* all cached values. \* all files (EFs) (if not done \*
- \* Nonprovisioning session: Reread \* when the application state is\*
- \* the files (EFs), and then invoke \* back to Ready). \*
- \* the [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\* \*
- \* ::confirmRefreshHandlingCompleted\* \*

    Init + \* In Init +\* Provisioning session:Invalidate \* Provisioning session: Reread \* FCN \* FCN mode,\* cached values of files (EFs) in \* files (EFs) in the FCN list \*
- client \* the FCN list. \* (if not done when the \*
- receives \* Nonprovisioning session: Reread \* application state is back to \*
- two indi-\* the files (EFs) in the FCN list, \* Ready). \*
- cations \* and then invoke the \* \*
- both \* [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651) \* \*
- requests \* ::confirmRefreshHandlingCompleted\* \*
- vote: one\* \* \*
- for Init \* \* \*
- one for \* \* \*
- FCN. \* \* \*

    Init + \* \* Provisioning session: Invalidate \* Provisioning session: Reread \* Full \* \* all cached values. \* all files (EFs) (if not done \* FCN \* \* Nonprovisioning session: Reread \* when the application state is\*
- \* the files (EFs), and then invoke \* back to Ready). \*
- \* the [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\* \*
- \* ::confirmRefreshHandlingCompleted\* \*

    App \* \* Provisioning session: Invalidate \* Provisioning session: Reread \* reset \* \* all cached values. \* all files (EFs) (if not done \*
- \* Nonprovisioning session: invoke \* when the application state is\*
- \* the [telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\* back to Ready) \*
- \* ::confirmRefreshHandlingCompleted\* Nonprovisioning session: \*
- \* and wait for End Stage. \* Reread all files (EFs). \*
- \* Provisioning session: Wait for \* \*
- \* the application state to be Ready\* \*
- \* or End Stage. \* \*

    3G \* \* Delete all cached values. \* Provisioning session: Reread \* session\* \* Nonprovisioning session: invoke \* all of the files (EFs) \* reset \* \* the

[telux::tel::ICardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00651)\* discarded when the refresh \*
- \* ::confirmRefreshHandlingCompleted\* was started (if not done when\*
- \* \* the application state \*
- \* \* returned to Ready). \*

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - - **slotId** – **[in]** Slot identifier.
- **stage** – **[in]** Card refresh stage RefreshStage
- **mode** – **[in]** Card refresh mode RefreshMode
- **efFiles** – **[in]** List of the elementary file path and identifier
- **refreshParams** – **[in]** Session type [telux::tel::RefreshParams](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00648.html#a00648). Client provides the session type, application identifier to listen for the corresponding refresh event.

- inline virtual ~ICardListener()

    -

- struct CardReaderStatus

    - Structure contains identity of card reader status

Public Members

- int id

    - Card Reader ID

- bool isRemovable

    - Card reader is removable

- bool isPresent

    - Card reader is present

- bool isID1size

    - Card reader present is ID-1 size

- bool isCardPresent

    - Card is present in reader

- bool isCardPoweredOn

    - Card in reader is powered

- class ISapCardManager

    - [ISapCardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00740) provide APIs for SAP related operations.

Public Functions

- virtual bool isReady() = 0

    - Checks the status of SIM access profile(SAP) subsystem and returns the result.

Deprecated Use [ISapCardManager::getServiceStatus()](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00740_1a73a51e38a8c9e38bb1761c81b9ada28f) API.

- Returns:

    - If true then SapCardManager is ready for service.

- virtual std::future&lt;bool&gt; onReady() = 0

    - Wait for IM access profile(SAP) subsystem to be ready.

Deprecated Use InitResponseCb in [PhoneFactory::getSapCardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/phone.html#a00732_1a0858e8d3efd80e098f976d0fb30e1379) instead, to get notified about subsystem readiness.

- Returns:

    - A future that caller can wait on to be notified when card manager is ready.

- virtual telux::common::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

    - This status indicates whether the [ISapCardManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00740) object is in a usable state.

- Returns:

    - SERVICE\_AVAILABLE - If SAP card manager is ready for service. SERVICE\_UNAVAILABLE - If SAP card manager is temporarily unavailable. SERVICE\_FAILED - If SAP card manager encountered an irrecoverable failure.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getState([SapState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa2849d33e59d6928632970acffc4dd26.html#_CPPv4N5telux3tel8SapStateE) &sapState) = 0

    - Get SIM access profile (SAP) client connection state.

Deprecated Use [requestSapState()](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00740_1a87ffa56f0f8205f18eb6cd7b77c6689d) API below to get SAP state

- Parameters:

    - **sapState** – **[out]** [SapState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1gaa2849d33e59d6928632970acffc4dd26.html#a00014_1gaa2849d33e59d6928632970acffc4dd26) of the SIM Card

- Returns:

    - Status of getState i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestSapState([SapStateResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00014_1ga9dd281b11c0df24db62aea62a8bbff93.html#_CPPv4N5telux3tel24SapStateResponseCallbackE) callback) = 0

    - Get SIM access profile(SAP) client connection state.

- Parameters:

    - **callback** – **[out]** Callback function pointer to get the response of requestSapState.

- Returns:

    - Status of requestSapState i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) openConnection([SapCondition](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga79a413f6c29891dad576c670516cab8e.html#_CPPv4N5telux3tel12SapConditionE) sapCondition = [SapCondition](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga79a413f6c29891dad576c670516cab8e.html#_CPPv4N5telux3tel12SapConditionE)::[SAP\_CONDITION\_BLOCK\_VOICE\_OR\_DATA](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00014_1ga79a413f6c29891dad576c670516cab8e.html#_CPPv4N5telux3tel12SapCondition33SAP_CONDITION_BLOCK_VOICE_OR_DATAE), std::shared\_ptr&lt;telux::common::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; callback = nullptr) = 0

    - Establishes SIM access profile (SAP) client connection with SIM Card.

- Parameters:

    - - **sapCondition** – **[in]** Condition to enable sap connection.
- **callback** – **[in]** Optional callback to get the response of open sap connection request or possible error codes i.e.

    - telux::common::ErrorCode::SUCCESS
    - telux::common::ErrorCode::INTERNAL
    - telux::common::ErrorCode::NO\_MEMORY
    - telux::common::ErrorCode::INVALID\_ARG
    - telux::common::ErrorCode::MISSING\_ARG

- Returns:

    - Status of openConnection i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) closeConnection(std::shared\_ptr&lt;telux::common::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; callback = nullptr) = 0

    - Releases a SAP connection to SIM Card.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response of close sap connection request or possible error codes i.e.

- telux::common::ErrorCode::SUCCESS
- telux::common::ErrorCode::INTERNAL
- telux::common::ErrorCode::NO\_MEMORY
- telux::common::ErrorCode::INVALID\_ARG
- telux::common::ErrorCode::MISSING\_ARG

- Returns:

    - Status of closeConnection i.e. success or suitable status code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestAtr(std::shared\_ptr&lt;[IAtrResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00741.html#_CPPv4N5telux3tel20IAtrResponseCallbackE)&gt; callback = nullptr) = 0

    - Request for SAP Answer To Reset command.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response of requestAtr.

- Returns:

    - Status of requestAtr i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) transmitApdu(uint8\_t cla, uint8\_t instruction, uint8\_t p1, uint8\_t p2, uint8\_t lc, std::vector&lt;uint8\_t&gt; data, uint8\_t le = 0, std::shared\_ptr&lt;[ISapCardCommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00742.html#_CPPv4N5telux3tel23ISapCardCommandCallbackE)&gt; callback = nullptr) = 0

    - Send the Apdu on SAP mode.

- Parameters:

    - - **cla** – **[in]** Class of the APDU command.
- **instruction** – **[in]** Instruction of the APDU command.
- **p1** – **[in]** Instruction Parameter 1 value of the APDU command.
- **p2** – **[in]** Instruction Parameter 1 value of the APDU command.
- **lc** – **[in]** Number of bytes present in the data field of the APDU command. If lc is negative, a 4 byte APDU is sent to the SIM.
- **data** – **[in]** List of data to be sent with the APDU.
- **le** – **[in]** Maximum number of bytes expected in the data field of the response to the command.
- **callback** – **[in]** Optional callback to send APDU in SAP mode.

- Returns:

    - Status of transmitApdu i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestSimPowerOff(std::shared\_ptr&lt;telux::common::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; callback = nullptr) = 0

    - Send the SAP SIM power off request.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response for SIM power off.

- Returns:

    - Status of requestSimPowerOff i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestSimPowerOn(std::shared\_ptr&lt;telux::common::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; callback = nullptr) = 0

    - Send the SAP SIM power on request.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response for SIM power on.

- Returns:

    - Status of requestSimPowerOn i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestSimReset(std::shared\_ptr&lt;telux::common::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; callback = nullptr) = 0

    - Send the SAP SIM reset request.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response for SIM reset

- Returns:

    - Status of requestSimReset i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) requestCardReaderStatus(std::shared\_ptr&lt;[ICardReaderCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00743.html#_CPPv4N5telux3tel19ICardReaderCallbackE)&gt; callback = nullptr) = 0

    - Send the SAP Card Reader Status request command.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response for card reader status

- Returns:

    - Status of requestCardReaderStatus i.e. success or suitable status code.

- virtual int getSlotId() = 0

    - Get associated slot id for the SapCardManager.

- Returns:

    - SlotId

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) registerListener(std::shared\_ptr&lt;[ISapCardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00744.html#_CPPv4N5telux3tel16ISapCardListenerE)&gt; listener) = 0

    - Register a listener for SAP events.

- Parameters:

    - **listener** – **[in]** Pointer to [ISapCardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00744) object that processes the notification.

- Returns:

    - Status of registerListener i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) removeListener(std::shared\_ptr&lt;[ISapCardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00744.html#_CPPv4N5telux3tel16ISapCardListenerE)&gt; listener) = 0

    - Remove a previously added listener.

- Parameters:

    - **listener** – **[in]** Pointer to [ISapCardListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#a00744) object that needs to be removed.

- Returns:

    - Status of removeListener i.e. success or suitable status code.

- inline virtual ~ISapCardManager()

    -

- class IAtrResponseCallback : public telux::common::[ICommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00279.html#_CPPv4N5telux6common16ICommandCallbackE)

    - Public Functions

- virtual void atrResponse(std::vector&lt;int&gt; responseAtr, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error) = 0

    - This function is called in response to requestAtr() request.

- Parameters:

    - - **responseAtr** – **[in]** response ATR values
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d) of the request possible error codes are

    - telux::common::ErrorCode::SUCCESS
    - telux::common::ErrorCode::INTERNAL
    - telux::common::ErrorCode::NO\_MEMORY
    - telux::common::ErrorCode::INVALID\_ARG
    - telux::common::ErrorCode::MISSING\_ARG

- class ISapCardCommandCallback : public telux::common::[ICommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00279.html#_CPPv4N5telux6common16ICommandCallbackE)

    - Public Functions

- virtual void onResponse([IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/sim_card_services.html#_CPPv4N5telux3tel9IccResultE) result, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error) = 0

    - This function is called when SIM Card transmit APDU on SAP mode.

- Parameters:

    - - **result** – **[in]** [IccResult](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00646.html#a00646) of transmit APDU command
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d) of the request, possible error codes are

    - telux::common::ErrorCode::SUCCESS
    - telux::common::ErrorCode::INTERNAL
    - telux::common::ErrorCode::NO\_MEMORY
    - telux::common::ErrorCode::INVALID\_ARG
    - telux::common::ErrorCode::MISSING\_ARG

- class ICardReaderCallback : public telux::common::[ICommandCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00279.html#_CPPv4N5telux6common16ICommandCallbackE)

    - Public Functions

- virtual void cardReaderResponse([CardReaderStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00739.html#_CPPv4N5telux3tel16CardReaderStatusE) cardReaderStatus, telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) error) = 0

    - This function is called in response to requestCardReaderStatus() method.

- Parameters:

    - - **cardReaderStatus** – **[in]** Structure contains the identity of the card reader
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d) of the request

- class ISapCardListener : public telux::common::[IServiceStatusListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00049.html#_CPPv4N5telux6common22IServiceStatusListenerE)

    - Interface for SAP Listener object. Client needs to implement this interface to get access to SAP service notifications like service status change.

The methods in listener can be invoked from multiple different threads. The implementation should be thread safe.

Public Functions

- inline virtual ~ISapCardListener()

    -

Last Published: May 20, 2026

[Previous Topic
telux::tel::ISmscAddressCallback](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/sms.md) [Next Topic
Cell broadcast](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/cell_broadcast.md)