# fuchsia.castsetup

<br />

For internal Google use only.
This API is not to be used within the Fuchsia tree.
Added: 7

## **PROTOCOLS**

## ApiRegistry

*Defined in [fuchsia.castsetup/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.castsetup/server.fidl;l=35)*

Registry that hosts APIs on behalf of clients.

<br />

### RegisterApi

Registers an API that may accept incoming data.

`path` identifies how to access the API. If multiple registrations occur with
the same path, then the last registration is bound, and the rest are unbound.

`accepts_data` indicates whether this API should allow callers to provide
data in the form of a JSON string.

`security_state` indicates what level of security the caller must
adhere to.

#### Request

| Name | Type |
|---|---|
| `path` | `string:1024` |
| `api_mode` | `https://fuchsia.dev/reference/fidl/fuchsia.castsetup#ApiMode` |
| `security_state` | `https://fuchsia.dev/reference/fidl/fuchsia.castsetup#SecurityState` |
| `api_handler` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.castsetup#ApiRequestHandler` |

## ApiRequestHandler

*Defined in [fuchsia.castsetup/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.castsetup/server.fidl;l=15)*

Registered API that handles an incoming request.

<br />

### HandleRequest

Called to handle a request to this setup API. The request `data` is JSON.
The response `data` must be JSON.

#### Request

| Name | Type |
|---|---|
| `data` | `string?` |

#### Response

| Name | Type |
|---|---|
| `response_code` | `uint32` |
| `data` | `string?` |

## StateWatcher

*Defined in [fuchsia.castsetup/cast_setup.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.castsetup/cast_setup.fidl;l=8)*

Interface that allows watching of changes to the cast setup state.

<br />

### Watch

Will immediately return on first call; subsequent calls will return on
change.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `state` | `https://fuchsia.dev/reference/fidl/fuchsia.castsetup#State` |

## **ENUMS**

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

Type: `uint32`

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

API operation mode to specify during registration.

<br />

| Name | Value | Description |
|---|---|---|
| ### ACCEPTS_NO_DATA | `1` |   |
| ### ACCEPTS_DATA | `2` |   |

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

Type: `uint32`

*Defined in [fuchsia.castsetup/server.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.castsetup/server.fidl;l=8)*

Specifies the required security for a client of the API.

<br />

| Name | Value | Description |
|---|---|---|
| ### SECURITY_STATE_NONE | `0` |   |
| ### SECURITY_STATE_ENCRYPTED | `1` |   |
| ### SECURITY_STATE_TRUSTED | `2` |   |

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

Type: `uint32`

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

Enum of different possible setup states

<br />

| Name | Value | Description |
|---|---|---|
| ### UNKNOWN | `0` | State is not determined. |
| ### IN_PROGRESS | `1` | Setup is not complete and is in progress. |
| ### OFFLINE | `2` | Configured once but disconnected for now. |
| ### COMPLETE | `3` | Setup is complete and device is connected. |