协议
设备
在 fuchsia.hardware.serial/serial.fidl 中定义
串行设备。
GetClass
查找此串行设备的类型。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
device_class |
Class
|
读取
从串行端口读取数据。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
payload |
Device_Read_Result
|
SetConfig
设置此串行设备的配置。
请求
| 名称 | 类型 |
|---|---|
config |
Config
|
响应
| 名称 | 类型 |
|---|---|
s |
zx/Result
|
写入
将数据写入串行端口。
请求
| 名称 | 类型 |
|---|---|
data |
vector<uint8>
|
响应
| 名称 | 类型 |
|---|---|
payload |
Device_Write_Result
|
DeviceProxy
在 fuchsia.hardware.serial/serial.fidl 中定义
GetChannel
请求
| 名称 | 类型 |
|---|---|
req |
server_end:Device
|
STRUCTS
配置
在 fuchsia.hardware.serial/serial.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
character_width |
CharacterWidth
|
无默认应用 | |
stop_width |
StopWidth
|
无默认应用 | |
parity |
Parity
|
无默认应用 | |
control_flow |
FlowControl
|
无默认应用 | |
baud_rate |
uint32
|
无默认应用 |
Device_Read_Response
在 fuchsia.hardware.serial/serial.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
data |
vector<uint8>
|
无默认应用 |
Device_Write_Response
在 fuchsia.hardware.serial/serial.fidl 中定义
<EMPTY>
SerialPortInfo
在 fuchsia.hardware.serial/serial.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
serial_class |
Class
|
无默认应用 | |
serial_vid |
uint32
|
连接到此串行端口的硬件的供应商 ID 和产品 ID,如果不适用,则为零。 |
无默认应用 |
serial_pid |
uint32
|
无默认应用 |
枚举
CharacterWidth strict
类型:uint8
在 fuchsia.hardware.serial/serial.fidl 中定义
每个字符的位数
| 名称 | 值 | 说明 |
|---|---|---|
BITS_5 |
1 |
|
BITS_6 |
2 |
|
BITS_7 |
3 |
|
BITS_8 |
4 |
严格类
类型:uint8
在 fuchsia.hardware.serial/serial.fidl 中定义
Description of what type of serial device this is TODO(https://fxbug.dev/393643944): Consider replacing this enum.
| 名称 | 值 | 说明 |
|---|---|---|
GENERIC |
1 |
|
BLUETOOTH_HCI |
2 |
蓝牙主机控制器 |
CONSOLE |
3 |
一个交互式控制台 |
KERNEL_DEBUG |
4 |
内核调试串行 |
MCU |
5 |
MCU 串行连接 |
FlowControl strict
类型:uint8
在 fuchsia.hardware.serial/serial.fidl 中定义
要使用的流控制机制
| 名称 | 值 | 说明 |
|---|---|---|
无 |
1 |
|
CTS_RTS |
2 |
允许发送/请求发送 |
奇偶校验严格
类型:uint8
在 fuchsia.hardware.serial/serial.fidl 中定义
要使用的奇偶校验计算(如果有)。
| 名称 | 值 | 说明 |
|---|---|---|
无 |
1 |
|
EVEN |
2 |
|
ODD |
3 |
StopWidth strict
类型:uint8
在 fuchsia.hardware.serial/serial.fidl 中定义
停止位数
| 名称 | 值 | 说明 |
|---|---|---|
BITS_1 |
1 |
|
BITS_2 |
2 |
UNIONS
Device_Read_Result strict
在 fuchsia.hardware.serial/serial.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
Device_Read_Response
|
|
2 |
err |
zx/Status
|
Device_Write_Result strict
在 fuchsia.hardware.serial/serial.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
Device_Write_Response
|
|
2 |
err |
zx/Status
|
服务
服务
在 fuchsia.hardware.serial/serial.fidl 中定义
| 名称 | 类型 | 传输 |
|---|---|---|
| 设备 |
fuchsia.hardware.serial/Device
|
渠道 |