# Device Library

<table><thead><tr><th width="100">AAR Ver.</th><th width="289">Detail</th><th>Launcher Compatibility Requirements</th></tr></thead><tbody><tr><td>v1.4</td><td>• Added new APIs for retrieving version information: EMV_KERNEL, LINUX_KERNEL, ROOTFS, and EMVCL.</td><td></td></tr><tr><td>v1.5</td><td>• Minor bug fixes applied.</td><td></td></tr><tr><td>v1.6</td><td>• Cyprus PosModeEnum added.</td><td>v1780 or higher</td></tr><tr><td>v.1.7</td><td>• Added new API for retrieving active bank number information: ACTIVE_BANK_NUMBER.</td><td>v1890 or higher</td></tr></tbody></table>

## Introduction

The **DeviceInfoService** enables applications to retrieve detailed device information such as IMEI, IMSI, EMVCL version, fiscal ID, ROOTFS version, and more. It supports both single-field queries and batch requests, providing an easy way to access important device details. The service also allows configuring the terminal and merchant IDs for the application.

## **Integration Guide**

{% file src="/files/Hd2zSxhJyAirZ0isLv11" %}

1. Copy most recent aar lib file into your project.
2. Make sure you include aar lib in your Project. In this example project, it is done in /app/.build.gradle file like this:

```groovy
dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
    ...
}
```

You can access example usage from [example project](https://github.com/TokenPublication/DeviceInfoClientApp/tree/master).

## Definitions

Device Operation Mods;

```java
public enum PosModeEnum {
    VUK507,
    POS,
    GIB,
    ECR,
    EFT_POS,
    RESERVED_0,
    RESERVED_1,
    RESERVED_2,
    RESERVED_3,
    RESERVED_4,
    CY
}
```

The `PosModeEnum` defines various modes representing specific regulatory, functional, and technical implementations for POS systems.

Card Redirection Mods;

```java
public static enum CardRedirect {
    NO,
    YES,
    NOT_ASSIGNED;
}
```

The `CardRedirect` enumeration is used to define the status of card redirection during the payment processing flow, particularly when managing transactions across multiple active bank applications with card routing capabilities. This enumeration is relevant for determining whether a sales transaction is routed to a specific bank application after a contactless card is read. The values in this enum represent the routing behavior as follows:

* **NO** indicates that card redirection is disabled. In this case, the transaction will not be routed to an external bank application and will proceed using the current bank's processing flow.
* **YES** signifies that card redirection is enabled. When a card is read, the payment gateway will route the transaction to the appropriate bank application based on the card routing flow. This could be to a default contactless bank, issuer bank, or brand-specific bank, depending on the routing logic.
* **NOT\_ASSIGNED** represents an undefined or uninitialized state for card redirection. This status is typically used when the card redirection setting has not been configured yet, leaving the routing behavior to be determined at a later stage.

Field Class;

```java
public static class Field
{
    public static final int SECURE_BOARD_VERSION;
    public static final int MODEM_VERSION;
    public static final int FISCAL_ID;
    public static final int IMEI_NUMBER;
    public static final int IMSI_NUMBER;
    public static final int DEVICE_MODE;
    public static final int FISCAL_VERSION;
    public static final int OPERATION_MODE;
    public static final int SERVICE_MODE;
    public static final int CARD_REDIRECTION;
    public static final int GET_EMV_KERNEL_VERSION;
    public static final int GET_LINUX_KERNEL_VERSION;
    public static final int GET_ROOTFS_VERSION;
    public static final int GET_EMVCL_VERSION;
    public static final int ACTIVE_BANK_NUMBER;
}
```

The `Field` class contains constants that represent different fields of device information that can be retrieved through the `DeviceInfoService`. These constants are used when querying specific data points related to the device's configuration and status. The following fields are defined:

* **SECURE\_BOARD\_VERSION** refers to the version of the secure board in the device, which is essential for verifying the integrity and security of the hardware.
* **MODEM\_VERSION** represents the version of the modem in the device, which is useful for identifying the capabilities and compatibility of the device's communication module.
* **FISCAL\_ID** identifies the unique fiscal identifier of the device.
* **IMEI\_NUMBER** corresponds to the International Mobile Equipment Identity (IMEI) number, a unique identifier for the device used for mobile network operations.
* **IMSI\_NUMBER** stands for the International Mobile Subscriber Identity (IMSI) number, which is associated with the SIM card used for network identification.
* **DEVICE\_MODE** indicates the operational mode of the device, which can be development, testing, or production, defining the environment in which the device is currently operating.
* **FISCAL\_VERSION** specifies the version of the fiscal software or system running on the device, which is relevant for ensuring compliance with local fiscal regulations.
* **OPERATION\_MODE** describes the mode in which the device is operating, for payments, administrative tasks, or other specific functionalities.
* **SERVICE\_MODE** represents the service or customer mode of the device, indicating whether the device is operating in a service/maintenance mode or a customer-facing mode for transactions.
* **CARD\_REDIRECTION**  indicates whether card redirection is enabled, determining if payment processing is routed to an external service for handling.
* **GET\_EMV\_KERNEL\_VERSION** specifies the version of the EMV kernel used in the device for processing card transactions.
* **GET\_LINUX\_KERNEL\_VERSION** refers to the version of the Linux kernel running on the device, which is important for understanding the underlying operating system and compatibility.
* **GET\_ROOTFS\_VERSION** indicates the version of the root filesystem on the device, which includes the core system files and configurations.
* **GET\_EMVCL\_VERSION** specifies the version of the EMV Contactless (EMVCL) protocol supported by the device, which is used for contactless card transactions.
* **ACTIVE\_BANK\_NUMBER** Returns the value representing the currently active bank number on the device.

## Functions

### Function List

* [DeviceInfo(Context context)](#deviceinfo-context-context)
* void [getFiscalId(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getfiscalid-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getImeiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getimeinumber-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getImsiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getimsinumber-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getSecureBoardVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getsecureboardversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getModemVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getmodemversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getDeviceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getdevicemode-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getFiscalVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getfiscalversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getOperationMode(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getoperationmode-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getServiceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getservicemode-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getCardRedirection(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getcardredirection-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getEmvKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getemvkernelversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getLinuxKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getlinuxkernelversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getROOTFSVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getrootfsversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getEMVCLVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getemvclversion-deviceinforesponsehandler-deviceinforesponsehandler)
* void[ getActiveBankNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)](#void-getactivebanknumber-deviceinforesponsehandler-deviceinforesponsehandler)
* void [getFields(DeviceInfoMultipleResponseHandler deviceInfoResponseHandler, final int... fields)](#void-getfields-deviceinforesponsehandler-deviceinforesponsehandler)
* void [setAppParams(DeviceInfoAppParamsSetterHandler deviceInfoResponseHandler, final String terminalId, final String merchantId)](#void-setappparams-deviceinfoappparamssetterhandler-deviceinforesponsehandler-final-string-terminalid)

### DeviceInfo(Context context)

The `DeviceInfo` is a constructor function which creates an instance of DeviceInfo class. It is recommended to reuse this instance when possible instead of creating a new one each time.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val deviceInfo = DeviceInfo(this)
```

{% endtab %}

{% tab title="Java" %}

```java
DeviceInfo deviceInfo = new DeviceInfo(this);
```

{% endtab %}
{% endtabs %}

### void getFiscalId(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getFiscalId` function retrieves the fiscal ID from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getFiscalId(object: DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Fiscal ID", result)
    }
    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getFiscalId(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Fiscal ID", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getImeiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getImeiNumber` function retrieves the IMEI from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getImeiNumber(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("IMEI Number", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getImeiNumber(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("IMEI Number", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getImsiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getImsiNumber` function retrieves the IMSI from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getImsiNumber(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("IMSI Number", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getImsiNumber(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("IMSI Number", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getSecureBoardVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getSecureBoardVersion` function retrieves the secure board version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getSecureBoardVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Secure Board Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getSecureBoardVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Secure Board Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getModemVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getModemVersion` function retrieves the modem version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getModemVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Modem Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getModemVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Modem Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getDeviceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getDeviceMode` function retrieves the device mode from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getDeviceMode(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Device Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getDeviceMode(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Device Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getFiscalVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getFiscalVersion` function retrieves the fiscal version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getFiscalVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Fiscal Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getFiscalVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Fiscal Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getOperationMode(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getOperationMode` function retrieves the operation mode from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getOperationMode(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Operation Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getOperationMode(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Operation Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getServiceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getServiceMode` function retrieves the service mode from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getServiceMode(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Service Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getServiceMode(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Service Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getCardRedirection(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getCardRedirection` function retrieves the card redirection mode from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getCardRedirection(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Card Redirection Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getModemVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Card Redirection Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getEmvKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getEmvKernelVersion` function retrieves the EMV kernel version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getEmvKernelVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("EMV Kernel Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getEmvKernelVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Modem Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getLinuxKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getLinuxKernelVersion` function retrieves the linux kernel version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getLinuxKernelVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Linux Kernel Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getLinuxKernelVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Linux Kernel Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getROOTFSVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getROOTFSVersion` function retrieves the ROOTFS version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getModemVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("ROOTFS Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getModemVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("ROOTFS Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getActiveBankNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getActiveBankNumber` function retrieves the value of the currently active bank number on the device.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getActiveBankNumber(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Active Bank Number", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getActiveBankNumber(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Active Bank Number", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getEMVCLVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getEMVCLVersion` function retrieves the EMVCL version from the service.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getEMVCLVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("EMVCL Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getEMVCLVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("EMVCL Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});
```

{% endtab %}
{% endtabs %}

### void getFields(DeviceInfoResponseHandler deviceInfoResponseHandler)

The `getFields` function retrieves multiple fields with a single call.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.getFields(
        { fields ->
            if (fields == null) return
            Log.i("Example 1", "Fiscal ID: " + fields.get(0))
            Log.i("Example 2", "IMEI Number: " + fields.get(1))
            Log.i("Example 3", "IMSI Number: " + fields.get(2))
            Log.i("Example 4", "Secure Board Version: " + fields.get(3))
            Log.i("Example 5", "Modem Version: " + fields.get(4))
            Log.i("Example 6", "Device Mode: " + fields.get(5))
            Log.i("Example 7", "Fiscal Version: " + fields.get(6))
            Log.i("Example 8", "Operation Mode: " + fields.get(7))
            Log.i("Example 9", "Service Mode: " + fields.get(8))
            Log.i("Example 10", "Card Redirection: " + fields.get(9))
            Log.i("Example 11", "EMV Kernel Version: " + fields.get(10))
            Log.i("Example 12", "Linux Kernel Version: " + fields.get(11))
            Log.i("Example 13", "ROOTFS Version: " + fields.get(12))
            Log.i("Example 14", "EMVCL Version: " + fields.get(13))
            Log.i("Example 15", "Active Bank Number: " + fields.get(14))
        },
        DeviceInfo.Field.FISCAL_ID, 
        DeviceInfo.Field.IMEI_NUMBER, 
        DeviceInfo.Field.IMSI_NUMBER, 
        DeviceInfo.Field.SECURE_BOARD_VERSION, 
        DeviceInfo.Field.MODEM_VERSION, 
        DeviceInfo.Field.DEVICE_MODE,
        DeviceInfo.Field.FISCAL_VERSION,
        DeviceInfo.Field.OPERATION_MODE, 
        DeviceInfo.Field.SERVICE_MODE, 
        DeviceInfo.Field.CARD_REDIRECTION, 
        DeviceInfo.Field.GET_EMV_KERNEL_VERSION, 
        DeviceInfo.Field.GET_LINUX_KERNEL_VERSION, 
        DeviceInfo.Field.GET_ROOTFS_VERSION, 
        DeviceInfo.Field.GET_EMVCL_VERSION,
        DeviceInfo.Field.ACTIVE_BANK_NUMBER
)
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.getFields(fields -> {
        if (fields == null) return
            Log.i("Example 1", "Fiscal ID: " + fields[0]);
            Log.i("Example 2", "IMEI Number: " + fields[1]);
            Log.i("Example 3", "IMSI Number: " + fields[2]);
            Log.i("Example 4", "Secure Board Version: " + fields[3]);
            Log.i("Example 5", "Modem Version: " + fields[4]);
            Log.i("Example 6", "Device Mode: " + fields[5]);
            Log.i("Example 7", "Fiscal Version: " + fields[6]);
            Log.i("Example 8", "Operation Mode: " + fields[7]);
            Log.i("Example 9", "Service Mode: " + fields[8]);
            Log.i("Example 10", "Card Redirection: " + fields[9]);
            Log.i("Example 11", "EMV Kernel Version: " + fields[10]);
            Log.i("Example 12", "Linux Kernel Version: " + fields[11]);
            Log.i("Example 13", "ROOTFS Version: " + fields[12]);
            Log.i("Example 14", "EMVCL Version: " + fields[13]);
            Log.i("Example 15", "Active Bank Number: " + fields[14]);
        },
        DeviceInfo.Field.FISCAL_ID, 
        DeviceInfo.Field.IMEI_NUMBER, 
        DeviceInfo.Field.IMSI_NUMBER, 
        DeviceInfo.Field.LYNX_VERSION, 
        DeviceInfo.Field.SECURE_BOARD_VERSION, 
        DeviceInfo.Field.MODEM_VERSION, 
        DeviceInfo.Field.DEVICE_MODE,
        DeviceInfo.Field.FISCAL_VERSION,
        DeviceInfo.Field.OPERATION_MODE, 
        DeviceInfo.Field.SERVICE_MODE, 
        DeviceInfo.Field.CARD_REDIRECTION, 
        DeviceInfo.Field.GET_EMV_KERNEL_VERSION, 
        DeviceInfo.Field.GET_LINUX_KERNEL_VERSION, 
        DeviceInfo.Field.GET_ROOTFS_VERSION, 
        DeviceInfo.Field.GET_EMVCL_VERSION,
        DeviceInfo.Field.ACTIVE_BANK_NUMBER
)
```

{% endtab %}
{% endtabs %}

### void setAppParams(DeviceInfoAppParamsSetterHandler deviceInfoResponseHandler, final String terminalId, final String merchantId)

The `setAppParams` function sets the payment application parameters, such as terminal ID and merchant ID, for the device. The result is returned asynchronously through the provided callback handler.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
deviceInfo.setAppParams(
    object : DeviceInfoAppParamsSetterHandler {
        override fun onReturn(result: Boolean) {
            Log.i("RESULT", result.toString())
        }
    },
    "TERMINAL_ID", "MERCHANT_ID",
)
```

{% endtab %}

{% tab title="Java" %}

```java
deviceInfo.setAppParams(
    new DeviceInfoAppParamsSetterHandler() {
        @Override
        public void onReturn(boolean result) {
            Log.i("RESULT", Boolean.toString(result));
        }
    }, 
    "TERMINAL_ID", "MERCHANT_ID"
);
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.tokeninc.com/token-developer-portal-1/payment-service/system-and-security-services/device-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
