> 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/ideviceconfiguration.md).

# IDeviceConfiguration

Create an instance of the IDeviceConfiguration using IDevice.getDeviceConfiguration. 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.

### deleteFile <a href="#id-9.1_deletefile" id="id-9.1_deletefile"></a>

This function deletes a file from the device.

{% code overflow="wrap" %}

```
(int) deleteFile: (NSData*) fileID
```

{% 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> </p><p>fileID</p></td><td valign="top"><p>Byte array for the file ID. For DynaFlex, use a 4-byte file id. 0x02000000 = Custom idle page image 1</p><p>0x02000001 = Custom idle page image 2 0x02000002 = Custom idle page image 3 0x02000003 = Custom idle page image 4</p></td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous configuration operation started. Otherwise, returns a non 0 value.

### getChallengeToken <a href="#id-9.2_getchallengetoken" id="id-9.2_getchallengetoken"></a>

This function retrieves a challenge token from the device. A challenge token consists of a random nonce or timestamp. A challenge token must be used within the time allowed by the device (generally 5 minutes) after issued. Only one token can be active at a time. Attempts to use a token for requests other than the one specified will cause the token to be revoked/erased.

{% code overflow="wrap" %}

```
(NSData*) getChallengeToken: (NSData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="167.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 containing the request ID to be protected.</td></tr></tbody></table>

Return Value:

Returns a byte array containing the challenge token.

### getConfigInfo <a href="#id-9.3_getconfiginfo" id="id-9.3_getconfiginfo"></a>

This function retrieves device configuration information. For an example, see appendix 15.24A.6 IDeviceConfiguration Walk Through.

{% code overflow="wrap" %}

```
(NSData*) getConfigInfo: (byte) configType 
                data: (NSData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="125.36358642578125" 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>configType</p></td><td valign="top"><p>Type of configuration. For DynaFlex, this is the first number of the Property OID.</p><p>·         0x01 = Device Settings</p><p>·         0x02 = Device Information</p></td></tr><tr><td valign="top"><p> </p><p>data</p></td><td valign="top">Configuration data to be sent to the device. For DynaFlex, this is the remainder of the constructed OID. For constructing the OID see <em>D998200383 DynaFlex Family Programmer’s Manual (COMMANDS)</em></td></tr></tbody></table>

Return Value:

Returns an array of bytes containing the configuration information.

### getDeviceInfo <a href="#id-9.4_getdeviceinfo" id="id-9.4_getdeviceinfo"></a>

This function retrieves device specific information.

{% code overflow="wrap" %}

```
(NSString*) getDeviceInfo: (MTU_InfoType) infoType;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="116.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">infoType</td><td valign="top"><p>Enumerated information type.</p><p>InfoType</p></td></tr></tbody></table>

Return Value:

Returns a string value device information.

### getFile <a href="#id-9.5_getfile" id="id-9.5_getfile"></a>

This function retrieves file information based on file ID. The response file data will be returned via the callback.

{% code overflow="wrap" %}

```
(int) getFile: (NSData*) fileID 
                callback: (nullable id<IConfigurationCallback>) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="133.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">fileID</td><td valign="top">Byte array for the file ID. For DynaFlex, use a 4-byte file id.</td></tr><tr><td valign="top">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous configuration operation started. Otherwise, returns a non 0 value.

### getKeyInfo <a href="#id-9.6_getkeyinfo" id="id-9.6_getkeyinfo"></a>

This function retrieves key information.

{% code overflow="wrap" %}

```
(NSData*) getKeyInfo: (byte) keyType 
                data: (NSData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="157.1817626953125" 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">keyType</td><td valign="top">Type of key. For DynaFlex, use 0.</td></tr><tr><td valign="top">data</td><td valign="top">Key data to be sent to the device. For DynaFlex, this is the 2-byte key slot number.</td></tr></tbody></table>

Return Value:

Returns an array of bytes containing the key information.

### sendFile <a href="#id-9.7_sendfile" id="id-9.7_sendfile"></a>

This function sends a file to the device.

{% code overflow="wrap" %}

```
(int) sendFile: (NSData*) fileID 
        data: (NSData*) data
        callback: (nullable id<IConfigurationCallback>) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="148.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">fileID</td><td valign="top">Byte array for the file ID. For DynaFlex, use a 4-byte file id.</td></tr><tr><td valign="top">data</td><td valign="top">File contents to be sent to the device.</td></tr><tr><td valign="top">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value.

### sendImage <a href="#id-9.8_sendimage" id="id-9.8_sendimage"></a>

This function sends an image to the device.

{% code overflow="wrap" %}

```
(int) sendImage: (byte) imageID 
                                data: (NSData*) data 
                callback: (nullable id<IConfigurationCallback>) callback;
```

{% 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>imageID</p></td><td valign="top"><p>Value for the image ID. For DynaFlex, use:</p><p>1, 2, 3, or 4</p></td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p>data</p></td><td valign="top"><p>File contents to be sent to the device.</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">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value.

### sendSecureFile <a href="#id-9.9_sendsecurefile" id="id-9.9_sendsecurefile"></a>

This function sends a file to the device using a secure command structure.

{% code overflow="wrap" %}

```
(int) sendSecureFile: (NSData*) fileID 
                                data: (NSData*) data 
                callback: (nullable id<IConfigurationCallback>) callback;
```

{% 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">fileID</td><td valign="top">Byte array for the file ID. For DynaFlex, use a 4-byte file id.</td></tr><tr><td valign="top">data</td><td valign="top">File contents to be sent to the device.</td></tr><tr><td valign="top">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value.

### setConfigInfo <a href="#id-9.10_setconfiginfo" id="id-9.10_setconfiginfo"></a>

This function sets device configuration information. For an example, see appendix 15.24A.6 IDeviceConfiguration Walk Through.

{% code overflow="wrap" %}

```
(int) setConfigInfo: (byte) configType 
                data: (NSData*) data 
        callback: (nullable id<IConfigurationCallback>) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="148.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>configType</p></td><td valign="top"><p>Type of configuration. For DynaFlex, this is the first number of the Property OID.</p><p>·         0x01 = Device Settings</p><p>·         0x02 = Device Information</p></td></tr><tr><td valign="top"><p> </p><p>data</p></td><td valign="top">Configuration data to be sent to the device. For DynaFlex, this is the remainder of the constructed OID and value. For constructing the OID see <em>D998200383 DynaFlex Family Programmer’s Manual (COMMANDS)</em></td></tr><tr><td valign="top">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous configuration operation started. Otherwise, returns a non 0 value.

### setDisplayImage <a href="#id-9.11_setdisplayimage" id="id-9.11_setdisplayimage"></a>

This function sets which image is to be displayed when the device is idle. The image is displayed after a device reset.

{% code overflow="wrap" %}

```
(int) setDisplayImage: (byte) imageID; 
(void) setDisplayImage: (byte) imageID 
    completionHandler: (BooleanCallback) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137.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> </p><p>imageID</p></td><td valign="top"><p>Value for the image ID.</p><p> </p><p>For DynaFlex, use:</p><p>0, 1, 2, 3, or 4</p><p>0 restores the image to the “Welcome” screen.</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 0 if the asynchronous configuration operation started. Otherwise, returns a non 0 value.

### updateFirmware <a href="#id-9.12_updatefirmware" id="id-9.12_updatefirmware"></a>

This function updates the device firmware.

{% code overflow="wrap" %}

```
(int) updateFirmware: (ushort) configType 
                data: (NSData*) data
        callback: (nullable id<IConfigurationCallback>) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="177.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>configType</p></td><td valign="top"><p>Type of firmware. For DynaFlex, use:</p><p>1 = Main App</p><p>2 = Wireless App</p><p>3 = Bluetooth LE App</p></td></tr><tr><td valign="top">data</td><td valign="top">Firmware image to be sent to the device.</td></tr><tr><td valign="top">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value.

### updateKeyInfo <a href="#id-9.13_updatekeyinfo" id="id-9.13_updatekeyinfo"></a>

This function updates key information in the device.

{% code overflow="wrap" %}

```
(int) updateKeyInfo: (byte) keyType 
                data: (NSData*) data 
        callback: (nullable id<IConfigurationCallback>) callback;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="129.9090576171875" 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">keyType</td><td valign="top">Type of key.</td></tr><tr><td valign="top">data</td><td valign="top">Key data to be sent to the device.</td></tr><tr><td valign="top">callback</td><td valign="top">Name of a class or structure that implements the IConfigurationCallback Delegates events.</td></tr></tbody></table>

Return Value:

Returns 0 if the asynchronous update operation started. Otherwise, returns a non 0 value.


---

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