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

# IConfigurationCallback Delegates

This interface invokes callback functions to receive data and/or a detailed response. To register for the event(s), call the subscribeAll() function with the name of a class that implements the IConfigurationCallback Delegates interface.

### OnCalculateMAC <a href="#id-12.1_oncalculatemac" id="id-12.1_oncalculatemac"></a>

This event is called when certain asynchronous IDeviceConfiguration operations need to have a MAC included with the request.

{% code overflow="wrap" %}

```
IResult OnCalculateMAC( 
    byte macType, 
    byte[] data);
```

{% endcode %}

<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">macType</td><td valign="top">Type of Mac algorithm. For DynaFlex, use 0.</td></tr><tr><td valign="top">data</td><td valign="top">Contains the data of the payload to MAC.</td></tr></tbody></table>

Return Value:

Returns an IResult that contains the calculated MAC.

### OnProgress <a href="#id-12.2_onprogress" id="id-12.2_onprogress"></a>

This event is called to update the host on the progress of an asynchronous IDeviceConfiguration operation.

{% code overflow="wrap" %}

```
public void OnProgres(int progress);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="103.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>progress</p></td><td valign="top"><p>The progress of the configuration operation. Range:</p><p>0 - 100</p></td></tr></tbody></table>

Return Value: None

### OnResult <a href="#id-12.3_onresult" id="id-12.3_onresult"></a>

This event is called to update the host when an asynchronous IDeviceConfiguration operation is completed.

{% code overflow="wrap" %}

```
public void OnResult( 
    StatusCode status, 
    byte[] data);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="180.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">status</td><td valign="top">An enumerated Library Status Codes.</td></tr><tr><td valign="top">data</td><td valign="top">Contains the data for the event.</td></tr></tbody></table>

Return Value: None

C# Example:

<pre data-overflow="wrap"><code>class OnConfigCallbackClass : IConfigurationCallback
{
    public IResult OnCalculateMAC(byte macType, byte[] data)
    {
        // Event handler
    }

    public void OnProgress(int progress)
    {
        // Event handler
    }

<strong>    public void OnResult(StatusCode status, byte[] data)
</strong>    {
        // Event handler
    }

}

OnConfigCallbackClass configCallBack = new OnConfigCallbackClass();
</code></pre>

<br>


---

# 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/iconfigurationcallback-delegates.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.
