> 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/hardware/card-readers/mms-dyna-devices/dynaprox/documents/programmers-manuals/programmers-manual-commands/commands/user-interface/card-emulation.md).

# Card Emulation

## Command 0x1840 – Card Emulation

Card emulation is initiated by receiving a 0x1840 command from the host. The device will prepare card emulation with the parameters provided in the command and start card emulation.

The sequence of events is as follows:

{% stepper %}
{% step %}

### Host ensures device is idle

The host ensures the device is not currently running another command, for example, that it is not running a transaction or PIN entry.
{% endstep %}

{% step %}

### Host composes and sends command

The host composes a command request in the format described below and sends it to the device.
{% endstep %}

{% step %}

### Device validates and prepares

The device receives the command and verifies that the parameters are valid and the device is in a state that allows the execution of card emulation.
{% endstep %}

{% step %}

### Device prompts customer (if display available)

If the device has a display, a prompt will be displayed asking the customer to tap their phone to the device.
{% endstep %}

{% step %}

### Timeout behavior and response

* If the timeout parameter is not included or set to 0x00, then there is no timeout.
* If the timeout parameter is set to a specific number of seconds, the device returns a command response message with its Operation Status Summary byte set to 0x01 (OK, Started / Running).
  {% endstep %}

{% step %}

### Host can cancel emulation

The host may issue a 0x1840 command with Tag 0x81 set to 0x00 to cancel the execution of card emulation.
{% endstep %}

{% step %}

### Completion notification

After the timeout expires, host cancel or the card is read, the device sends a 0x1805 notification to inform the host.
{% endstep %}
{% endstepper %}

## Table - Request Data for Command 0x1840 – Card Emulation

<table><thead><tr><th width="72.33334350585938">Tag</th><th width="81.3333740234375">Len</th><th>Value / Description</th><th width="76">Req</th><th width="98.6666259765625">Default</th></tr></thead><tbody><tr><td>/81</td><td>01</td><td><p>Start/Cancel</p><ul><li>0x00 = Cancel (See the example of 0x1840 cancel command below)</li><li>0x01 = Start</li></ul></td><td>R</td><td></td></tr><tr><td>/82</td><td>01</td><td><p>Timeout in seconds</p><ul><li>0x00 = No timeout</li><li>0x01 to 0xFF = 1 to 255 seconds</li></ul></td><td>O</td><td>0x00</td></tr><tr><td>/83</td><td>&#x3C;= 254</td><td><p>URL </p><p>URL to use as card data. Required when starting card emulation. Optional and ignored if canceling emulation. Example: https://www.magtek.com/</p></td><td>O/R</td><td></td></tr></tbody></table>

## Table - Request Example

{% code title="Example (Hex)" %}

```
AA 00 81 04 01 01 18 40 84 21 18 40 81 01 01 82 01 00 83 17 68 74 74 70 73 3A 2F 2F 77 77 77
2E 6D 61 67 74 65 6B 2E 63 6F 6D 2F

```

{% endcode %}

## Table - Response Example

{% code title="Example (Hex)" %}

```
AA 00 81 04 82 01 18 40 82 04 01 00 00 00
```

{% endcode %}

## Table- Example of 0x1840 Card Emulation Command

{% code title="Example (Hex)" %}

```
AA 00 81 04 01 01 18 40 84 05 18 40 81 01 00
```

{% endcode %}


---

# 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/hardware/card-readers/mms-dyna-devices/dynaprox/documents/programmers-manuals/programmers-manual-commands/commands/user-interface/card-emulation.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.
