template <>

class WireServer

Defined at line 2330 of file fidling/gen/sdk/fidl/fuchsia.power.system/fuchsia.power.system/cpp/fidl/fuchsia.power.system/cpp/wire_messaging.h

Pure-virtual interface to be implemented by a server.

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

<

::fuchsia_power_system::ActivityGovernor>|

and |::fidl::ServerEnd

<

::fuchsia_power_system::ActivityGovernor>|).

Public Methods

void GetPowerElements (GetPowerElementsCompleter::Sync & completer)

Gets the power elements owned by the activity governor.

If an error occurs while the server is registering a power element with

the power broker or an error occurs while creating a token for a power

element, then the channel to `ActivityGovernor` will be closed by the

server and no response will be returned.

void TakeWakeLease (::fuchsia_power_system::wire::ActivityGovernorTakeWakeLeaseRequest * request, TakeWakeLeaseCompleter::Sync & completer)

Creates a lease that blocks suspension of the hardware platform.

The hardware platform will not suspend as long as a valid

[`LeaseToken`] exists.

If an error occurs while creating a token for the wake lease, then the

channel to `ActivityGovernor` will be closed by the server and no

response will be returned.

void AcquireWakeLease (::fuchsia_power_system::wire::ActivityGovernorAcquireWakeLeaseRequest * request, AcquireWakeLeaseCompleter::Sync & completer)

Creates a lease that blocks suspension of the hardware platform.

The hardware platform will not suspend as long as a valid

[`LeaseToken`] exists.

void AcquireWakeLeaseWithToken (::fuchsia_power_system::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest * request, AcquireWakeLeaseWithTokenCompleter::Sync & completer)

Creates a lease that blocks suspension of the hardware platform.

WARNING: Suspension can only be considered blocked after the client

receives the response to this call. This means, for example, an

interrupt should only be ack'ed or a different wake lease dropped only

**after** getting an error-free response.

The hardware platform will remain resumed until `server_token` observes

`PEER_CLOSED`, indicating all handles to the client side of the

`LeaseToken` are closed.

void TakeApplicationActivityLease (::fuchsia_power_system::wire::ActivityGovernorTakeApplicationActivityLeaseRequest * request, TakeApplicationActivityLeaseCompleter::Sync & completer)

Creates a lease that blocks the system from dropping below the Application

Activity 'Active' state. In particular, this blocks suspension of the

hardware platform.

This method is _not_ safe to call during SuspendBlocker.BeforeSuspend.

If an error occurs while creating a token for the activity lease, then the

channel to `ActivityGovernor` will be closed by the server and no

response will be returned.

void RegisterSuspendBlocker (::fuchsia_power_system::wire::ActivityGovernorRegisterSuspendBlockerRequest * request, RegisterSuspendBlockerCompleter::Sync & completer)

Registers a suspend blocker.

On successful registration, a wake lease token is returned. This token

prevents hardware platform suspension while it exists. Clients are

expected to perform any initialization of the given `suspend_blocker`

server while holding this token. Additionally, this means the first call

`suspend_blocker` will get is `BeforeSuspend`.

To unregister, close the `SuspendBlocker` channel.

If any required field of the table is missing, the error

[`RegisterSuspendBlockerError.INVALID_ARGS`] is returned.

If an error occurs while registering `suspend_blocker`, it will be

dropped, closing the channel.

void WireServer ()

Defined at line 2333 of file fidling/gen/sdk/fidl/fuchsia.power.system/fuchsia.power.system/cpp/fidl/fuchsia.power.system/cpp/wire_messaging.h

Handler bind_handler (async_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 2334 of file fidling/gen/sdk/fidl/fuchsia.power.system/fuchsia.power.system/cpp/fidl/fuchsia.power.system/cpp/wire_messaging.h