> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/android/idevicecontrol.md).

# IDeviceControl

Create an instance of the IDeviceControl using IDevice.getDeviceControl(). Then use the function calls described in this chapter.

Generally, these functions will run in one of two modes:

* Asynchronous functions return data in the event handlers in section
* Synchronous functions return data in the return value. If the data is not available immediately, the call will block until a wait time has elapsed.

## close

This function closes the connection to the device.

```
boolean IDeviceControl.close();
```

Return Value:

Returns true if successful. Otherwise, returns false.

## deviceReset

This function resets the device. This is equivalent to a power reset. After the reset, connection to the device will need to be re-established.

```
boolean IDeviceControl.deviceReset();
```

Return Value:

Returns true if successful. Otherwise, returns false.

## displayMessage

This function displays a message on the device’s screen.

```
boolean IDeviceControl.displayMessage(byte messageID, byte timeout);
```

Parameter

| Description |                                                                    |
| ----------- | ------------------------------------------------------------------ |
| messageID   | Byte array or string data of the image file to send to the device. |
| timeout     | Wait time in seconds.                                              |

Return Value:

Returns true if successful. Otherwise, returns false.

## endSession

This function clears session data and returns the device to an idle state.

```
boolean IDeviceControl.endSession();
```

Return Value:

Returns true if successful. Otherwise, returns false.

## getInput

This function sends a request for user input to the device. The response data will be returned in the event

**OnEvent.**

```
boolean IDeviceControl.getInput(IData data);
```

Parameter

| Description |                                                  |
| ----------- | ------------------------------------------------ |
| data        | Byte array or string data to send to the device. |

Return Value:

Returns true if successful. Otherwise, returns false.

## open

This function opens a connection to the device.

```
boolean IDeviceControl.open();
```

Return Value:

Returns true if successful. Otherwise, returns false.

## playSound

This function instructs the device to play a tone.

```
boolean IDeviceControl.playSound(IData data);
```

Parameter

| Description |                                                  |
| ----------- | ------------------------------------------------ |
| data        | Byte array or string data to send to the device. |

Return Value:

Returns true if successful. Otherwise, returns false.

## send

This function sends a command to the device. The response will be passed to the event OnEvent.

```
boolean IDeviceControl.send(IData data);
```

Parameter

| Description |                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------- |
| data        | Byte array or string data to send to the device. Data must contain the full command as required by the device. |

Return Value:

Returns true if successful. Otherwise, returns false.

## sendExtendedCommand

This function sends an extended command to the device. The response will be passed to the event

**OnEvent**

```
boolean IDeviceControl.sendExtendedCommand(IData data);
```

Parameter

| Description |                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------- |
| data        | Byte array or string data to send to the device. Data must contain the full command as required by the device. |

Return Value:

Returns true if successful. Otherwise, returns false.

## sendNFCPassThroughCommand

This function sends a raw APDU command from the host application to the NFC target while the device is operating in NFC Pass-Through mode. For NFC Type A or Type B using ISO 14443-4 Protocol.

Used for applications that require direct APDU-level communication, such as mDL, secure element transactions, or custom NFC protocols.

```
boolean IDeviceControl.sendNFCPassThroughCommand(IData data);
```

Parameter

| Description |                                                               |
| ----------- | ------------------------------------------------------------- |
| data        | APDU command data to be transmitted to the NFC target device. |

Return Value:

Returns true if successful. Otherwise, returns false.

## sendSync

This function sends a synchronous command to the device. The response from the device will be returned in IResult.

```
IResult IDeviceControl.sendSync(IData data);
```

Parameter

| Description |                                                  |
| ----------- | ------------------------------------------------ |
| data        | Byte array or string data to send to the device. |

Return Value:

Returns IResult.

## setDateTime

This function sets the date and time for the device.

```
boolean IDeviceControl.setDateTime(IData data);
```

Parameter

| Description |                                                  |
| ----------- | ------------------------------------------------ |
| data        | Byte array or string data to send to the device. |

Return Value:

Returns true if successful. Otherwise, returns false.

## setLatch

This function send a command to lock or unlock the card latch. The host can choose to lock the card during EMV transactions to limit the possibility of the cardholder prematurely removing the card. The lock can also be enabled while the card is out of the system to block cardholders from inserting a card.

```
boolean IDeviceControl.setLatch(boolean enableLock);
```

Parameter

| Description |        |
| ----------- | ------ |
| enableLock  | Usage: |

* false – unlock the latch in the device.
* true – lock the latch in the device.

Return Value:

Returns true if successful. Otherwise, returns false.

## setLEDStatus

This function controls the status of the device’s LED indicators (Light Emitting Diode) to provide visual feedback NFC operation states. Applicable after entering NFC Pass-Through mode. The status is reset after exiting NFC Pass-Through mode.

```
Boolean IDeviceControl.setLEDStatus( 
    byte led, 
    byte status);
```

Parameter

| Description |                                                                                                                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| led         | <p>LED number:<br><br>0x00 = LED 1 (Power LED)<br>0x01 = LED 2<br>0x02 = LED 3<br>0x03 = LED 4<br>0xFF = All 4 LEDs<br><br>Where the LEDs are numbered 1, 2, 3, 4 counting from the left.</p> |
| status      | <p>LED Status:<br><br>0x00 = OFF<br>0x01 = GREEN ON<br>0x02 = RED ON</p>                                                                                                                      |

Return Value:

Returns true if successful. Otherwise, returns false.

## setNFCPassThroughMode

This function commands the device to enter NFC Pass-Through Mode. This enables the host application to directly exchange APDU commands and responses with an NFC card or mobile device.

```
boolean IDeviceControl.setNFCPassThroughMode( 
    byte timeout, 
    byte mode);
```

Parameter

| Description |                                                                                                                                                                                                                                                   |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| timeout     | <p>Duration to stay in Pass-Through mode.<br><br>0x00 = Indefinite<br>0x01 to 0xFF = 1 to 255 seconds</p>                                                                                                                                         |
| mode        | <p>Pass-Through mode.<br><br>0x00 = Stop Pass-Through Mode. Applicable only when already started. When stopped, the RF Antenna is turned off.<br>0x01 = Start Pass-Through Mode. This mode can only be used when the device is in Idle state.</p> |

Return Value:

Returns true if successful. Otherwise, returns false.

## setNFCPollingMode

This function configures the NFC reader polling behavior used to detect nearby NFC targets such as cards, mobile devices, or mDL wallets. Applicable after entering the Pass-Through mode.

```
boolean IDeviceControl.setNFCPollingMode( 
    byte timeout, 
    byte mode);
```

Parameter

| Description |                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ |
| timeout     | <p>Duration to stay in Pass-Through mode.<br><br>0x00 = Indefinite<br>0x01 to 0xFF = 1 to 255 seconds</p>                |
| mode        | <p>Polling Mode.<br><br>0x00 = Stop Polling Mode. Applicable only when already started.<br>0x01 = Start Polling Mode</p> |

Return Value:

Returns true if successful. Otherwise, returns false.

## showBarCode

This function sends a command to show a barcode on the device’s display.

```
boolean IDeviceControl.showBarCode( 
    BarCodeRequest request 
    byte timeout 
    IData prompt);
```

Parameter

| Description |                                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| request     | BarCodeRequest object containing the barcode data to display.                                                                                                             |
| timeout     | <p>Display Time. Usage:<br><br>0x00 = Indefinite<br>0x01 to 0xFF = 1 to 255 seconds</p>                                                                                   |
| prompt      | Text to display below the QR code. In Landscape orientation, the limit is approximately 30 characters. In Portrait orientation, the limit is approximately 22 characters. |

#### BarCodeRequest:

| Parameter       | Type          | Description                                                                                                                                                      |
| --------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Type            | BarCodeType   | Enum to specify the type of barcode                                                                                                                              |
| Format          | BarCodeFormat | Enum to specify the barcode format                                                                                                                               |
| Data            | byte\[]       | Data to encode into a barcode                                                                                                                                    |
| BlockColor      | byte\[]       | Block color. Use RRGGBB format. 0x000000 = Black                                                                                                                 |
| BackgroundColor | byte\[]       | Background color. Use RRGGBB format. 0xFFFFFF = White                                                                                                            |
| ErrorCorrection | byte          | <p>Error Correction 0x00 = Low (default) 0x01 = Medium 0x02 = Quartile 0x03 = High<br><br>See ISO/IEC 18004:2015</p>                                             |
| MaskPattern     | byte          | <p>Mask Pattern<br><br>0x00 to 0x07 = Mask Pattern<br><br>0xFF = Device Select Optimal Mask Pattern (default) See ISO/IEC 18004:2015</p>                         |
| MinVersion      | byte          | <p>Minimum Version. Must be less than or equal to Maximum Version. 0x01 to 0x28 = Version 1 to Version 40 (0x01 is default)<br><br>See ISO/IEC 18004:2015</p>    |
| MaxVersion      | byte          | <p>Maximum Version. Must be greater than or equal to Minimum Version. 0x01 to 0x28 = Version 1 to Version 40 (0x28 is default)<br><br>See ISO/IEC 18004:2015</p> |

Return Value:

Returns true if successful. Otherwise, returns false.

## showImage

This function sends a command to immediately show an image on the device’s display.

```
boolean IDeviceControl.showImage(byte imageID);
```

Parameter

| Description |                                                                                                                                                          |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| imageID     | <p>Usage:<br><br>0x01 – show the image at slot 1. 0x02 – show the image at slot 2. 0x03 – show the image at slot 3. 0x04 – show the image at slot 4.</p> |

Return Value:

Returns true if successful. Otherwise, returns false.

## showImage

This function sends a command to immediately show an image on the device’s display.

```
boolean IDeviceControl.showImage( 
    ImageData data 
    byte timeout);
```

Parameter

| Description |                                                                                        |
| ----------- | -------------------------------------------------------------------------------------- |
| data        | See ImageData below.                                                                   |
| timeout     | <p>Display Time Usage:<br><br>0x00 = Indefinite<br>0x01 to 0xFF = 1 to 255 seconds</p> |

### ImageData

| Member          | Type/ Format | Description                                                                        |
| --------------- | ------------ | ---------------------------------------------------------------------------------- |
| type            | ImageType    | <p>Enum for image type. Usage:<br><br>BITMAP = BMP file</p>                        |
| data            | byte\[]      | Image encoded data.                                                                |
| backgroundColor | byte\[3]     | <p>Background color in RRGGBB format. 0x000000 = Black<br><br>0xFFFFFF = White</p> |

Images must be BMP format, 160KB or smaller with no compression, maximum 320px by 240px, with color depth 16 color, 256 color, 16-bit color, or 24-bit color. Images smaller than the maximum size are centered on the display. Note images at full screen size must be 16-bit color or lower to meet the size requirement.

For details see *D998200383 DynaFlex Family Programmer’s Manual (Commands)*.

Return Value:

Returns true if successful. Otherwise, returns false.

## showUIPage

This function displays custom User Interface (UI) pages on devices that support a screen. It holds parameters for all UI page options of Text Lines, Text Buttons, Amount Buttons, and Image. Only one UI page option may be in effect at one time based on the option parameter. See the other subset functions for invoking a specific UI page.

When the UI page is active, the device waits for further action. The device notifies the host when a Button is pressed. Text Buttons and Functional Buttons report as the button number. Amount Buttons report the $ amount in BCD format. A press on a Text line does not produce a report.

```
boolean showUIPage( 
    byte timeout, 
    byte option, 
    byte[] titleStringID, 
    String line1,
    String line2, 
    String line3, 
    String line4, 
    String line5, 
    byte[] stringID1, 
    byte[] stringID2, 
    byte[] stringID3, 
    byte[] stringID4, 
    byte[] stringID5, 
    byte[] stringID6, 
    byte[] amount1, 
    byte[] amount2, 
    byte[] amount3, 
    byte[] amount4, 
    byte[] amount5, 
    byte[] amount6,
    byte[] leftFButtonStringID, 
    byte[] middleFButtonStringID, 
    byte[] rightFButtonStringID, 
    byte leftFButtonColor,
    byte middleFButtonColor, 
    byte rightFButtonColor, 
    byte[] xPosition,
    byte[] yPosition, 
    byte[] imageData);
```

Parameter

| Description |                                                                                                                 |
| ----------- | --------------------------------------------------------------------------------------------------------------- |
| timeout     | Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU |
| option      | UI page option.                                                                                                 |

0x00 = Up to 5 lines of text + 1 functional button Middle.

![](/files/5f66f41f2f70bf0dc548dd330a123d246270a414)

0x01 = Title + up to 6 text buttons + up to 3 functional buttons.

![](/files/6b038d48cfb7e3da94018c805fbf68a2738ce77b)

0x02 = Title + up to 6 $Amount buttons + up to 3 functional buttons.

![](/files/75fa37c9370172b6552172d3b98c5888d4c00009)

0x03 = Title + custom image + 1 functional button Right.

![](/files/7394cd5b8126f6a9f2814e9a2a9d1af790679254)

| Parameter                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| titleStringID\[]              | String ID for the title. See list of display user interface strings. This list may vary according to the device configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| line1 … line5                 | Text string for the line. Terminate with null char. To disable a line, set to empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| stringID1\[2] … stringID6\[2] | Text string ID for buttons 1 to 6. 2-bytes in length. To disable a button, set to null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| amount1\[4] … amount6\[4]     | <p>Value $ Amount in BCD (Binary Coded Decimal) array format for buttons 1 to 6. 4-bytes in length. To disable a button, set to null.<br><br>Byte index:<br><br>· \[0-2] = dollar value<br><br>· \[3] = cents value<br><br>BCD positioning:<br><br>87 65 43 . 21<br><br>0x00 0x00 0x00 0x00<br><br>· 8 – hundred thousand<br>· 7 – ten thousand<br>· 6 – thousand<br>· 5 – hundred<br>· 4 – ten<br>· 3 – one<br>· 2 – 1/tenth<br>· 1 – 1/hundredth<br><br>Range:<br><br>· Min value displayed is $0.00<br>· Max value displayed is $999,999.99<br><br>Example:<br><br>// $0.01<br><br>amount1 = new Byte\[] { 0x00, 0x00, 0x00, 0x01<br><br>};<br><br>//$100,000.23<br><br>amount1 = new Byte\[] { 0x10, 0x00, 0x00, 0x23<br><br>};</p> |
| leftFButtonStringID\[2]       | String ID for the Left functional button. 2-bytes in length. To disable this button, set to null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| middleFButtonStringID\[2]     | String ID for the Middle functional button. 2-bytes in length. To disable this button, set to null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| rightFButtonStringID\[2]      | String ID for the Right functional button. 2-bytes in length. To disable this button, set to null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| leftFButtonColor              | <p>Color of Left functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| middleFButtonColor            | <p>Color of Middle functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| rightFButtonColor             | <p>Color of Right functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| xPosition\[2]                 | <p>X Position for image. 2-bytes in length.<br><br>To display the image in the center of the loading image area, set to null.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| yPosition\[2]                 | <p>Y Position for image. 2-bytes in length.<br><br>To display the image in the center of the loading image area, set to null.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| imageData\[]                  | <p>Bitmap data.<br><br>Image encoded in full BMP file format as defined by Microsoft (e.g,<br><br>starting with “BM”). If no image provided, set to null.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

Return Value:

Returns true if successful. Otherwise, returns false.

## showUIPageWithAmountButtons

This function shows the Amount UI page.

```
boolean showUIPageWithAmountButtons( 
    byte timeout, 
    byte[] titleStringID, 
    String[] buttonAmountList, 
    byte[] leftFButtonStringID, 
    byte[] middleFButtonStringID, 
    byte[] rightFButtonStringID,     
    byte leftFButtonColor, 
    byte middleFButtonColor, 
    byte rightFButtonColor); 
    
boolean showUIPageWithAmountButtons( 
    byte timeout, 
    byte[] titleStringID, 
    String amount1, 
    String amount2, 
    String amount3, 
    String amount4, 
    String amount5, 
    String amount6, 
    byte[] leftFButtonStringID, 
    byte[] middleFButtonStringID, 
    byte[] rightFButtonStringID, 
    byte leftFButtonColor, 
    byte middleFButtonColor, 
    byte rightFButtonColor); 
    
boolean showUIPageWithAmountButtons( 
    byte timeout, 
    byte[] titleStringID, 
    byte[] amount1, 
    byte[] amount2, 
    byte[] amount3, 
    byte[] amount4, 
    byte[] amount5, 
    byte[] amount6, 
    byte[] leftFButtonStringID, 
    byte[] middleFButtonStringID, 
    byte[] rightFButtonStringID, 
    byte leftFButtonColor, 
    byte middleFButtonColor, 
    byte rightFButtonColor);
```

Parameter

| Description               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| timeout                   | Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| titleStringID\[2]         | String ID for the title. 2-bytes in length. See list of display user interface strings. This list may vary according to the device configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| buttonAmountList          | List of $ Amount in BCD string format to display for each button.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| leftFButtonStringID\[2]   | String ID for the Left functional button. 2-bytes in length. To disable this button, set to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| middleFButtonStringID\[2] | String ID for the Middle functional button. 2-bytes in length. To disable this button, set to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| rightFButtonStringID\[2]  | String ID for the Right functional button. 2-bytes in length. To disable this button, set to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| leftFButtonColor          | <p>Color of Left functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| middleFButtonColor        | <p>Color of Middle functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| rightFButtonColor         | <p>Color of Right functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| amount1 … amount6         | <p>Value $ Amount in BCD string format for buttons 1 to 6. 8-characters in length. To disable a button, set to null.<br><br>Range:<br><br>· Min value displayed is $0.00<br>· Max value displayed is $999,999.99<br>· Decimal needed to display cents<br>· Comma not needed<br><br>Example:<br><br>// $0.01<br><br>string sAmount1 = "0.01";<br><br>// $100,000.23<br><br>string sAmount1 = "100000.23";</p>                                                                                                                                                                                                                                                                                                              |
| amount1\[4] … amount6\[4] | <p>Value $ Amount in BCD (Binary Coded Decimal) array format for buttons 1 to 6. 4-bytes in length. To disable a button, set to null.<br><br>Byte index:<br><br>· \[0-2] = dollar value<br><br>· \[3] = cents value<br><br>BCD positioning:<br><br>87 65 43 . 21<br><br>0x00 0x00 0x00 0x00<br><br>· 8 – hundred thousand<br>· 7 – ten thousand<br>· 6 – thousand<br>· 5 – hundred<br>· 4 – ten<br>· 3 – one<br>· 2 – 1/tenth<br>· 1 – 1/hundredth<br><br>Range:<br><br>· Min value displayed is $0.00<br>· Max value displayed is $999,999.99<br><br>Example:<br><br>// $0.01<br><br>amount1 = new Byte\[] { 0x00, 0x00, 0x00, 0x01 };<br><br>//$100,000.23<br><br>amount1 = new Byte\[] { 0x10, 0x00, 0x00, 0x23 };</p> |

Return Value:

Returns true if successful. Otherwise, returns false.

## showUIPageWithImage

This function shows the Image UI page.

```
boolean showUIPageWithImage( 
    byte timeout, 
    byte[] titleStringID, 
    byte[] rightFButtonStringID, 
    byte[] xPosition, 
    byte[] yPosition, 
    byte[] imageData);
```

Parameter

| Description              |                                                                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| timeout                  | Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU                                   |
| titleStringID\[2]        | String ID for the title. 2-bytes in length. See list of display user interface strings. This list may vary according to the device configuration. |
| rightFButtonStringID\[2] | String ID for the Right functional button. 2-bytes in length. To disable this button, set to 0.                                                   |
| xPosition\[2]            | <p>X Position for image. 2-bytes in length.<br><br>To display the image in the center of the loading image area, set to null.</p>                 |
| yPosition\[2]            | <p>Y Position for image. 2-bytes in length.<br><br>To display the image in the center of the loading image area, set to null.</p>                 |
| imageData\[]             | <p>Bitmap data.<br><br>Image encoded in full BMP file format as defined by Microsoft (e.g,<br><br>starting with “BM”).</p>                        |

Return Value:

Returns true if successful. Otherwise, returns false.

## showUIPageWithTextButtons

This function shows the Text buttons UI page.

```
boolean showUIPageWithTextButtons( 
    byte timeout, 
    byte[] titleStringID, 
    byte[] stringID1, 
    byte[] stringID2, 
    byte[] stringID3, 
    byte[] stringID4, 
    byte[] stringID5, 
    byte[] stringID6, 
    byte[] leftFButtonStringID, 
    byte[] middleFButtonStringID, 
    byte[] rightFButtonStringID, 
    byte leftFButtonColor, 
    byte middleFButtonColor, 
    byte rightFButtonColor);
```

Parameter

| Description                    |                                                                                                                                |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| timeout                        | Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU                |
| titleStringID\[2]              | String ID for the title. See list of display user interface strings. This list may vary according to the device configuration. |
| stringID1\[2] to stringID6\[2] | Text string ID for buttons 1 to 6. 2-bytes in length. To disable a button, set to null.                                        |
| leftFButtonStringID\[2]        | String ID for the Left functional button. To disable this button, set to null.                                                 |
| middleFButtonStringID\[2]      | String ID for the Middle functional button. To disable this button, set to null.                                               |
| rightFButtonStringID\[2]       | String ID for the Right functional button. To disable this button, set to null.                                                |
| leftFButtonColor               | <p>Color of Left functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                  |
| middleFButtonColor             | <p>Color of Middle functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                |
| rightFButtonColor              | <p>Color of Right functional button.<br><br>0 = red, 1 = green, 2 = yellow</p>                                                 |

Return Value:

Returns true if successful. Otherwise, returns false.

## showUIPageWithTextLines

This function shows the Text lines UI page.

```
boolean showUIPageWithTextLines( 
    byte timeout, 
    String[] lines, 
    byte[] middleFButtonStringID); 
    
boolean showUIPageWithTextLines( 
    byte timeout, 
    String line1, 
    String line2, 
    String line3, 
    String line4, 
    String line5, 
    byte[] middleFButtonStringID);
```

Parameter

| Description               |                                                                                                                  |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| timeout                   | Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU  |
| lines\[]                  | List of Text strings for lines 1 to 5 in array format. Terminate with null char. To disable a line, set to null. |
| line 1 … line5            | Text string for lines 1 to 5 in string format. Terminate with null char. To disable a line, set to null.         |
| middleFButtonStringID\[2] | String ID for the Middle functional buttons. 2-byte in length. To disable this button, set to null.              |

Return Value:

Returns true if successful. Otherwise, returns false.

## startBarCodeReader

This function sends a command to start the barcode reader.

```
boolean IDeviceControl.startBarCodeReader( 
    byte timeout 
    byte encryptionMode);
```

Parameter

| Description    |                                                                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| timeout        | <p>Time to enable barcode reader. Usage:<br><br>0x00 = Wait until a barcode is read or stopBarCodeReader() is called. 0x01 to 0xFF = 1 to 255 seconds</p> |
| encryptionMode | <p>Encrypt payload Usage:<br><br>0x00 = do not encrypt barcode data 0x01 = encrypt barcode data.</p>                                                      |

Return Value:

Returns true if successful. Otherwise, returns false.

## startCardEmulation

This function sends a command to start card emulation.

* Compliance: Conforms to ISO/IEC 14443 Type-A and NFC Forum Type 4 standards.
* Passive Operation mode: The NFC reader must generate the field to activate the simulated card.
* Read-Only: The emulated card is read-only and does not support writing.
* Supported Data Type: Supports the URI (URL) data type.

```
boolean IDeviceControl.startCardEmulation( 
    byte timeout 
    String data);
```

Parameter

| Description |                                                                                                                         |
| ----------- | ----------------------------------------------------------------------------------------------------------------------- |
| timeout     | <p>Time in seconds.<br><br>0x00 = No timeout or until stopCardEmulation() is called 0x01 to 0xFF = 1 to 255 seconds</p> |
| data        | NFC data to emulate. Limit is <= 254 characters.                                                                        |

Return Value:

Returns true if successful. Otherwise, returns false.

## startPersonalInfoEntry

This function sends a command to prompt a cardholder for customer information. Captured information is later returned in OnEvent() EventType.TouchscreenPersonalInfoEntry.

```
boolean IDeviceControl.startPersonalInfoEntry( 
    CaptureType captureType, 
    bool encrypt);
```

Parameter

| Description |                                                                                       |
| ----------- | ------------------------------------------------------------------------------------- |
| captureType | Enum for the type of information to capture.                                          |
| encrypt     | <p>Encrypt payload<br><br>false = do not encrypt data<br><br>true = encrypt data.</p> |

Return Value:

Returns true if successful. Otherwise, returns false.

## stopBarCodeReader

This function sends a command to stop the barcode reader. This is applicable only when the timeout value for startBarCodeReader() was set to 0x00.

```
boolean IDeviceControl.stopBarCodeReader();
```

Return Value:

Returns true if successful. Otherwise, returns false.

## stopCardEmulation

This function sends a command to stop card emulation.

```
boolean IDeviceControl.stopCardEmulation();
```

Return Value:

Returns true if successful. Otherwise, returns false.

## stopPersonalInfoEntry

This function stops the Personal Info Entry process. If called during info entry, the process will be canceled immediately.

```
boolean IDeviceControl.stopPersonalInfoEntry();
```

Return Value:

Returns true if successful. Otherwise, returns false.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/android/idevicecontrol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
