<br />

Added: 7

## **PROTOCOLS**

## ClientStateConnector

*Defined in [fuchsia.thermal/client_state.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/client_state.fidl;l=22)*

Allows a client to connect a [ClientStateWatcher](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateWatcher) to the thermal state of
a given [ClientType](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientType).

<br />

### Connect

Connects a [ClientStateWatcher](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateWatcher) to the thermal state of the specified
[ClientType](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientType).

A client may call this method and begin using the [ClientStateWatcher](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateWatcher)
client endpoint immediately.

If `client_type` does not exactly (case-sensitive) match with a client
entry found in the central thermal configuration, then the request will
fail. On failure, both the `watcher` server endpoint as well as the
current `ClientStateConnector` connection will be terminated.

- `client_type` specifies the client-specific thermal state to which
  `watcher` should be connected. The value is valid iff it matches with a
  client entry found in the central thermal configuration.

- `watcher` is the server endpoint of a [ClientStateWatcher](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateWatcher) channel
  that will be connected to the thermal state of `client_type`.

#### Request

| Name | Type |
|---|---|
| `client_type` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientType` |
| `watcher` | `server_end:https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateWatcher` |

## ClientStateWatcher

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

Allows a client to watch for changes to its thermal state.

This protocol cannot be connected to the service directly. Instead, the
server endpoint of a `ClientStateWatcher` channel must be connected to the
thermal state of the desired client type using the
\[`ClientStateConnector.Connect'] method. The client endpoint of a `ClientStateWatcher\` channel is only useful after it has been connected in
this way.

<br />

### Watch

Watches for changes to a client's thermal state.

A client's thermal state is determined according to the central thermal
configuration of its specific type. See the
[README.md](https://fuchsia.dev/src/power/power-manager/thermal_config/README) for more
details.

On a given connection, the first call will return immediately with the
client's current thermal state. Subsequent `Watch` requests will only
return a new `state` if the client's thermal state has changed. This
follows the [hanging
get](https://fuchsia.dev/fuchsia-src/concepts/api/fidl#hanging-get)
pattern.

- `state` is an unsigned integer representing the client's thermal state.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `state` | `uint64` |

## SensorManager

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

Interface that manages interactions and the working state of thermal sensors.
Added: HEAD

<br />

### ClearTemperatureOverride

Clears the temperature override set by `SetTemperatureOverride`.
If no temperature override has been set, this interaction does nothing.

If a sensor with the given `name` is not found,
`ClearTemperatureOverrideError.SENSOR_NOT_FOUND` is returned.

#### Request

| Name | Type |
|---|---|
| `name` | `https://fuchsia.dev/reference/fuchsia.hardware.temperature//https://fuchsia.dev/reference/fuchsia.hardware.temperature#SensorName` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_ClearTemperatureOverride_Result` |

### Connect

Connects to the thermal sensor with the given `name`.

If any required arguments are not provided,
`ConnectError.INVALID_ARGUMENTS` is returned.

If a sensor with the given `name` is not found,
`ConnectError.SENSOR_NOT_FOUND` is returned.

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManagerConnectRequest` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_Connect_Result` |

### ListSensors

Lists sensors that may be controlled and connected to by clients.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_ListSensors_Result` |

### SetTemperatureOverride

Sets an override temperature for the sensor with `name`.

When an override temperature is set, internal thermal policies will
use the override temperature. Temperature values retrieved from
sensor connections vended by `Connect` will also receive the override
temperature.

This interaction does not affect the thermal sensor itself.
Clients who connect directly to the sensor without `Connect` will
receive the real sensor value.

If a sensor with the given `name` is not found,
`SetTemperatureOverrideError.SENSOR_NOT_FOUND` is returned.

#### Request

| Name | Type |
|---|---|
| `name` | `https://fuchsia.dev/reference/fuchsia.hardware.temperature//https://fuchsia.dev/reference/fuchsia.hardware.temperature#SensorName` |
| `override_temperature` | `float32` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_SetTemperatureOverride_Result` |

## **STRUCTS**

### SensorManager_ClearTemperatureOverride_Response

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=85)*

\<EMPTY\>

### SensorManager_Connect_Response

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=100)*

\<EMPTY\>

### SensorManager_ListSensors_Response

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=56)*

| Field | Type | Description | Default |
|---|---|---|---|
| `sensors` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorInfo>` |   | No default |

### SensorManager_SetTemperatureOverride_Response

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=76)*

\<EMPTY\>

## **ENUMS**

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

Type: `uint32`

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=38)*

Errors returned from calls to `SensorManager.ClearTemperatureOverrideError`.
Added: HEAD

<br />

| Name | Value | Description |
|---|---|---|
| ### INTERNAL | `1` |   |
| ### SENSOR_NOT_FOUND | `2` |   |

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

Type: `uint32`

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=45)*

Errors returned from calls to `SensorManager.ConnectError`.
Added: HEAD

<br />

| Name | Value | Description |
|---|---|---|
| ### INTERNAL | `1` |   |
| ### INVALID_ARGUMENTS | `2` |   |
| ### SENSOR_NOT_FOUND | `3` |   |

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

Type: `uint32`

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=31)*

Errors returned from calls to `SensorManager.SetTemperatureOverride`.
Added: HEAD

<br />

| Name | Value | Description |
|---|---|---|
| ### INTERNAL | `1` |   |
| ### SENSOR_NOT_FOUND | `2` |   |

## **TABLES**

### SensorInfo

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=23)*

Information about a sensor.
Added: HEAD

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `name` | `https://fuchsia.dev/reference/fuchsia.hardware.temperature//https://fuchsia.dev/reference/fuchsia.hardware.temperature#SensorName` | Unique board-level sensor name/type identifier (for example, matched by client thermal configurations and exposed as `thermal_zone<N>/type` in Starnix). |

### SensorManagerConnectRequest [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=94)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `name` | `https://fuchsia.dev/reference/fuchsia.hardware.temperature//https://fuchsia.dev/reference/fuchsia.hardware.temperature#SensorName` | Required. |
| ### 2 | `server_end` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorServer` | Required. Selects which protocol interface (`temperature` or `trippoint`) to connect on the sensor. |

## **UNIONS**

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

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=85)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_ClearTemperatureOverride_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClearTemperatureOverrideError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

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

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=100)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_Connect_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#ConnectError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

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

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=56)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_ListSensors_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

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

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=76)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SensorManager_SetTemperatureOverride_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.thermal#SetTemperatureOverrideError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

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

*Defined in [fuchsia.thermal/sensor_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/sensor_manager.fidl;l=11)*

The server end for a thermal sensor connection.
Added: HEAD

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `temperature` | `server_end:https://fuchsia.dev/reference/fuchsia.hardware.temperature//https://fuchsia.dev/reference/fuchsia.hardware.temperature#Device` | Connects to the sensor's `fuchsia.hardware.temperature.Device` protocol. |
| ### 2 | `trippoint` | `server_end:https://fuchsia.dev/reference/fuchsia.hardware.trippoint//https://fuchsia.dev/reference/fuchsia.hardware.trippoint#TripPoint` | Connects to the sensor's `fuchsia.hardware.trippoint.TripPoint` protocol. Trip point configuration (`SetTripPoints`, `GetTripPointDescriptors`, and `WaitForAnyTripPoint`) is shared across all clients connected to the same sensor. |

<br />

## **CONSTANTS**

| Name | Value | Type | Description |
|---|---|---|---|
| [MAX_THERMAL_LOAD](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/thermal.fidl;l=41) | `100` | `uint32` | The maximum value of the normalized thermal load. This value bounds the width (and therefore also the precision) of the normalized thermal limiting range starting from 0. Trip points must be specified within this range. |

## **ALIASES**

| Name | Value | Description |
|---|---|---|
| [ClientType](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/client_state.fidl;l=17) | `string`\[`8`\] | A string that represents the type of client using the protocol. `ClientType` is used as a parameter to [ClientStateConnector.Connect](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateConnector.Connect) to connect a [ClientStateWatcher](https://fuchsia.dev/reference/fidl/fuchsia.thermal#ClientStateWatcher) to the thermal state of the desired client type. A `ClientType` value should describe the type of subsystem a client represents and must exactly (case-sensitive) match with a client entry found in the central thermal configuration. Typical examples include "audio", "wifi", etc. |