> 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/ios/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.
* 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 <a href="#id-6.1_close" id="id-6.1_close"></a>

This function closes the connection to the device.

{% code overflow="wrap" %}

```
(Boolean) close;
```

{% endcode %}

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.

{% code overflow="wrap" %}

```
(Boolean) deviceReset;
```

{% endcode %}

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" %}

```
(Boolean) displayMessage: (Byte) messageID timeout: (Byte) 
                timeOut; 

(void) displayMessage: (Byte) messageID 
                timeout: (Byte) time 
        completionHandler: (BooleanCallback) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="124.45458984375" 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> </p><p> </p><p>messageID</p></td><td valign="top"><p>Value representing the message.</p><p> </p><p>Usage:</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><p>0x08 - “ENTER AMOUNT”</p><p>0x09 - reserved, do not use. 0x0A - reserved, do not use. 0x0B - “INSERT CARD”</p><p>0x0C – “NOT ACCEPTED”</p><p>0x0D - reserved, do not use. 0x0E - “PLEASE WAIT”</p><p>0x0F - “PROCESSING ERROR”</p><p>0x10 - “REMOVE CARD”</p><p>0x11 - “USE CHIP READER”</p><p>0x12 - “USE MAGSTRIPE”</p><p>0x13 - “TRY AGAIN”</p><p>0x14 - “WELCOME”</p><p>0x15 - “PRESENT CARD”</p><p>0x16 - “PROCESSING”</p><p>0x17 - “CARD READ OK - REMOVE CARD”</p><p>0x18 - “INSERT OR SWIPE CARD”</p><p>0x19 - “PRESENT ONE CARD ONLY”</p><p>0x1A - “APPROVED PLEASE SIGN”</p><p>0x1B - “AUTHORIZING PLEASE WAIT”</p><p>0x1C - “INSERT, SWIPE OR TRY ANOTHER CARD”</p><p>0x1D - “PLEASE INSERT CARD”</p><p>0x1E - Null prompt (empty screen) 0x1F - reserved, do not use.</p><p>0x20 - “SEE PHONE”</p><p>0x21 - “PRESENT CARD AGAIN”</p><p>0x22 - “INSERT/SWIPE/TRY OTHER CARD”</p><p>0x23 - “TAP or SWIPE CARD”</p><p>0x24 - “TAP or INSERT CARD”</p><p>0x25 - “TAP, INSERT or SWIPE CARD”</p><p>0x26 - “TAP CARD”</p><p>0x27 - “TIMEOUT”</p><p>0x28 - “TRANSACTION TERMINATED”</p></td></tr><tr><td valign="top">timeout</td><td valign="top"><p>Timeout in seconds for the device to display the message.</p><p> </p><p>Usage:</p><p>0x00 - Infinite timeout. Device leaves the requested message on the display until the host initiates a change.</p><p> </p><p>All other values - Timeout in seconds for the device to display the message.</p></td></tr><tr><td valign="top">callback</td><td valign="top">Completion handler.</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" %}

```
(Boolean) 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 input to the device. The response data will be returned in the event OnEvent().

{% code overflow="wrap" %}

```
(Boolean) getInput: (IData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="120.81817626953125" 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.

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

This function opens a connection to the device.

{% code overflow="wrap" %}

```
(Boolean) 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" %}

```
(Boolean) playSound: (IData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="162.63629150390625" 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.

### resetDeviceWithCompletionHandler <a href="#id-6.8_resetdevicewithcompletionhandler" id="id-6.8_resetdevicewithcompletionhandler"></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. The response is sent to a completion handler.

{% code overflow="wrap" %}

```
(void) resetDeviceWithCompletionHandler: (BooleanCallback)callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th 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">callback</td><td valign="top">Completion handler.</td></tr></tbody></table>

Return Value:

None

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

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

{% code overflow="wrap" %}

```
(Boolean) send: (IData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="142.6363525390625" 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.

### sendData <a href="#id-6.10_senddata" id="id-6.10_senddata"></a>

This function sends data.

{% code overflow="wrap" %}

```
(void) sendData: (IData*) data completionHandler: (BooleanCallback) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="154.45452880859375" 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><tr><td valign="top"><p> </p><p>callback</p></td><td valign="top"><p>Completion handler. If the operation is successful, the completion handler will return true, otherwise false.</p><p> </p><p>typedef void(^BooleanCallback)(Boolean resultFlag);</p></td></tr></tbody></table>

Return Value:

None

### sendExtendedCommand <a href="#id-6.10_senddata" id="id-6.10_senddata"></a>

{% code overflow="wrap" %}

```
sendExtendedCommand
```

{% endcode %}

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

{% code overflow="wrap" %}

```
(Boolean) sendExtendedCommand: (IData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="127.18182373046875" 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.12_sendnfcpassthroughcommand" id="id-6.12_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" %}

```
(Boolean) sendNFCPassThroughCommand: (IData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="173.54547119140625" 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.13_sendsync" id="id-6.13_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*) sendSync: (IData*)data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="146.27276611328125" 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\*.

{% code overflow="wrap" %}

```
@interface IResult : NSObject

@property (nonatomic) MTU_StatusCode status; 
@property (nonatomic, strong) IData* data;

+ (IResult*) status:(MTU_StatusCode) Status data: (IData*) Data; 

@end
```

{% endcode %}

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

This function sets the date and time for the device.

{% code overflow="wrap" %}

```
(Boolean) setDateTime: (IData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th 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.

### setupEADeviceProtocolString <a href="#id-6.15_setupeadeviceprotocolstring" id="id-6.15_setupeadeviceprotocolstring"></a>

This function sets the external accessory protocol string.

{% code overflow="wrap" %}

```
(void) setupEADeviceProtocolString: (NSString *)protocolString;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="161.72723388671875" 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">protocolString</td><td valign="top">Name of the external accessory protocol string.</td></tr></tbody></table>

Return Value:

None.

### setLatch <a href="#id-6.16_setlatch" id="id-6.16_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" %}

```
(Boolean) setLatch: (BOOL) enableLock;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="172.63641357421875" 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>enableLock</p></td><td valign="top"><p>Usage:</p><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.17_setledstatus" id="id-6.17_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" %}

```
(Boolean)setLEDStatus: (Byte) led 
    status: (Byte) status;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="130.8182373046875" 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><p>0x00 = LED 1 (Power LED)</p><p>0x01 = LED 2</p><p>0x02 = LED 3</p><p>0x03 = LED 4</p><p>0xFF = All 4 LEDs</p><p> </p><p>Where the LEDs are numbered 1, 2, 3, 4 counting from the left.</p></td></tr><tr><td valign="top">status</td><td valign="top"><p>LED Status:</p><p>0x00 = OFF</p><p>0x01 = GREEN ON</p><p>0x02 = RED ON</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### setNFCPassThroughMode <a href="#id-6.18_setnfcpassthroughmode" id="id-6.18_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" %}

```
(Boolean) setNFCPassThroughMode: (Byte) timeout 
        mode: (Byte) mode;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="149" 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><p>0x00 = Indefinite</p><p>0x01 to 0xFF = 1 to 255 seconds</p></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.19_setnfcpollingmode" id="id-6.19_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" %}

```
(Boolean) setNFCPollingMode: (Byte) timeout 
    mode: (Byte) mode;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="138.09088134765625" 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><p>0x00 = Indefinite</p><p>0x01 to 0xFF = 1 to 255 seconds</p></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.

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

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

{% code overflow="wrap" %}

```
(Boolean) showBarCode: (BarCodeRequest*) request 
        timeout: (Byte) timeOut 
                prompt: (IData*) prompt;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="135.36370849609375" 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. Usage:</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="162.90911865234375" valign="top"></th><th width="150.6363525390625" 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">NSData*</td><td valign="top">Data to encode into a barcode</td></tr><tr><td valign="top">BlockColor</td><td valign="top">NSData*</td><td valign="top">Block color. Use RRGGBB format. 0x000000 = Black</td></tr><tr><td valign="top">BackgroundColor</td><td valign="top">NSData*</td><td valign="top">Background color. Use RRGGBB format. 0xFFFFFF = White</td></tr><tr><td valign="top"><p> </p><p> </p><p>ErrorCorrection</p></td><td valign="top"><p> </p><p> </p><p>Byte</p></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><tr><td valign="top"><p> </p><p>MaskPattern</p></td><td valign="top"><p> </p><p>Byte</p></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"><p> </p><p>MinVersion</p></td><td valign="top"><p> </p><p>Byte</p></td><td valign="top"><p>Minimum Version. Must be less than or equal to Maximum Version. 0x01 to 0x28 = Version 1 to Version 40 (0x01 is default)</p><p>See ISO/IEC 18004:2015</p></td></tr><tr><td valign="top"><p> </p><p>MaxVersion</p></td><td valign="top"><p> </p><p>Byte</p></td><td valign="top"><p>Maximum Version. Must be greater than or equal to Minimum Version. 0x01 to 0x28 = Version 1 to Version 40 (0x28 is default)</p><p>See ISO/IEC 18004:2015</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showImage <a href="#id-6.21_showimage" id="id-6.21_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" %}

```
(Boolean) showImage: (Byte) imageID;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="146.272705078125" 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\_withCallback <a href="#id-6.22_showimage" id="id-6.22_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. The response is sent to a completion handler.

{% code overflow="wrap" %}

```
(void) showImage: (Byte) imageID 
completionHandler: (BooleanCallback) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="154.45458984375" 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><tr><td valign="top"><p> </p><p>callback</p></td><td valign="top"><p>Completion handler. If the operation is successful, the completion handler will return true, otherwise false.</p><p> </p><p>typedef void(^BooleanCallback)(Boolean resultFlag);</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showImage\_withTimeout <a href="#id-6.23_showimage" id="id-6.23_showimage"></a>

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

{% code overflow="wrap" %}

```
(Boolean) showImage: (ImageData*) data 
    timeout: (Byte) timeOut;
```

{% endcode %}

<table data-header-hidden><thead><tr><th 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">timeout</td><td valign="top"><p>Display Time Usage:</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="128.3636474609375" valign="top"></th><th width="155.8182373046875" 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>MTU_IMAGE_TYPE_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>NSData*</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 <mark style="color:red;"><strong>DynaFlex Family Programmer’s Manual</strong></mark> </p></td></tr><tr><td valign="top"><p> </p><p>BackgroundColor</p></td><td valign="top"><p> </p><p>NSData*</p></td><td valign="top"><p>Background color in RRGGBB format. 0x000000 = Black</p><p>0xFFFFFF = White</p></td></tr></tbody></table>

Return Value:

Returns true if successful. Otherwise, returns false.

### showConnectedEAAccessoryIfAny <a href="#id-6.24_showconnectedeaaccessoryifany" id="id-6.24_showconnectedeaaccessoryifany"></a>

This function is to show any connected EA accessories.

{% code overflow="wrap" %}

```
(void) showConnectedEAAccessoryIfAny;
```

{% endcode %}

Return Value:

None

### startNFCCardEmualation <a href="#id-6.25_startnfccardemualation" id="id-6.25_startnfccardemualation"></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" %}

```
(Boolean) startNFCCardEmulation: (Byte) timeOut
        data: (NSString*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th 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.

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

This function starts the barcode reader. The response data will be returned in the event OnEvent().

{% code overflow="wrap" %}

```
(Boolean) startBarCodeReader: (Byte) timeOut mode: 
        (Byte) encryptionMode;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="175.36370849609375" 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 to enable barcode reader. Usage:</p><p>0x00 = Wait until a barcode is read or stopBarCodeReader() is called. 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 Usage:</p><p>0x00 = do not encrypt barcode data 0x01 = encrypt barcode data.</p></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. Captured information is later returned in OnEvent() MTU\_EventType\_TouchscreenPersonalInfo.

(Boolean) startPersonalInfoEntry: (MTU\_CaptureType) captureType

<p align="center">encrypt : (Boolean) encrypt;</p>

<table data-header-hidden><thead><tr><th 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>encryptionMode</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>

&#x20;

Return Value:

Returns true if successful. Otherwise, returns false.

### 1startScan <a href="#id-6.28_startscan" id="id-6.28_startscan"></a>

This function scans for peripherals.

{% code overflow="wrap" %}

```
(void) startScan;
```

{% endcode %}

Return Value:

None

### startScanBarcodeWithTimeout <a href="#id-6.29_startscanbarcodewithtimeout" id="id-6.29_startscanbarcodewithtimeout"></a>

This function starts the barcode reader. The response data will be returned in the event OnEvent().

{% code overflow="wrap" %}

```
(void) startScanBarcodeWithTimeout: (Byte) time 
        encryptionMode: (Byte) mode 
        completionHandler: BooleanCallback) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="147.18182373046875" 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>time</p></td><td valign="top"><p>Time to enable barcode reader. Usage:</p><p>0x00 = Wait until a barcode is read or stopBarCodeReader() is called. 0x01 to 0xFF = 1 to 255 seconds</p></td></tr><tr><td valign="top"><p> </p><p>mode</p></td><td valign="top"><p>Encrypt payload Usage:</p><p>0x00 = do not encrypt barcode data 0x01 = encrypt barcode data.</p></td></tr><tr><td valign="top"><p> </p><p>callback</p></td><td valign="top"><p>Completion handler. If the operation is successful, the completion handler will return true, otherwise false.</p><p> </p><p>typedef void(^BooleanCallback)(Boolean resultFlag);</p></td></tr></tbody></table>

Return Value:

None

### stopBarCodeReader <a href="#id-6.30_stopbarcodereader" id="id-6.30_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" %}

```
(Boolean) stopBarCodeReader;
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### stopNFCCardEmualation <a href="#id-6.31_stopnfccardemualation" id="id-6.31_stopnfccardemualation"></a>

This function sends a command to stop card emulation.

{% code overflow="wrap" %}

```
 (Boolean) stopNFCCardEmulation;
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

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

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

{% code overflow="wrap" %}

```
(Boolean) stopPersonalInfoEntry;
```

{% endcode %}

Return Value:

Returns true if successful. Otherwise, returns false.

### stopScan <a href="#id-6.33_stopscan" id="id-6.33_stopscan"></a>

This function stops the scans for peripherals.

{% code overflow="wrap" %}

```
(void) stopScan;
```

{% endcode %}

Return Value:

None

### stopScanBarcodeWithCompletionHandler <a href="#id-6.34_stopscanbarcodewithcompletionhandle" id="id-6.34_stopscanbarcodewithcompletionhandle"></a>

This function stops the barcode reader.

{% code overflow="wrap" %}

```
(void) startScanBarcodeWithTimeout: (BooleanCallback) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="138.0909423828125" 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>callback</p></td><td valign="top"><p>Completion handler. If the operation is successful, the completion handler will return true, otherwise false.</p><p> </p><p>typedef void(^BooleanCallback)(Boolean resultFlag);</p></td></tr></tbody></table>

Return Value:

None

### turnEAAccessoryConnectionNotificationsOn <a href="#id-6.35_turneaaccessoryconnectionnotificati" id="id-6.35_turneaaccessoryconnectionnotificati"></a>

This function turns on the notifications for EA accessories.

{% code overflow="wrap" %}

```
(void) turnEAAccessoryConnectionNotificationsOn;
```

{% endcode %}

Return Value:

None

### turnEAAccessoryConnectionNotificationsOff <a href="#id-6.36_turneaaccessoryconnectionnotificati" id="id-6.36_turneaaccessoryconnectionnotificati"></a>

This function turns off the notifications for EA accessories.

{% code overflow="wrap" %}

```
(void) turnEAAccessoryConnectionNotificationsOff;
```

{% endcode %}

Return Value:

None


---

# 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/ios/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.
