Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.serial

PROTOCOLS

Device

Defined in fuchsia.hardware.serial/serial.fidl

Legacy synchronous device interface. New drivers should implement NewDevice instead.

GetClass

Lookup what type of serial device this is.

Request

<EMPTY>

Response

NameType
device_class Class

SetConfig

Set the configuration of this serial device.

Request

NameType
config Config

Response

NameType
s zx/status

NewDevice

Defined in fuchsia.hardware.serial/serial.fidl

FIDL device utilizing the new asynchronous serial driver instead of the synchronous FDIO-backed read/write interface. New drivers should implement this instead of the Device interface above.

GetClass

Lookup what type of serial device this is.

Request

<EMPTY>

Response

NameType
device_class Class

Read

Reads data from the serial port

Request

<EMPTY>

Response

NameType
result NewDevice_Read_Result

SetConfig

Set the configuration of this serial device.

Request

NameType
config Config

Response

NameType
s zx/status

Write

Writes data to the serial port

Request

NameType
data vector<uint8>

Response

NameType
result NewDevice_Write_Result

NewDeviceProxy

Defined in fuchsia.hardware.serial/serial.fidl

GetChannel

Request

NameType
req request<NewDevice>

Serial

Defined in fuchsia.hardware.serial/serial.fidl

High level serial protocol for use by client drivers. When used with the platform device protocol, "port" will be relative to the list of serial ports assigned to your device rather than the global list of serial ports.

Config

Configures the given serial port.

Request

NameType
baud_rate uint32
flags uint32

Response

NameType
s zx/status

GetInfo

Request

<EMPTY>

Response

NameType
s zx/status
info SerialPortInfo

OpenSocket

Returns a socket that can be used for reading and writing data from the given serial port.

Request

<EMPTY>

Response

NameType
s zx/status
handle handle<socket>

STRUCTS

Config

Defined in fuchsia.hardware.serial/serial.fidl

FieldTypeDescriptionDefault
character_width CharacterWidth No default
stop_width StopWidth No default
parity Parity No default
control_flow FlowControl No default
baud_rate uint32 No default

NewDevice_Read_Response

Defined in fuchsia.hardware.serial/serial.fidl

FieldTypeDescriptionDefault
data vector<uint8> No default

NewDevice_Write_Response

Defined in fuchsia.hardware.serial/serial.fidl

<EMPTY>

SerialPortInfo

Defined in fuchsia.hardware.serial/serial.fidl

FieldTypeDescriptionDefault
serial_class uint32

Values from the FIDL enum fuchsia.hardware.serial.Class

No default
serial_vid uint32

Vendor and product ID of hardware attached to this serial port, or zero if not applicable.

No default
serial_pid uint32 No default

ENUMS

CharacterWidth strict

Type: uint8

Defined in fuchsia.hardware.serial/serial.fidl

Number of bits per character

NameValueDescription
BITS_5 1
BITS_6 2
BITS_7 3
BITS_8 4

Class strict

Type: uint8

Defined in fuchsia.hardware.serial/serial.fidl

Description of what type of serial device this is

NameValueDescription
GENERIC 1
BLUETOOTH_HCI 2

A Bluetooth host controller

CONSOLE 3

An interactive console

KERNEL_DEBUG 4

Kernel debug serial

FlowControl strict

Type: uint8

Defined in fuchsia.hardware.serial/serial.fidl

What flow control mechanism to use

NameValueDescription
NONE 1
CTS_RTS 2

Clear To Send/Request To Send

Parity strict

Type: uint8

Defined in fuchsia.hardware.serial/serial.fidl

Which parity computation to use, if any.

NameValueDescription
NONE 1
EVEN 2
ODD 3

StopWidth strict

Type: uint8

Defined in fuchsia.hardware.serial/serial.fidl

Number of stop bits

NameValueDescription
BITS_1 1
BITS_2 2

UNIONS

NewDevice_Read_Result strict

Defined in fuchsia.hardware.serial/serial.fidl

Ordinal
VariantTypeDescription
1 response NewDevice_Read_Response
2 err zx/status

NewDevice_Write_Result strict

Defined in fuchsia.hardware.serial/serial.fidl

Ordinal
VariantTypeDescription
1 response NewDevice_Write_Response
2 err zx/status

CONSTANTS

NameValueTypeDescription
SERIAL_DATA_BITS_5 0 uint32
SERIAL_DATA_BITS_6 1 uint32
SERIAL_DATA_BITS_7 2 uint32
SERIAL_DATA_BITS_8 3 uint32
SERIAL_DATA_BITS_MASK 3 uint32
SERIAL_FLOW_CTRL_CTS_RTS 32 uint32
SERIAL_FLOW_CTRL_MASK 32 uint32
SERIAL_FLOW_CTRL_NONE 0 uint32
SERIAL_PARITY_EVEN 8 uint32
SERIAL_PARITY_MASK 24 uint32
SERIAL_PARITY_NONE 0 uint32
SERIAL_PARITY_ODD 16 uint32
SERIAL_SET_BAUD_RATE_ONLY 2147483648 uint32
SERIAL_STOP_BITS_1 0 uint32
SERIAL_STOP_BITS_2 4 uint32
SERIAL_STOP_BITS_MASK 4 uint32