> 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/programmers-resources/programmers-resources/sdk-programmers-manuals/universal-sdk-magtek-devices-programmers-manual-android/iconfigurationcallback-delegates.md).

# IConfigurationCallback Delegates

MTUSDKNET API will invoke the callback function in this chapter to provide the requested data and/or a detailed response. These events will be called in a class that implements the IConfigurationCallback Delegates interface.

## OnCalculateMAC

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

**Copy**

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

| Parameter | Description                                 |
| --------- | ------------------------------------------- |
| macType   | Type of Mac algorithm. For DynaFlex, use 0. |
| data      | Contains the data of the payload to MAC.    |

**Return Value:**

Returns an IResult that contains the calculated MAC.

## OnProgress

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

> `public void OnProgres(int progress);`

| Parameter | Description                                                   |
| --------- | ------------------------------------------------------------- |
| progress  | The progress of the configuration operation. Range: `0 - 100` |

**Return Value:** None

## OnResult

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

**Copy**

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

| Parameter | Description                         |
| --------- | ----------------------------------- |
| status    | An enumerated Library Status Codes. |
| data      | Contains the data for the event.    |

**Return Value:** None

**Example:**

**Copy**

```csharp
class OnConfigCallbackClass implements IConfigurationCallBack
{
    public IResult OnCalculateMAC(byte macType, byte[] data)
    {
        // Event handler
    }

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

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

}

OnConfigCallbackClass configCallBack = new OnConfigCallbackClass();
```

For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). This page is also available as [Markdown](/programmers-resources/programmers-resources/sdk-programmers-manuals/universal-sdk-magtek-devices-programmers-manual-android/iconfigurationcallback-delegates-1.md).


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.magtek.com/programmers-resources/programmers-resources/sdk-programmers-manuals/universal-sdk-magtek-devices-programmers-manual-android/iconfigurationcallback-delegates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
