| // Copyright 2023 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.hardware.fan; |
| |
| using zx; |
| using fuchsia.thermal; |
| |
| /// Fan: get and set `fan_level` |
| /// `fan_level`: 0 should be the lowest fan state, generally OFF. |
| /// Fan speed increases with `fan_level` and should |
| /// match the `fuchsia.thermal.ClientStateWatcher` |
| /// states for fans, where the states are defined |
| /// in thermal_config.json for each product. |
| /// Thus, the valid values of `fan_level` is |
| /// determined per product according to the |
| /// corresponding config json file. |
| closed protocol Fan { |
| /// Get the current fan level. |
| /// - response `status` |
| /// ZX_ERR_INTERNAL if `fan_level` is not available. |
| /// This generally means that `fan_level` has not |
| /// been initialized yet or something has gone |
| /// terribly wrong. |
| /// - response `fan_level` a uint32 field indicating the |
| /// current fan level. See fan level description above. |
| strict GetFanLevel() -> (struct { |
| status zx.Status; |
| fan_level uint32; |
| }); |
| |
| /// Set the fan level. |
| /// + request `fan_level` a uint32 field indicating the |
| /// requested fan level. See fan level description above. |
| /// - response `status` |
| /// ZX_ERR_OUT_OF_RANGE if the requested fan_level is not |
| /// valid. |
| strict SetFanLevel(struct { |
| fan_level uint32; |
| }) -> (struct { |
| status zx.Status; |
| }); |
| }; |
| |
| @discoverable |
| closed protocol Device { |
| compose Fan; |
| |
| /// Returns the client type to use for |
| /// `fuchsia.thermal.ClientStateConnector::Connect`. |
| strict GetClientType() -> (struct { |
| client_type fuchsia.thermal.ClientType; |
| }); |
| }; |