协议
连接线
在 fuchsia.power.clientlevel/clientlevel.fidl 中定义
允许客户端将 Watcher 连接到给定 ClientType 的功耗等级。
连接
将 Watcher 连接到指定 ClientType 的电源级别。
客户端可以调用此方法,并立即开始使用 Watcher 客户端端点。
如果提供的 client_type
不存在电源配置,则请求将失败。失败时,watcher
服务器
端点,当前的 Connector
连接也将
已终止。
-
client_type
指定watcher
应连接到哪个 ClientType 功耗级别。当当幂为幂时,该值才有效 配置已存在。client_type
-
watcher
是 Watcher 频道的服务器端点, 连接到 ClientType 电源级别。
请求
名称 | 类型 |
---|---|
client_type |
ClientType
|
watcher |
server_end:Watcher
|
Watcher
在 fuchsia.power.clientlevel/clientlevel.fidl 中定义
允许客户端监视给定功率电平的变化 ClientType。
此协议无法直接连接到服务。而是必须先使用 Connector.Connect 方法将 Watcher
通道的服务器端点连接到所需 ClientType 的电源级别。Watcher
信道的客户端端点只有在以这种方式连接后才有用。
观看
监视已连接的 ClientType 的电源电平变化。
给定 ClientType 的功耗级别取决于该 ClientType 的功耗配置。请参阅 README.md 了解详情。
在给定连接中,第一个调用将立即返回已连接 ClientType 的当前电量。后续Watch
请求将只返回新的 level
,前提是
连接的 ClientType 已更改。这遵循了挂起
获取
格式。
level
是一个无符号整数,表示已连接的 ClientType 的功耗等级。
请求
<EMPTY>
响应
名称 | 类型 |
---|---|
level |
uint64
|
枚举
ClientType 灵活
类型:uint32
在 fuchsia.power.clientlevel/clientlevel.fidl 中定义
一个值,表示使用该协议的客户端类型。
ClientType
可用作以下参数:
- Connector.Connect,用于将 Watcher 连接到指定客户端类型的电源级别
- fuchsia.power.systemmode/ClientConfigurator.Get 和 通过 fuchsia.power.systemmode/ClientConfigurator.Set 更新电源 指定客户端类型的配置
名称 | 值 | 说明 |
---|---|---|
WLAN |
1 |