blob: 0b7f11ddc9c89853d973bebe62081bc5d01202ae [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.thermal
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## ClientStateConnector {#ClientStateConnector}
*Defined in [fuchsia.thermal/client_state.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/client_state.fidl;l=22)*
<p>Allows a client to connect a <a class='link' href='#ClientStateWatcher'>ClientStateWatcher</a> to the thermal state of
a given <a class='link' href='#ClientType'>ClientType</a>.</p>
### Connect {#ClientStateConnector.Connect}
<p>Connects a <a class='link' href='#ClientStateWatcher'>ClientStateWatcher</a> to the thermal state of the specified
<a class='link' href='#ClientType'>ClientType</a>.</p>
<p>A client may call this method and begin using the <a class='link' href='#ClientStateWatcher'>ClientStateWatcher</a>
client endpoint immediately.</p>
<p>If <code>client_type</code> 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 <code>watcher</code> server endpoint as well as the
current <code>ClientStateConnector</code> connection will be terminated.</p>
<ul>
<li>
<p><code>client_type</code> specifies the client-specific thermal state to which
<code>watcher</code> should be connected. The value is valid iff it matches with a
client entry found in the central thermal configuration.</p>
</li>
<li>
<p><code>watcher</code> is the server endpoint of a <a class='link' href='#ClientStateWatcher'>ClientStateWatcher</a> channel
that will be connected to the thermal state of <code>client_type</code>.</p>
</li>
</ul>
#### Request {#ClientStateConnector.Connect_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>client_type</code></td>
<td>
<code><a class='link' href='#ClientType'>ClientType</a></code>
</td>
</tr>
<tr>
<td><code>watcher</code></td>
<td>
<code>server_end&lt;<a class='link' href='#ClientStateWatcher'>ClientStateWatcher</a>&gt;</code>
</td>
</tr>
</table>
## 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)*
<p>Allows a client to watch for changes to its thermal state.</p>
<p>This protocol cannot be connected to the service directly. Instead, the
server endpoint of a <code>ClientStateWatcher</code> channel must be connected to the
thermal state of the desired client type using the
[<code>ClientStateConnector.Connect'] method. The client endpoint of a </code>ClientStateWatcher` channel is only useful after it has been connected in
this way.</p>
### Watch {#ClientStateWatcher.Watch}
<p>Watches for changes to a client's thermal state.</p>
<p>A client's thermal state is determined according to the central thermal
configuration of its specific type. See the
<a href="/src/power/power-manager/thermal_config/README.md">README.md</a> for more
details.</p>
<p>On a given connection, the first call will return immediately with the
client's current thermal state. Subsequent <code>Watch</code> requests will only
return a new <code>state</code> if the client's thermal state has changed. This
follows the <a href="https://fuchsia.dev/fuchsia-src/concepts/api/fidl#hanging-get">hanging
get</a>
pattern.</p>
<ul>
<li><code>state</code> is an unsigned integer representing the client's thermal
state.</li>
</ul>
#### Request {#ClientStateWatcher.Watch_Request}
&lt;EMPTY&gt;
#### Response {#ClientStateWatcher.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>state</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="MAX_THERMAL_LOAD">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/thermal.fidl;l=41">MAX_THERMAL_LOAD</a></td>
<td>
<code>100</code>
</td>
<td><code>uint32</code></td>
<td><p>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.</p>
</td>
</tr>
</table>
## **TYPE ALIASES**
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="ClientType">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.thermal/client_state.fidl;l=17">ClientType</a></td>
<td>
<code>string</code>[<code>8</code>]</td>
<td><p>A string that represents the type of client using the protocol.</p>
<p><code>ClientType</code> is used as a parameter to <a class='link' href='#ClientStateConnector.Connect'>ClientStateConnector.Connect</a> to
connect a <a class='link' href='#ClientStateWatcher'>ClientStateWatcher</a> to the thermal state of the desired client
type.</p>
<p>A <code>ClientType</code> 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 &quot;audio&quot;,
&quot;wifi&quot;, etc.</p>
</td>
</tr>
</table>