<br />

Added: HEAD

## **PROTOCOLS**

## Channel

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=54)*

`Channel` represents a single mailbox channel that can be used to send messages to a
destination core.

<br />

### RegisterListener

Registers a listener for incoming messages on this channel. Multiple listeners may NOT be
registered at a time. If a listener is already registered, this call will fail with
`ZX_ERR_ALREADY_BOUND`.

To unregister a listener, the server will close its end of the channel. Another listener
may be registered after the previous listener has been unregistered.

#### Request

| Name | Type |
|---|---|
| `listener` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Listener` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Channel_RegisterListener_Result` |

### SendMessage

Writes the message to the mailbox, interrupts the destination core, and (if applicable)
waits for the destination core to ack the message.

Returns `ZX_ERR_OUT_OF_RANGE` if `message` is larger than what the hardware can support.

#### Request

| Name | Type |
|---|---|
| `message` | `vector<uint8>` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Channel_SendMessage_Result` |

### SendRequest

Writes the request to the mailbox, interrupts the destination core, and
waits for the destination core to send a response.

Returns `ZX_ERR_OUT_OF_RANGE` if `request` is larger than what the hardware can support.
Returns `ZX_ERR_NOT_SUPPORTED` if the destination core does not support correlating
requests to responses.

#### Request

| Name | Type |
|---|---|
| `request` | `vector<uint8>` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Channel_SendRequest_Result` |

## Listener

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=12)*

`Listener` is used to receive messages from a mailbox channel.

The server end of this is held by the mailbox client.

<br />

### OnMessage

Called when a message is received on the mailbox channel.

The mailbox driver will not call `OnMessage` concurrently. It will wait
for the previous call to complete before sending another message.

If the client fails to respond to `OnMessage` in a timely manner, the
mailbox driver may run out of memory and drop subsequent messages.

`lease` is an optional wake lease baton passed by the mailbox driver when
the message caused or arrived during a wake event, keeping the system
awake until the listener has handled the message (or acquired its own
wake lease).

#### Request

| Name | Type |
|---|---|
| `message` | `vector<uint8>` |
| `lease` | `handle<eventpair>?` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Listener_OnMessage_Result` |

### OnRequest

Called when a request is received on the mailbox channel.

The client should process the request and return the response payload based
on what was requested. The response will be returned to the remote core by
the mailbox driver.

If the listener returns an error, the error is logged by the mailbox driver
and no response is returned to the remote core.

The same concurrency rules as `OnMessage` apply.

`lease` is an optional wake lease baton with the same semantics as in
`OnMessage`.

#### Request

| Name | Type |
|---|---|
| `message` | `vector<uint8>` |
| `lease` | `handle<eventpair>?` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Listener_OnRequest_Result` |

## **STRUCTS**

### Channel_RegisterListener_Response

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=83)*

\<EMPTY\>

### Channel_SendMessage_Response

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=61)*

\<EMPTY\>

### Channel_SendRequest_Response

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=71)*

| Field | Type | Description | Default |
|---|---|---|---|
| `response` | `vector<uint8>` |   | No default |

### Listener_OnMessage_Response

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=28)*

\<EMPTY\>

### Listener_OnRequest_Response

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=46)*

| Field | Type | Description | Default |
|---|---|---|---|
| `response` | `vector<uint8>` |   | No default |

## **TABLES**

### ChannelInfo

*Defined in [fuchsia.hardware.mailbox/metadata.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/metadata.fidl;l=7)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `channel` | `uint32` | Channel number, unique for this controller. Required. |
| ### 2 | `client` | `uint32` | Client service ID, unique for this channel. Optional. |
| ### 3 | `id` | `uint32` | Globally unique ID across all mailbox channels. Required. |

### ControllerInfo

*Defined in [fuchsia.hardware.mailbox/metadata.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/metadata.fidl;l=18)*

`ControllerInfo` is passed to mailbox controller drivers via metadata.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `id` | `uint32` | Board-specific controller ID. Optional. |
| ### 2 | `channels` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#ChannelInfo>` | Mailbox channels. Optional. |

## **UNIONS**

### Channel_RegisterListener_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=83)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Channel_RegisterListener_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Channel_SendMessage_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=61)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Channel_SendMessage_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |

<br />

### Channel_SendRequest_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=71)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Channel_SendRequest_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Listener_OnMessage_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=28)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Listener_OnMessage_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Listener_OnRequest_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=46)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.mailbox#Listener_OnRequest_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

## **SERVICES**

### Service

*Defined in [fuchsia.hardware.mailbox/mailbox.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=86)*

| Name | Type | Transport |
|---|---|---|
| [channel](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.mailbox/mailbox.fidl;l=87) | `fuchsia.hardware.mailbox/Channel` | Channel |

<br />