template <>

class Server

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

Public Methods

void GetInfo (GetInfoCompleter::Sync & completer)
void Config (ConfigRequest & request, 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 (EnableRequest & request, 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 (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 Server ()

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

void Write (WriteRequest & request, 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 (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 ~Server ()

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