> 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/.net-windows/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 IEventSubscriber Delegate.
* Synchronous functions return data in the return value. If the data is not available immediately, the call will block until the wait time has elapsed.

### close <a href="#id-6.1_close" id="id-6.1_close"></a>

This function closes the connection to the device.

```
bool IDeviceControl.close();
```

Return Value:

Returns true if successful. Otherwise, returns false.

### deviceReset <a href="#id-6.2_devicereset" id="id-6.2_devicereset"></a>

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.

```
bool IDeviceControl.deviceReset();
```

Return Value:

Returns true if successful. Otherwise, returns false.

### displayMessage <a href="#id-6.3_displaymessage" id="id-6.3_displaymessage"></a>

This function displays a predefined message on the device.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="154.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p>messageID</p></td><td valign="top"><p>Value representing the message.</p><p> </p><p>Examples:</p><p>0x00 - reserved, do not use. 0x01 - “AMOUNT”</p><p>0x02 - “AMOUNT OK?”</p><p>0x03 - “APPROVED”</p><p>0x04 - “CALL YOUR BANK”</p><p>0x05 - “CANCEL OR ENTER”</p><p>0x06 - “CARD ERROR”</p><p>0x07 - “DECLINED”</p></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="156.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p>timeout</p></td><td valign="top"><p>Timeout in seconds for the device to display the message.</p><p> </p><p>0x00 = Infinite timeout. Device leaves the requested message on the display until the host initiates a change.</p><p> </p><p>0x01 to 0xFF = Timeout in seconds for the device to display the message.</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### endSession <a href="#id-6.4_endsession" id="id-6.4_endsession"></a>

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

{% code overflow="wrap" %}

```
bool IDeviceControl.endSession();
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### getInput <a href="#id-6.5_getinput" id="id-6.5_getinput"></a>

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

{% code overflow="wrap" %}

```
bool IDeviceControl.getInput();
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### open <a href="#id-6.6_open" id="id-6.6_open"></a>

This function opens a connection to the device.

{% code overflow="wrap" %}

```
bool IDeviceControl.open();
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### playSound <a href="#id-6.7_playsound" id="id-6.7_playsound"></a>

This function instructs the device to play a tone.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="157.6666259765625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">Byte array or string data to send to the device.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### send <a href="#id-6.8_send" id="id-6.8_send"></a>

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

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="135.6666259765625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">Byte array or string data to send to the device. Data must contain the full command as required by the device.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### sendExtendedCommand <a href="#id-6.9_sendextendedcommand" id="id-6.9_sendextendedcommand"></a>

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

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="131" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">Byte array or string data to send to the device. Data must contain the full command as required by the device.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### sendNFCPassThroughCommand <a href="#id-6.10_sendnfcpassthroughcommand" id="id-6.10_sendnfcpassthroughcommand"></a>

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.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="126.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">APDU command data to be transmitted to the NFC target device.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### sendSync <a href="#id-6.11_sendsync" id="id-6.11_sendsync"></a>

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

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="150.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">Byte array or string data to send to the device.</td></tr></tbody></table>

Return Value:

Returns IResult.

### setDateTime <a href="#id-6.12_setdatetime" id="id-6.12_setdatetime"></a>

This function sets the date and time for the device.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="173" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">Byte array or string data to send to the device.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### setLatch <a href="#id-6.13_setlatch" id="id-6.13_setlatch"></a>

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.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="166.3333740234375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">enableLock</td><td valign="top"><p>false = unlock the latch in the device.</p><p>true = lock the latch in the device.</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### setLEDStatus <a href="#id-6.14_setledstatus" id="id-6.14_setledstatus"></a>

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.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="153" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p>led</p></td><td valign="top"><p>LED number:</p><ul><li>0x00 = LED 1 (Power LED)</li><li>0x01 = LED 2</li><li>0x02 = LED 3</li><li>0x03 = LED 4</li><li>0xFF = All 4 LEDs</li></ul><p> </p><p>Where the LEDs are numbered 1, 2, 3, 4 counting from the left.</p></td></tr><tr><td valign="top"><p> </p><p>status</p></td><td valign="top"><p>LED Status:</p><ul><li>0x00 = OFF</li><li>0x01 = GREEN ON</li><li>0x02 = RED ON</li></ul></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### setNFCPassThroughMode <a href="#id-6.15_setnfcpassthroughmode" id="id-6.15_setnfcpassthroughmode"></a>

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.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="149.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top"><p>Duration to stay in Pass-Through mode.</p><ul><li>0x00 = Indefinite</li><li>0x01 to 0xFF = 1 to 255 seconds</li></ul></td></tr><tr><td valign="top"><p> </p><p> </p><p>mode</p></td><td valign="top"><p>Pass-Through mode.</p><p>0x00 = Stop Pass-Through Mode. Applicable only when already started. When stopped, the RF Antenna is turned off.</p><p> </p><p>0x01 = Start Pass-Through Mode. This mode can only be used when the device is in Idle state.</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### setNFCPollingMode <a href="#id-6.16_setnfcpollingmode" id="id-6.16_setnfcpollingmode"></a>

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.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="133" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top"><p>Duration to stay in Pass-Through mode.</p><ul><li>0x00 = Indefinite</li><li>0x01 to 0xFF = 1 to 255 seconds</li></ul></td></tr><tr><td valign="top"><p> </p><p>mode</p></td><td valign="top"><p>Polling Mode.</p><ul><li>0x00 = Stop Polling Mode. Applicable only when already started.</li><li>0x01 = Start Polling Mode</li></ul></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showBarCode <a href="#id-6.17_showbarcode" id="id-6.17_showbarcode"></a>

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

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="127.6666259765625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">request</td><td valign="top">BarCodeRequest object containing the barcode data to display.</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top"><p>Display Time.</p><p>0x00 = Indefinite</p><p>0x01 to 0xFF = 1 to 255 seconds</p></td></tr><tr><td valign="top"><p> </p><p>prompt</p></td><td valign="top">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.</td></tr></tbody></table>

**BarCodeRequest**

<table data-header-hidden><thead><tr><th width="170" valign="top"></th><th width="168.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">Type</td><td valign="top">BarCodeType</td><td valign="top">Enum to specify the type of barcode</td></tr><tr><td valign="top">Format</td><td valign="top">BarCodeFormat</td><td valign="top">Enum to specify the barcode format</td></tr><tr><td valign="top">Data</td><td valign="top">byte[]</td><td valign="top">Data to encode into a barcode</td></tr><tr><td valign="top">BlockColor</td><td valign="top">byte[]</td><td valign="top"><p>Block color. Use RRGGBB format.</p><p>0x000000 = Black</p></td></tr><tr><td valign="top">BackgroundColor</td><td valign="top">byte[]</td><td valign="top"><p>Background color. Use RRGGBB format.</p><p>0xFFFFFF = White</p></td></tr><tr><td valign="top">ErrorCorrection</td><td valign="top">byte</td><td valign="top"><p>Error Correction 0x00 = Low (default) 0x01 = Medium 0x02 = Quartile 0x03 = High</p><p>See ISO/IEC 18004:2015</p></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="172.6666259765625" valign="top"></th><th width="166" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">MaskPattern</td><td valign="top">byte</td><td valign="top"><p>Mask Pattern</p><p>0x00 to 0x07 = Mask Pattern</p><p>0xFF = Device Select Optimal Mask Pattern (default) See ISO/IEC 18004:2015</p></td></tr><tr><td valign="top">MinVersion</td><td valign="top">byte</td><td valign="top"><p>Minimum Version. Must be less than or equal to Maximum Version.</p><p>0x01 to 0x28 = Version 1 to Version 40 (0x01 is default) See ISO/IEC 18004:2015</p></td></tr><tr><td valign="top">MaxVersion</td><td valign="top">byte</td><td valign="top"><p>Maximum Version. Must be greater than or equal to Minimum Version.</p><p>0x01 to 0x28 = Version 1 to Version 40 (0x28 is default) See ISO/IEC 18004:2015</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showImage <a href="#id-6.18_showimage" id="id-6.18_showimage"></a>

This function sends a command to immediately show an image on the device’s display. The image must already be loaded into a slot.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="156.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p>imageID</p></td><td valign="top"><p>Usage:</p><p>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></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showImage <a href="#id-6.19_showimage" id="id-6.19_showimage"></a>

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

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="171.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">data</td><td valign="top">ImageData object containing the image to display.</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top"><p>Display Time</p><p>0x00 = Indefinite</p><p>0x01 to 0xFF = 1 to 255 seconds</p></td></tr></tbody></table>

**ImageData**

<table data-header-hidden><thead><tr><th width="129.33334350585938" valign="top"></th><th width="150.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Member</td><td valign="top">Type/ Format</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>type</p></td><td valign="top"><p> </p><p>ImageType</p></td><td valign="top"><p>Enum for image type. Usage:</p><p>BITMAP = BMP file</p></td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>data</p></td><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>byte[]</p></td><td valign="top"><p>Image encoded data.</p><p> </p><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.</p><p> </p><p>For details see <em>D998200383 DynaFlex Family Programmer’s Manual (COMMANDS)</em></p></td></tr><tr><td valign="top"><p> </p><p>backgroundColor</p></td><td valign="top"><p> </p><p>byte[3]</p></td><td valign="top"><p>Background color in RRGGBB format.</p><p>0x000000 = Black</p><p>0xFFFFFF = White</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showUIPage <a href="#id-6.20_showuipage" id="id-6.20_showuipage"></a>

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, Functional 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.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="167" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top">Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="164.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>option</p></td><td valign="top"><p>UI page option.</p><p>0x00 = Up to 5 lines of text + 1 functional button Middle.</p><p><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FXsBiV0DKf4aQuB2uxg8m%2Fimage.png?alt=media&amp;token=56928b85-b9d5-4389-8df4-1abf59154427" alt=""></p><p></p><p>0x01 = Title + up to 6 text buttons + up to 3 functional buttons.</p><p><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FAzb14CM01bazUaQqo7Hk%2Fimage.png?alt=media&amp;token=e46e3610-2d58-4b20-8a5a-2d2424aff497" alt=""></p><p></p><p>0x02 = Title + up to 6 $Amount buttons + up to 3 functional buttons.</p><p><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FvzMmwIyF6JD8i32JpIcf%2Fimage.png?alt=media&amp;token=c7ec4fb7-ce96-46b7-a6ca-e1ec626dc553" alt=""></p><p></p><p>0x03 = Title + custom image + 1 functional button Right.</p><p><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FnwnrtqBd8L3zfH5zlM8w%2Fimage.png?alt=media&amp;token=6dd1781b-9d7a-4730-8bac-08093f29ded5" alt=""></p></td></tr><tr><td valign="top">titleStringID[]</td><td valign="top">String ID for the title. See list of display user interface strings. This list may vary according to the device configuration.</td></tr><tr><td valign="top">line1 … line5</td><td valign="top">Text string for the line. Terminate with null char. To disable a line, set to empty (Default).</td></tr><tr><td valign="top">stringID1[2] … stringID6[2]</td><td valign="top">Text string ID for buttons 1 to 6. 2-bytes in length. To disable a button, set to null (Default).</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="140.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>amount1[4] … amount6[4]</p></td><td valign="top"><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.</p><p> </p><p>Byte index:</p><p>·       [0-2] = dollar value</p><p>·       [3] = cents value</p><p> </p><p>BCD positioning:</p><p>87        65        43 . 21</p><p>0x00 0x00 0x00 0x00</p><p>·       8 – hundred thousand</p><p>·       7 – ten thousand</p><p>·       6 – thousand</p><p>·       5 – hundred</p><p>·       4 – ten</p><p>·       3 – one</p><p>·       2 – 1/tenth</p><p>·       1 – 1/hundredth</p><p> </p><p>Range:</p><p>·       Min value displayed is $0.00</p><p>·       Max value displayed is $999,999.99</p><p> </p><p>Example:</p><p>// $0.01</p><p>amount1 = new Byte[] { 0x00, 0x00, 0x00, 0x01</p><p>};</p><p> </p><p>//$100,000.23</p><p>amount1 = new Byte[] { 0x10, 0x00, 0x00, 0x23</p><p>};</p></td></tr><tr><td valign="top">leftFButtonStringID[2]</td><td valign="top">String ID for the Left functional button. 2-bytes in length. To disable this button, set to null (Default).</td></tr><tr><td valign="top">middleFButtonStringID[2]</td><td valign="top">String ID for the Middle functional button. 2-bytes in length. To disable this button, set to null (Default).</td></tr><tr><td valign="top">rightFButtonStringID[2]</td><td valign="top">String ID for the Right functional button. 2-bytes in length. To disable this button, set to null (Default).</td></tr><tr><td valign="top">leftFButtonColor</td><td valign="top"><p>Color of Left functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top">middleFButtonColor</td><td valign="top"><p>Color of Middle functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top">rightFButtonColor</td><td valign="top"><p>Color of Right functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="150.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>xPosition[2]</p></td><td valign="top"><p>X Position for image. 2-bytes in length.</p><p>To display the image in the center of the loading image area, set to null (Default).</p></td></tr><tr><td valign="top"><p> </p><p>yPosition[2]</p></td><td valign="top"><p>Y Position for image. 2-bytes in length.</p><p>To display the image in the center of the loading image area, set to null (Default).</p></td></tr><tr><td valign="top"><p> </p><p>imageData[]</p></td><td valign="top"><p>Bitmap data.</p><p>Image encoded in full BMP file format as defined by Microsoft (e.g, starting with “BM”). If no image provided, set to null (Default).</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showUIPageWithAmountButtons <a href="#id-6.21_showuipagewithamountbuttons" id="id-6.21_showuipagewithamountbuttons"></a>

This function shows the Amount UI page.

{% code overflow="wrap" %}

```
bool showUIPageWithAmountButtons( byte timeout, 
    byte[] titleStringID, string[] amountList,
    byte[] leftFButtonStringID, 
    byte[] middleFButtonStringID, 
    byte[] rightFButtonStringID, 
    byte leftFButtonColor,
    byte middleFButtonColor, 
    byte rightFButtonColor);
    
bool 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);
    
bool 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);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="169.6666259765625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top">Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU</td></tr><tr><td valign="top"><p> </p><p>titleStringID[2]</p></td><td valign="top">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.</td></tr><tr><td valign="top">amountList</td><td valign="top">List of $ Amount in BCD string format to display for each button.</td></tr><tr><td valign="top">leftFButtonStringID[2]</td><td valign="top">String ID for the Left functional button. 2-bytes in length. To disable this button, set to 0.</td></tr><tr><td valign="top">middleFButtonStringID[2]</td><td valign="top">String ID for the Middle functional button. 2-bytes in length. To disable this button, set to 0.</td></tr><tr><td valign="top">rightFButtonStringID[2]</td><td valign="top">String ID for the Right functional button. 2-bytes in length. To disable this button, set to 0.</td></tr><tr><td valign="top">leftFButtonColor</td><td valign="top"><p>Color of Left functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top">middleFButtonColor</td><td valign="top"><p>Color of Middle functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top">rightFButtonColor</td><td valign="top"><p>Color of Right functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>amount1 … amount6</p></td><td valign="top"><p>Value $ Amount in BCD string format for buttons 1 to 6. 8-characters in length. To disable a button, set to NULL.</p><p> </p><p>Range:</p><p>·       Min value displayed is $0.00</p><p>·       Max value displayed is $999,999.99</p><p>·       Decimal needed to display cents</p><p>·       Comma not needed</p><p> </p><p>Example:</p><p>// $0.01</p><p>string sAmount1 = "0.01";</p><p> </p><p>// $100,000.23</p><p>string sAmount1 = "100000.23";</p></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="173" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>amount1[4] … amount6[4]</p></td><td valign="top"><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.</p><p> </p><p>Byte index:</p><p>·       [0-2] = dollar value</p><p>·       [3] = cents value</p><p> </p><p>BCD positioning:</p><p>87        65        43 . 21</p><p>0x00 0x00 0x00 0x00</p><p>·       8 – hundred thousand</p><p>·       7 – ten thousand</p><p>·       6 – thousand</p><p>·       5 – hundred</p><p>·       4 – ten</p><p>·       3 – one</p><p>·       2 – 1/tenth</p><p>·       1 – 1/hundredth</p><p> </p><p>Range:</p><p>·       Min value displayed is $0.00</p><p>·       Max value displayed is $999,999.99</p><p> </p><p>Example:</p><p>// $0.01</p><p>amount1 = new Byte[] { 0x00, 0x00, 0x00, 0x01 };</p><p> </p><p>//$100,000.23</p><p>amount1 = new Byte[] { 0x10, 0x00, 0x00, 0x23 };</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showUIPageWithImage <a href="#id-6.22_showuipagewithimage" id="id-6.22_showuipagewithimage"></a>

This function shows the Image UI page.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="191" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top">Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU</td></tr><tr><td valign="top"><p> </p><p>titleStringID[2]</p></td><td valign="top">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.</td></tr><tr><td valign="top">rightFButtonStringID[2]</td><td valign="top">String ID for the Right functional button. 2-bytes in length. To disable this button, set to 0.</td></tr><tr><td valign="top"><p> </p><p>xPosition[2]</p></td><td valign="top"><p>X Position for image.    2-bytes in length.</p><p>To display the image in the center of the loading image area, set to null.</p></td></tr><tr><td valign="top"><p> </p><p>yPosition[2]</p></td><td valign="top"><p>Y Position for image.    2-bytes in length.</p><p>To display the image in the center of the loading image area, set to null.</p></td></tr><tr><td valign="top"><p> </p><p>imageData[]</p></td><td valign="top"><p>Bitmap data.</p><p>Image encoded in full BMP file format as defined by Microsoft (e.g, starting with “BM”).</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showUIPageWithTextButtons <a href="#id-6.23_showuipagewithtextbuttons" id="id-6.23_showuipagewithtextbuttons"></a>

This function shows the Text buttons UI page.

{% code overflow="wrap" %}

```
bool 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);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top">Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="264.3333740234375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">titleStringID[2]</td><td valign="top">String ID for the title. See list of display user interface strings. This list may vary according to the device configuration.</td></tr><tr><td valign="top">stringID1[2] to stringID6[2]</td><td valign="top">Text string ID for buttons 1 to 6. 2-bytes in length. To disable a button, set to null.</td></tr><tr><td valign="top">leftFButtonStringID[2]</td><td valign="top">String ID for the Left functional button. To disable this button, set to null.</td></tr><tr><td valign="top">middleFButtonStringID[2]</td><td valign="top">String ID for the Middle functional button. To disable this button, set to null.</td></tr><tr><td valign="top">rightFButtonStringID[2]</td><td valign="top">String ID for the Right functional button. To disable this button, set to null.</td></tr><tr><td valign="top">leftFButtonColor</td><td valign="top"><p>Color of Left functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top">middleFButtonColor</td><td valign="top"><p>Color of Middle functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr><tr><td valign="top">rightFButtonColor</td><td valign="top"><p>Color of Right functional button.</p><p>0 = red, 1 = green, 2 = yellow</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showUIPageWithTextLines <a href="#id-6.24_showuipagewithtextlines" id="id-6.24_showuipagewithtextlines"></a>

This function shows the Text lines UI page.

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="175" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top">Time in seconds to enable barcode reader. 0x00 = Infinite until the host initiates a change. 0x01 to 0xFF = RFU</td></tr><tr><td valign="top">lines[]</td><td valign="top">List of Text strings for lines 1 to 5 in array format. Terminate with NULL char. To disable a line, set to null.</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="241.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">line 1 … line5</td><td valign="top">Text string for lines 1 to 5 in string format. Terminate with NULL char. To disable a line, set to empty.</td></tr><tr><td valign="top">middleFButtonStringID[2]</td><td valign="top">String ID for the Middle functional buttons. 2-byte in length. To disable this button, set to null.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### startBarCodeReader <a href="#id-6.25_startbarcodereader" id="id-6.25_startbarcodereader"></a>

This function sends a command to start the barcode reader.

{% code overflow="wrap" %}

```
bool IDeviceControl.startBarCodeReader( 
    byte timeout,
    byte encryptionMode);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="198.33331298828125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top"><p>Time in seconds to enable barcode reader.</p><p>0x00 = Wait until a barcode is read or stopBarCodeReader() is called.</p><p>0x01 to 0xFF = 1 to 255 seconds</p></td></tr><tr><td valign="top"><p> </p><p>encryptionMode</p></td><td valign="top"><p>Encrypt payload</p><p>0x00 = do not encrypt barcode data</p><p>0x01 = encrypt barcode data.</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### startCardEmulation <a href="#id-6.26_startcardemulation" id="id-6.26_startcardemulation"></a>

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.

{% code overflow="wrap" %}

```
bool IDeviceControl.startCardEmulation( 
    byte timeout,
    string data);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="153.66668701171875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>timeout</p></td><td valign="top"><p>Time in seconds.</p><p>0x00 = No timeout or until stopNFCCardEmulation() is called 0x01 to 0xFF = 1 to 255 seconds</p></td></tr><tr><td valign="top">data</td><td valign="top">NFC data to emulate. Limit is &#x3C;= 254 characters.</td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### startPersonalInfoEntry <a href="#id-6.27_startpersonalinfoentry" id="id-6.27_startpersonalinfoentry"></a>

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

{% code overflow="wrap" %}

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

{% endcode %}

<table data-header-hidden><thead><tr><th width="178.3333740234375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">captureType</td><td valign="top">Enum for the type of information to capture.</td></tr><tr><td valign="top"><p> </p><p>encrypt</p></td><td valign="top"><p>Encrypt payload</p><p>false = do not encrypt data</p><p>true = encrypt data.</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### stopBarCodeReader <a href="#id-6.28_stopbarcodereader" id="id-6.28_stopbarcodereader"></a>

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

{% code overflow="wrap" %}

```
bool IDeviceControl.stopBarCodeReader();
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### stopCardEmulation <a href="#id-6.29_stopcardemulation" id="id-6.29_stopcardemulation"></a>

This function sends a command to stop card emulation.

{% code overflow="wrap" %}

```
bool IDeviceControl.stopCardEmulation();
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### stopPersonalInfoEntry <a href="#id-6.30_stoppersonalinfoentry" id="id-6.30_stoppersonalinfoentry"></a>

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

{% code overflow="wrap" %}

```
bool IDeviceControl.stopPersonalInfoEntry();
```

{% endcode %}

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
