> 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/dynaflex-ii-ped/documentation/developers-manuals/dynaflex-ii-ped-programmers-manual/messages.md).

# Messages

The host and the device communicate with each other by exchanging blocks of data called **Messages**, which are standardized wrappers containing a **payload** that is either a command **Request**, a command **Response**, an unsolicited **Notification**, or a **File**. For example, the host may send a command **request** message to the device to change a configuration setting, and the device may send a command **response** message to indicate the command was successful; when a cardholder inserts a card, the device may send a **notification** message to the host that a cardholder has initiated a transaction; the host may send the device a **file** message to load firmware.

Messages can be nested. For example, a top-level secure wrapper request from the host to the device may contain an encrypted or signed command request for the device to unpack, validate, and execute.

### Requests and Responses

* Requests and responses are two of the message payload types the host and device exchange inside messages. The combination of a message that contains a **request** payload and a message that contains the corresponding **response** payload is referred to generally in this document as a **Command**.
* The device can only service one command request at a time, and sends each command response within a pre-determined finite amount of time after receiving the request.
* After sending a command request, the host must wait until the device returns a response before sending another request, or until the request is unanswered after a reasonable host-defined timeout period passes.

### Notifications

* Notifications are a message payload type the host and device exchange inside messages. The device sends notification messages to the host if the device’s state changes or if an external event occurs, such as a cardholder inserting a card.
* The device can send a notification at any time, and does not expect a response or any specific action from the host.
* By default, the device sends all notifications to the USB interface. To configure the device to send notifications on additional connections, use **Command 0x1F02 - Set Notification Subscriptions**.

### Data Files

* Data Files are a message payload type the host and device exchange inside messages. The device handles them as a stream: it begins storing the payload of the message before it has received the final packet of the message, allowing for much larger payloads than standard requests.
* This streaming behavior is possible because the message is restricted to transferring a file and thus the message payload is primitive data only; it cannot contain composed TLV data objects.

Regardless of connection type, all MMS devices use the same schema for sending and receiving messages, which is documented inMessage Format. For information about transmitting and receiving messages using specific connection types (which involves following connection-specific rules for breaking messages down into transmittable **Message Streams**), see section **2 Connection Types**.

### Tag-Length-Value (TLV) Encoding

#### About TLV Encoding

All messages exchanged between the host and the device are formatted using the tag-length-value **Distinguished Encoding Rules** (DER) defined in ***ITU-T X.680 | ISO/IEC 8824-1*** and ***ITU-T X.690 | ISO/IEC 8825-1***. A subset of these standards is also used in ***EMV Integrated Circuit Card Specifications for Payment Systems 4.3, Part IV, Annex B Rules for BER-TLV Data Objects***, so the latter can serve as a useful point of reference.

Summarizing those specifications, each TLV data object follows these basic rules:

* The DER standard designates the least significant bit of a byte as **bit 1**, and the most significant bit of a byte as **bit 8**. This is different from the remainder of the MMS standard, which indexes bit numbers starting at 0 to be consistent with each bit position number representing that bit’s power of 2.
* The **Tag** or **Identifier** portion of a TLV data object identifies the TLV data object. DER assigns the tag portion as follows:
  * Bits 8 and 7 specify whether the TLV data object is universal, application-defined, context-specific, or private. Most messages in this standard contain **context-specific** tags (bits 8 and 7 = **10**), meaning different messages reuse the same tags, and the tags represent sequentially numbered parameters passed in any message.
  * Bit 6 specifies whether the tag is **primitive** (bit 6 = **0**), meaning it contains its values directly, or **constructed** (bit 6 = **1**), meaning the TLV data object contains more TLV data objects.
  * Bits 5 to 1 specify a unique tag number, with 11111 reserved to mean the tag is not a single byte long. In that multi-byte case:
    * Bits 7 to 1 of subsequent bytes with bit 8 set to 1 are also part of the tag identifier with the most significant of the whole tag number in bit 7.
    * Bits 7 to 1 of the final byte with bit 8 set to 0 are also part of the tag identifier.
* The **Length** portion is the total length of the Data portion that follows it. Lengths can be either short form or long form:
  * Short form: one byte long in the range 0x00 to 0x7F.
  * Long form: multiple bytes long, starting with one byte 0x80 or greater, where the lower 7 bits specify how many subsequent bytes are used to indicate the length. Example: length 8201C3 — 0x82 indicates two subsequent bytes (0x01C3) giving the total length of the data block (451 bytes).
  * DER stipulates all TLV objects should be encoded using the smallest length required to fit the data.
* The **Value** or **Data** portion is the actual payload of the TLV data object.

This document provides message definitions in hexadecimal format; when the host constructs or interprets a message, if no additional encode/decode filtering or translation is in place at the platform layer, it should expect each hexadecimal value shown in this document to be represented as binary bytes in the message stream, not as string literals. For example, FF is a single byte with all bits set to 1, not the two-byte string literal "FF."

#### TLV Example

Below is an example of a TLV-encoded request and response for **Command 0xDF01 - Echo**, wrapped in the standard message format.

Host sends the device the binary byte stream:

```
AA0081040101DF018407DF018103010203
```

Breakdown:

* AA00 = Standard Start of Message / API Framework Version (not TLV)
* 81, 04, 0101DF01
  * Tag 81 = Request Message Parameter 1, **Message Information**
  * Length 04
  * Value 01 01 DF 01
    * 01 = Request from host to device
    * 01 = Message reference number
    * DF01 = **Command 0xDF01 - Echo**
* 84, 07, DF018103010203
  * Tag 84 = Request Message Parameter 4, **Request Payload**
  * Length 07
  * Value DF01 81 03 01 02 03
    * DF01 = Payload format is for Request **Command 0xDF01 - Echo** (not TLV)
    * Tag 81 = Payload Parameter 1, **Value to Echo**
    * Length 03
    * Value 01 02 03 = Value to Echo

Device responds with the binary byte stream:

```
AA0081048201DF018204000000008407DF018103010203
```

Breakdown:

* AA00 = Standard Start of Message / API Framework Version (not TLV)
* 81, 04, 8201DF01
  * Tag 81 = Response Message Parameter 1, **Message Information**
  * Length 04
  * Value 82 01 DF 01
    * 82 = Response from device to host
    * 01 = Message reference number
    * DF01 = **Command 0xDF01 - Echo**
* 82, 04, 00000000
  * Tag 82 = Response Message Parameter 2, **Response Status** (one byte Operation Status Summary, three bytes Operation Status Detail)
  * Length 04
  * Value 00 00 00 00 = OK / Done, General / All Good / Requested operation was successful
* 84, 07, DF018103010203
  * Tag 84 = Response Message Parameter 4 for **Response Payload**
  * Length 07
  * Value DF01 81 03 01 02 03
    * DF01 = Payload format is for Response **Command 0xDF01 - Echo** (not TLV)
    * Tag 81 = Payload Parameter 1, **Value to Echo**
    * Length 03
    * Value 01 02 03 = Value to Echo

## How to Read TLV Tables

Tables that show TLV data objects use slashes in front of the **Tag** identifier to indicate that object’s relative level of nesting/containment within other TLV data objects in the same table. These levels are relative and not absolute: a given TLV object may be nested within other TLV objects at any level.

Example of slash notation:

* Earth contains
  * /North America, which contains
    * //United States, which contains
      * ///California

In TLV tables, a Length of **var** means the length is variable and must be calculated based on nested objects.

See Table 10 below for an example.

#### Table 10 - TLV Table Example

<table><thead><tr><th width="80.33331298828125">Tag</th><th width="72">Len</th><th>Value / Description</th><th width="70">Typ</th><th width="87">Req</th><th width="121.00006103515625">Default</th></tr></thead><tbody><tr><td>A1</td><td>var</td><td>TLV data object <strong>A1</strong> contains four directly nested TLV data objects: 81, 82, A3, and 84 (A1/81, A1/82, A1/A3, and A1/84). A1/82 is optional (Req = <strong>O</strong>), so the length of A1 will vary depending on whether or not A1/82 is included (Len = <strong>var</strong>).</td><td>T</td><td>R</td><td></td></tr><tr><td>/81</td><td>01</td><td>TLV data object A1/81 contains one byte and is required. It has no default value because it must be explicitly included.</td><td>B</td><td>R</td><td></td></tr><tr><td>/82</td><td>03</td><td>TLV data object A1/82 contains three bytes but is optional. If not included, the device assumes the default value 0x4D6F6D.</td><td>B</td><td>O</td><td>0x4D6F6D</td></tr><tr><td>/A3</td><td>08</td><td>TLV data object A1/A3 contains two TLV data objects: 81 and 82 (A1/A3/81 and A1/A3/82). Its length is the combined length of its two nested objects.</td><td>T</td><td>R</td><td></td></tr><tr><td>//81</td><td>03</td><td>TLV data object A1/A3/81 contains three bytes and is required.</td><td>B</td><td>R</td><td></td></tr><tr><td>//82</td><td>01</td><td>TLV data object A1/A3/82 contains one byte and is required.</td><td>B</td><td>R</td><td></td></tr><tr><td>/84</td><td>03</td><td>TLV data object A1/84 contains three bytes that represent distinct values stored directly inside A1/84 instead of separate nested TLVs.</td><td>B</td><td>R</td><td></td></tr><tr><td>//null</td><td>(1)</td><td>Raw byte inside 84 (no TLV). Tag shown as <strong>/null</strong>, length in parentheses.</td><td>B</td><td>R</td><td></td></tr><tr><td>//null</td><td>(1)</td><td>Another raw byte inside 84.</td><td>B</td><td>R</td><td></td></tr><tr><td>//null</td><td>(1)</td><td>Another raw byte inside 84.</td><td>B</td><td>R</td><td></td></tr></tbody></table>

Each message type follows a specific structure described below.

## Request Message

## Table - Request Message Format

<table><thead><tr><th width="79.33331298828125">Tag</th><th width="73.66668701171875">Len</th><th>Value / Description</th><th width="80.66668701171875">Typ</th><th width="85">Req</th><th width="110.66656494140625">Default</th></tr></thead><tbody><tr><td>-</td><td>-</td><td>One byte standard <strong>Start of Message</strong> constant, not in TLV format. 0xAA = Standard start of message byte.</td><td>-</td><td>-</td><td>-</td></tr><tr><td>-</td><td>-</td><td>One-byte standard <strong>API Framework Version</strong>, not TLV. Values: 0x00 = Pre-production, 0x01 = First production release, 0x02 = Second production release, etc.</td><td>-</td><td>-</td><td>-</td></tr><tr><td>81</td><td>var</td><td>Message Information</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Message Type &#x26; Direction: 0x01 = Request from host to device; 0x81 = Request from device to host (Reserved)</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Message Reference Number</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(2)</td><td>Command ID — fully qualified Command number (Command Group, Command within that group). If the Request Payload contains wrappers, the host should specify the command invoked at the core after wrappers are removed.</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(var)</td><td>Reserved</td><td></td><td>O</td><td></td></tr><tr><td>84</td><td>var</td><td>Request Payload — as documented in the message’s Request table in section <strong>Commands</strong>.</td><td>B</td><td>R</td><td></td></tr><tr><td>9E</td><td>var</td><td>Reserved</td><td>B</td><td>O</td><td></td></tr></tbody></table>

Notes:

* Message Reference Number: host can use any value to match responses; device echoes it in responses. Recommended: incrementing counter per request within a session.

## Response Message

## Table - Response Message Format

## Table - Operation Status Detail Codes

The tables below list operation status detail codes grouped by source and code. (Only a representative subset is shown here; see the full document for all codes.)

## General (group 0x00)

{% hint style="info" %}
The General group 0x00 contains operation status detail codes related to the platform that do not originate from a specific functional module.

Subgroup 0x00 = General
{% endhint %}

<table data-header-hidden><thead><tr><th width="77"></th><th width="59.3636474609375"></th><th width="57.727294921875"></th><th></th></tr></thead><tbody><tr><td>Grp</td><td>Sub</td><td>Cde</td><td>Meaning</td></tr><tr><td>00</td><td>00</td><td>00</td><td>All good / requested operation was successful.</td></tr><tr><td>00</td><td>00</td><td>02</td><td>Requested Operation Failed</td></tr><tr><td>00</td><td>00</td><td>10</td><td>Setting up RTC data and time failure</td></tr><tr><td>00</td><td>00</td><td>11</td><td>Setting up RTC alarm failure</td></tr><tr><td>00</td><td>00</td><td>12</td><td>Key generation failure</td></tr><tr><td>00</td><td>00</td><td>13</td><td>Tamper setting is locked, can’t be changed</td></tr><tr><td>00</td><td>00</td><td>14</td><td>Tamper setting requires system reset to continue</td></tr><tr><td>00</td><td>00</td><td>15</td><td>Tamper status can’t be cleared, failure</td></tr><tr><td>00</td><td>00</td><td>16</td><td>Device has been tampered, need attention</td></tr><tr><td>00</td><td>00</td><td>17</td><td>Tamper module failed for other cases</td></tr><tr><td>00</td><td>00</td><td>18</td><td>Setting WLAN SoftAP password failure</td></tr></tbody></table>

## Message Handler (group 0x01)

{% hint style="info" %}
The Message Handler group 0x01 contains operation status detail codes related to parsing and validating messages.

Subgroup 0x01 = Device issues that prevent Message Processing (e.g., Critical Battery, Pending Reset, System Failure, System Busy).
{% endhint %}

<table data-header-hidden><thead><tr><th width="68.8182373046875"></th><th width="59.6363525390625"></th><th width="76.27276611328125"></th><th></th></tr></thead><tbody><tr><td>Grp</td><td>Sub</td><td>Cde</td><td>Meaning</td></tr><tr><td>01</td><td>01</td><td>01</td><td>Generic Failure.</td></tr><tr><td>01</td><td>01</td><td>02</td><td>Bad message parameter.  The host has sent a message to the device that is not constructed properly.</td></tr><tr><td>01</td><td>01</td><td>09</td><td>Device offline, can not process messages.  For example, the device returns this detail code when it does not have keys injected or has registered a tamper.</td></tr><tr><td>01</td><td>01</td><td>10</td><td>PIN Key Not Mapped.</td></tr><tr><td>01</td><td>01</td><td>13</td><td>Feature Not Available</td></tr></tbody></table>

## Request Handler (group 0x02) — representative entries

{% hint style="info" %}
The Request Handler group 0x02 contains operation status detail codes related to starting actual command requests.

* Subgroup 0x01 = Data issues (bad, missing, unknown…)
* Subgroup 0x02 = Security / permission problems
* Subgroup 0x03 = Device state issues (busy, not permitted, tampered, low battery)
* Subgroup 0x04 = Device issues (missing hardware or features)
* Subgroup 0x05 = TR31 Errors
  {% endhint %}

<table data-header-hidden><thead><tr><th width="56.09088134765625"></th><th width="65.45452880859375"></th><th width="64.81817626953125"></th><th></th></tr></thead><tbody><tr><td>Grp</td><td>Sub</td><td>Cde</td><td>Meaning</td></tr><tr><td>02</td><td>00</td><td>00</td><td>Reserved</td></tr><tr><td>02</td><td>01</td><td>00</td><td>Reserved</td></tr><tr><td>02</td><td>01</td><td>01</td><td>Generic Failure</td></tr><tr><td>02</td><td>01</td><td>02</td><td>Bad Message Parameter</td></tr><tr><td>02</td><td>01</td><td>03</td><td>Response Payload too big</td></tr><tr><td>02</td><td>01</td><td>07</td><td>Internal FW Failure</td></tr><tr><td>02</td><td>01</td><td>0A</td><td>Image Failure</td></tr><tr><td>02</td><td>01</td><td>19</td><td>Key does not exist</td></tr><tr><td>02</td><td>01</td><td>1A</td><td>Not Secured</td></tr><tr><td>02</td><td>01</td><td>1B</td><td>Passcode validation failed</td></tr><tr><td>02</td><td>01</td><td>1C</td><td>Device is locked</td></tr><tr><td>02</td><td>01</td><td>1D</td><td>Device in Restricted mode</td></tr><tr><td>02</td><td>02</td><td>00</td><td>Reserved</td></tr><tr><td>02</td><td>03</td><td>04</td><td>Failed, device state issue, no transaction.</td></tr><tr><td>02</td><td>03</td><td>05</td><td>Failed, device state issue, cannot cancel.</td></tr><tr><td>02</td><td>03</td><td>08</td><td>Failed, device state, Transaction in Progress.</td></tr><tr><td>02</td><td>03</td><td>0C</td><td>Failed, device state, Signature Not allowed</td></tr><tr><td>02</td><td>03</td><td>0D</td><td>Failed, device state, Wrong Transaction State</td></tr><tr><td>02</td><td>03</td><td>0E</td><td>Failed, device state, Invalid PIN Entry State</td></tr><tr><td>02</td><td>03</td><td>0F</td><td>Failed, device state, PIN Entry in Session.</td></tr><tr><td>02</td><td>03</td><td>11</td><td>Failed, device state, Barcode Read in Progress.</td></tr><tr><td>02</td><td>03</td><td>12</td><td>Failed, device state, Pass-through command Not Activated.</td></tr><tr><td>02</td><td>03</td><td>14</td><td>Failed, device state, UI Settings in Progress.</td></tr><tr><td>02</td><td>03</td><td>15</td><td>Failed, device state, Buzzer in Progress</td></tr><tr><td>02</td><td>03</td><td>16</td><td>Failed, device state, Low Battery (5% or less)</td></tr><tr><td>02</td><td>03</td><td>18</td><td>Request is invalid while card emulation is in progress</td></tr><tr><td>02</td><td>03</td><td>1E</td><td>Failed, device state, pass-through mode started</td></tr><tr><td>02</td><td>03</td><td>1F</td><td>Failed, device state, pass-through mode is not started</td></tr><tr><td>02</td><td>03</td><td>20</td><td>Failed, device state, pass-through mode APDU is in progress</td></tr><tr><td>02</td><td>04</td><td>13</td><td>Failed, BCR hardware not found.</td></tr><tr><td>02</td><td>05</td><td>01</td><td>Invalid TR31parameter</td></tr><tr><td>02</td><td>05</td><td>02</td><td>Invalid AES length</td></tr><tr><td>02</td><td>05</td><td>03</td><td>Invalid 16-Byte Boundary</td></tr><tr><td>02</td><td>05</td><td>04</td><td>Invalid Length in Message</td></tr><tr><td>02</td><td>05</td><td>05</td><td>Invalid number of optional KBH</td></tr><tr><td>02</td><td>05</td><td>06</td><td>Error in conversion of data type</td></tr><tr><td>02</td><td>05</td><td>07</td><td>Invalid KCV algorithm</td></tr><tr><td>02</td><td>05</td><td>08</td><td>Invalid KCV length</td></tr><tr><td>02</td><td>05</td><td>09</td><td>Invalid Optional KBH ID</td></tr><tr><td>02</td><td>05</td><td>0A</td><td>Invalid KBH ID</td></tr><tr><td>02</td><td>05</td><td>0B</td><td>Invalid algorithm used in KBH</td></tr><tr><td>02</td><td>05</td><td>0C</td><td>Invalid KBH usage</td></tr><tr><td>02</td><td>05</td><td>0D</td><td>Invalid KBH length</td></tr><tr><td>02</td><td>05</td><td>0E</td><td>Invalid version ID for key derivation</td></tr><tr><td>02</td><td>05</td><td>0F</td><td>Invalid KBH mode of use</td></tr><tr><td>02</td><td>05</td><td>10</td><td>TR31 engine not installed</td></tr><tr><td>02</td><td>05</td><td>11</td><td>Invalid Cryptographic operation</td></tr><tr><td>02</td><td>05</td><td>12</td><td>MAC Verification Failed</td></tr><tr><td>02</td><td>05</td><td>13</td><td>Error in Decrypting Key data</td></tr><tr><td>02</td><td>05</td><td>14</td><td>Error in computing MAC over entire message</td></tr><tr><td>02</td><td>05</td><td>15</td><td>Invalid MAC length</td></tr><tr><td>02</td><td>05</td><td>16</td><td>KDF Error</td></tr><tr><td>02</td><td>05</td><td>17</td><td>Buffer Insufficient</td></tr><tr><td>02</td><td>05</td><td>18</td><td>Invalid Storage KPM</td></tr><tr><td>02</td><td>05</td><td>19</td><td>Invalid Storage Secure RAM</td></tr><tr><td>02</td><td>05</td><td>1A</td><td>Invalid Key ID specified in option block</td></tr><tr><td>02</td><td>05</td><td>1B</td><td>Unsupported Key ID specified in option block</td></tr><tr><td>02</td><td>05</td><td>1C</td><td>Invalid Key ID Relationship</td></tr><tr><td>02</td><td>05</td><td>1D</td><td>Protection Key ID not loaded</td></tr><tr><td>02</td><td>05</td><td>1E</td><td>Invalid Data Tag MagTek Custom option block</td></tr><tr><td>02</td><td>05</td><td>1F</td><td>Invalid Kcv</td></tr><tr><td>02</td><td>05</td><td>20</td><td>Invalid Data</td></tr><tr><td>02</td><td>05</td><td>21</td><td>Invalid DUKPT key derivation</td></tr><tr><td>02</td><td>05</td><td>22</td><td>Invalid Exportability</td></tr><tr><td>02</td><td>05</td><td>23</td><td>Invalid Key Class</td></tr><tr><td>02</td><td>05</td><td>24</td><td>Invalid DSN</td></tr><tr><td>02</td><td>05</td><td>25</td><td>Invalid Challenge</td></tr><tr><td>02</td><td>05</td><td>26</td><td>Key Undeletable</td></tr><tr><td>02</td><td>05</td><td>27</td><td>Key not present</td></tr><tr><td>02</td><td>05</td><td>28</td><td>Unsupported Keyset ID</td></tr><tr><td>02</td><td>05</td><td>29</td><td>KPM Error</td></tr><tr><td>02</td><td>05</td><td>2A</td><td>Secure RAM Error</td></tr><tr><td>02</td><td>05</td><td>2B</td><td>Duplicated Key</td></tr><tr><td>02</td><td>05</td><td>2C</td><td>Invalid Key Usage Rule</td></tr><tr><td>02</td><td>05</td><td>2D</td><td>Selftest Key Corrupted</td></tr><tr><td>02</td><td>05</td><td>2E</td><td>Selftest System Key Bitmap Corrupted</td></tr><tr><td>02</td><td>05</td><td>2F</td><td>Selftest System Key Missing</td></tr><tr><td>02</td><td>05</td><td>30</td><td>Selftest System Key Not Loaded</td></tr><tr><td>02</td><td>05</td><td>31</td><td>Invalid Key Storage Limit</td></tr><tr><td>02</td><td>05</td><td>32</td><td>Duplicated Key set</td></tr><tr><td>02</td><td>05</td><td>33</td><td>Key Restriction</td></tr><tr><td>02</td><td>05</td><td>34</td><td>Key Transported by Weaker key</td></tr><tr><td>02</td><td>05</td><td>35</td><td>Repeat Key Agreement</td></tr><tr><td>02</td><td>05</td><td>36</td><td>Security not activated</td></tr><tr><td>02</td><td>05</td><td>37</td><td>Selftest key relocated</td></tr><tr><td>02</td><td>05</td><td>38</td><td>Invalid Selftest Scanned Versus Saved Bitmap</td></tr></tbody></table>

## Notification Message

## Table - Notification Message Format

<table><thead><tr><th width="76.6666259765625">Tag</th><th width="75.33331298828125">Len</th><th>Value / Description</th><th width="73">Typ</th><th width="74.66668701171875">Req</th><th width="97.66668701171875">Default</th></tr></thead><tbody><tr><td>-</td><td>-</td><td>One byte standard <strong>Start of Message</strong> constant, not TLV. 0xAA = Standard start of message byte.</td><td>-</td><td>-</td><td>-</td></tr><tr><td>-</td><td>-</td><td>One-byte standard <strong>API Framework Version</strong>, not TLV. Values as in requests/responses.</td><td>-</td><td>-</td><td>-</td></tr><tr><td>81</td><td>4</td><td>Message Information</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Message Type &#x26; Direction: 0x03 = Notification from host to device (Reserved); 0x83 = Notification from device to host.</td><td></td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Reserved, set to 0x00</td><td></td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Notification Source — this byte and Notification Type form the first two bytes of a six-byte Notification ID. Use this byte to look up the Notification Group in <strong>7 Notifications</strong>. Example values: 0x01 = Transaction; 0x09 = Firmware Update; 0x10 = Device; 0x18 = User Interface.</td><td></td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Notification Type — append to Notification Source to identify specific notification (e.g., 0x01 = Information Update; 0x02 = Warning; 0x03 = Action Request; 0x04 = Callback; 0x05 = Operation Complete).</td><td></td><td>R</td><td></td></tr><tr><td>/null</td><td>(var)</td><td>Reserved</td><td></td><td>O</td><td></td></tr><tr><td>82</td><td>(4)</td><td>Notification Detail Code — combined with Notification Source and Notification Type to form a unique six-byte Notification ID. See section <strong>7 Notifications</strong> for notification-specific detail codes.</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>1</td><td>Category — e.g., 0x00 = Power/Reset</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>1</td><td>Reason — e.g., 0x02 = Battery</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>1</td><td>Reason Detail (Subgroup) — e.g., 0x01 = Power Down Imminent</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>1</td><td>Reserved, set to 0x00</td><td>B</td><td>R</td><td></td></tr><tr><td>83</td><td>var</td><td>Additional Detail — see notification definition in section <strong>7 Notifications</strong>.</td><td></td><td>O</td><td></td></tr><tr><td>84</td><td>var</td><td>Notification Payload — as documented in the notification’s table in section <strong>7 Notifications</strong>.</td><td>B</td><td>O</td><td></td></tr><tr><td>9E</td><td>var</td><td>Reserved</td><td>B</td><td>O</td><td></td></tr></tbody></table>

## Data File Message

This message type is used exclusively for transferring larger blocks of data treated as files. It is valid only after successful invocation of the appropriate file operation commands (for example, **Command 0xD811 - Start Send File to Device (Secured)**, **Command 0xD812 - Start Send File to Device (Unsecured)**, or **Command 0xD821 - Start Get File from Device**).

## Table - Data File Message Format

<table><thead><tr><th width="78.66668701171875">Tag</th><th width="78.33331298828125">Len</th><th>Value / Description</th><th width="75.6666259765625">Typ</th><th width="79">Req</th><th width="99.0001220703125">Default</th></tr></thead><tbody><tr><td>-</td><td>-</td><td>One byte standard <strong>Start of Message</strong> constant, not TLV. 0xAA = Standard start of message byte.</td><td>-</td><td>-</td><td>-</td></tr><tr><td>-</td><td>-</td><td>One-byte standard <strong>API Framework Version</strong>, not TLV. Values as in requests/responses.</td><td>-</td><td>-</td><td>-</td></tr><tr><td>81</td><td>08</td><td>Message Information</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Message Type &#x26; Direction: 0x04 = Data file from host to device; 0x84 = Data file from device to host.</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(1)</td><td>Message Reference Number — host value to match responses.</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(2)</td><td>Command Number that prompted this message (see Command Group 0xD8nn - File Operations).</td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td>(4)</td><td>File Type — the file type as defined in Command Group 0xD8nn - File Operations.</td><td>B</td><td>R</td><td></td></tr><tr><td>84</td><td>var</td><td>File Payload — as documented in section <strong>6.7.1 About Files</strong>.</td><td>B</td><td>R</td><td></td></tr></tbody></table>

## Table - Data File Message Example

Example (Hex)

```
AA 00 81 08 84 08 D8 21 00 00 00 01 84 40 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 
11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 
31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
```


---

# 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/dynaflex-ii-ped/documentation/developers-manuals/dynaflex-ii-ped-programmers-manual/messages.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.
