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

# IDeviceConfiguration

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

### 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 IDeviceConfiguration.deleteFile(byte[] fileID);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="117.66665649414062" 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 update 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) of being 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" %}

```
byte[] IDeviceConfiguration.getChallengeToken(byte[] data);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="143" 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.23B.6 IDeviceConfiguration Walk Through.

{% code overflow="wrap" %}

```
byte[]IDeviceConfiguration.getConfigInfo( 
    byte configType,
    byte[] data);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="143.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">configType</td><td valign="top">Type of configuration. For DynaFlex, this is the first number of the Property OID.</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" %}

```
string IDeviceConfiguration.getDeviceInfo(InfoType infoType);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="116.99996948242188" 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">Enumerated information type.</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 sets device configuration information.

{% code overflow="wrap" %}

```
int IDeviceConfiguration.getFile( 
    byte[] fileID, 
    IConfigurationCallback callback);
```

{% endcode %}

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

```
byte[]IDeviceConfiguration.getKeyInfo( 
    byte keyType,
    byte[] data);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="147" 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 IDeviceConfiguration.sendFile( 
    byte[] fileID,
    byte[] data, 
    IConfigurationCallback callback);
```

{% 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">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></tbody></table>

<table data-header-hidden><thead><tr><th width="166.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">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 IDeviceConfiguration.sendImage( 
    byte imageID,
    byte[] data, 
    IConfigurationCallback callback);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="132.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"><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>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">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 IDeviceConfiguration.sendFile( 
    byte[] fileID,
    byte[] data, 
    IConfigurationCallback callback);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="107" 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></tbody></table>

<table data-header-hidden><thead><tr><th width="112.33334350585938" 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">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.23B.6 IDeviceConfiguration Walk Through.

{% code overflow="wrap" %}

```
int IDeviceConfiguration.setConfigInfo( 
    byte configType,
    byte[] data, 
    IConfigurationCallback callback);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="163.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">configType</td><td valign="top">Type of configuration. For DynaFlex, this is the first number of the Property OID.</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 IDeviceConfiguration.setDisplayImage(byte imageID);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="123" 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 = restore the idle image to the “Welcome” screen.</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 IDeviceConfiguration.updateFirmware(
```

{% endcode %}

{% code overflow="wrap" %}

```
ushort firmwareType, 
byte[] data,
IConfigurationCallback callback);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="191.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>firmwareType</p></td><td valign="top"><p>Type of firmware. For DynaFlex, use:</p><p>1 - Main App</p><p>2 - Wireless 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 IDeviceConfiguration.updateKeyInfo( 
    byte keyType,
    byte[] data, 
    IConfigurationCallback callback);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="111" 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/.net-windows/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.
