PROTOCOLS
Device
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
CancelAll
Immediately cancels all outstanding asynchronous I/O
Request
<EMPTY>
Response
| Name | Type | 
|---|---|
payload | 
            
                Device_CancelAll_Result
             | 
        
Config
Configures the given serial port.
Values of flags are defined in the constants above.
- error one of the following values:
 - 
`ZX_ERR_IO_NOT_PRESENT`: The serial controller is in a low-power state or is - 
transitioning to a low-power state. - 
Other values may be returned for driver- or device-specific errors. 
Request
| Name | Type | 
|---|---|
baud_rate | 
            
                uint32
             | 
        
flags | 
            
                uint32
             | 
        
Response
| Name | Type | 
|---|---|
payload | 
            
                Device_Config_Result
             | 
        
Enable
Enable or disable the device.
If already enabled and enable is true, this is a no-op and returns successfully.
If already disabled and enable is false, this is a no-op and returns successfully.
- request 
enabletrue to enable the device, or false to disable it. 
- error one of the following values:
 - 
`ZX_ERR_BAD_STATE`: `enable` was false, and a `Read()` or `Write()` call was pending. - 
`ZX_ERR_IO_NOT_PRESENT`: The serial controller is in a low-power state or is - 
transitioning to a low-power state. 
Request
| Name | Type | 
|---|---|
enable | 
            
                bool
             | 
        
Response
| Name | Type | 
|---|---|
payload | 
            
                Device_Enable_Result
             | 
        
GetInfo
Request
<EMPTY>
Response
| Name | Type | 
|---|---|
payload | 
            
                Device_GetInfo_Result
             | 
        
Read
Perform a read operation. Returns immediately if data has been received since the last call; otherwise the request is completed the next time data is received (clients can use the hanging-get pattern to be notified of new data).
- response 
datathe bytes read from the device. 
- error one of the following values:
 - 
`ZX_ERR_BAD_STATE`: The device was not enabled. - 
`ZX_ERR_CANCELED`: The call was canceled by `CancelAll()`. - 
`ZX_ERR_ALREADY_BOUND`: Another `Read()` call was already pending. - 
`ZX_ERR_IO_NOT_PRESENT`: The serial controller is in a low-power state or is - 
transitioning to a low-power state. - 
Other values may be returned for driver- or device-specific errors. 
Request
<EMPTY>
Response
| Name | Type | 
|---|---|
payload | 
            
                Device_Read_Result
             | 
        
Write
Perform a write operation. Returns when all bytes have been written, or when an error is encountered.
- request 
datathe bytes to write to the device. 
- error one of the following values:
 - 
`ZX_ERR_BAD_STATE`: The device was not enabled. - 
`ZX_ERR_CANCELED`: The call was canceled by `CancelAll()`. - 
`ZX_ERR_ALREADY_BOUND`: Another `Write()` call was already pending. - 
`ZX_ERR_IO_NOT_PRESENT`: The serial controller is in a low-power state or is - 
transitioning to a low-power state. - 
Other values may be returned for driver- or device-specific errors. 
Request
| Name | Type | 
|---|---|
data | 
            
                vector<uint8>
             | 
        
Response
| Name | Type | 
|---|---|
payload | 
            
                Device_Write_Result
             | 
        
STRUCTS
Device_CancelAll_Response
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
<EMPTY>
Device_Config_Response
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
<EMPTY>
Device_Enable_Response
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
<EMPTY>
Device_GetInfo_Response
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Field | Type | Description | Default | 
|---|---|---|---|
info | 
            
                fuchsia.hardware.serial/SerialPortInfo
             | 
            No default | 
Device_Read_Response
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Field | Type | Description | Default | 
|---|---|---|---|
data | 
            
                vector<uint8>
             | 
            No default | 
Device_Write_Response
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
<EMPTY>
UNIONS
Device_CancelAll_Result strict
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Ordinal | Variant | Type | Description | 
|---|---|---|---|
1 | 
            response | 
            
                Device_CancelAll_Response
             | 
            |
3 | 
            framework_err | 
            
                internal
             | 
            
Device_Config_Result strict
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Ordinal | Variant | Type | Description | 
|---|---|---|---|
1 | 
            response | 
            
                Device_Config_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            |
3 | 
            framework_err | 
            
                internal
             | 
            
Device_Enable_Result strict
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Ordinal | Variant | Type | Description | 
|---|---|---|---|
1 | 
            response | 
            
                Device_Enable_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            |
3 | 
            framework_err | 
            
                internal
             | 
            
Device_GetInfo_Result strict
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Ordinal | Variant | Type | Description | 
|---|---|---|---|
1 | 
            response | 
            
                Device_GetInfo_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            |
3 | 
            framework_err | 
            
                internal
             | 
            
Device_Read_Result strict
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Ordinal | Variant | Type | Description | 
|---|---|---|---|
1 | 
            response | 
            
                Device_Read_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            |
3 | 
            framework_err | 
            
                internal
             | 
            
Device_Write_Result strict
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Ordinal | Variant | Type | Description | 
|---|---|---|---|
1 | 
            response | 
            
                Device_Write_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            |
3 | 
            framework_err | 
            
                internal
             | 
            
CONSTANTS
| Name | Value | Type | Description | 
|---|---|---|---|
| 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 | 
            
SERVICES
Service
Defined in fuchsia.hardware.serialimpl/serial-impl.fidl
| Name | Type | Transport | 
|---|---|---|
| device | 
                fuchsia.hardware.serialimpl/Device
             | 
            Driver |