# About 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**.


---

# Agent Instructions: 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:

```
GET https://developer.magtek.com/hardware/card-readers/mms-dyna-devices/emv-common-kernel/dynaflex-ii-go/documents/programmers-manuals/programmers-manuals-commands/messages-requests-responses-notifications-and-files/about-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
