template <>

class WireServer

Defined at line 1360 of file fidling/gen/sdk/fidl/fuchsia.hardware.serialimpl/fuchsia.hardware.serialimpl/cpp/fidl/fuchsia.hardware.serialimpl/cpp/driver/wire_messaging.h

Pure-virtual interface to be implemented by a server.

This interface uses typed channels (i.e. |::fdf::ClientEnd

<

::fuchsia_hardware_serialimpl::Device>|

and |::fdf::ServerEnd

<

::fuchsia_hardware_serialimpl::Device>|).

Public Methods

void GetInfo (fdf::Arena & arena, GetInfoCompleter::Sync & completer)
void Config (::fuchsia_hardware_serialimpl::wire::DeviceConfigRequest * request, fdf::Arena & arena, ConfigCompleter::Sync & completer)

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.

void Enable (::fuchsia_hardware_serialimpl::wire::DeviceEnableRequest * request, fdf::Arena & arena, EnableCompleter::Sync & completer)

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 `enable` true 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.

void Read (fdf::Arena & arena, ReadCompleter::Sync & completer)

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 `data` the 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.

void WireServer ()

Defined at line 1363 of file fidling/gen/sdk/fidl/fuchsia.hardware.serialimpl/fuchsia.hardware.serialimpl/cpp/fidl/fuchsia.hardware.serialimpl/cpp/driver/wire_messaging.h

void Write (::fuchsia_hardware_serialimpl::wire::DeviceWriteRequest * request, fdf::Arena & arena, WriteCompleter::Sync & completer)

Perform a write operation. Returns when all bytes have been written, or when an error is

encountered.

+ request `data` the 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.

void CancelAll (fdf::Arena & arena, CancelAllCompleter::Sync & completer)

Immediately cancels all outstanding asynchronous I/O

Handler bind_handler (fdf_dispatcher_t * dispatcher)

|bind_handler| returns a handler that binds incoming connections to this

server implementation.

The returned handler borrows the server instance.

The server must outlive the provided |dispatcher|. Only after

the dispatcher is shutdown will it be safe to destroy the servers.

The server should not be moved.

void ~WireServer ()

Defined at line 1364 of file fidling/gen/sdk/fidl/fuchsia.hardware.serialimpl/fuchsia.hardware.serialimpl/cpp/fidl/fuchsia.hardware.serialimpl/cpp/driver/wire_messaging.h