blob: d2ef957a8b39900a3cad86daf713da21eeec5f1d [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#include <fuchsia/device/power/test/llcpp/fidl.h>
#include <memory>
namespace llcpp {
namespace fuchsia {
namespace device {
namespace power {
namespace test {
void ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDevicePowerState_Result::SizeAndOffsetAssertionHelper() {
static_assert(sizeof(TestDevice_GetCurrentDevicePowerState_Result) == sizeof(fidl_xunion_t));
static_assert(offsetof(TestDevice_GetCurrentDevicePowerState_Result, ordinal_) == offsetof(fidl_xunion_t, tag));
static_assert(offsetof(TestDevice_GetCurrentDevicePowerState_Result, envelope_) == offsetof(fidl_xunion_t, envelope));
}
void ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDeviceAutoSuspendConfig_Result::SizeAndOffsetAssertionHelper() {
static_assert(sizeof(TestDevice_GetCurrentDeviceAutoSuspendConfig_Result) == sizeof(fidl_xunion_t));
static_assert(offsetof(TestDevice_GetCurrentDeviceAutoSuspendConfig_Result, ordinal_) == offsetof(fidl_xunion_t, tag));
static_assert(offsetof(TestDevice_GetCurrentDeviceAutoSuspendConfig_Result, envelope_) == offsetof(fidl_xunion_t, envelope));
}
void ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentSuspendReason_Result::SizeAndOffsetAssertionHelper() {
static_assert(sizeof(TestDevice_GetCurrentSuspendReason_Result) == sizeof(fidl_xunion_t));
static_assert(offsetof(TestDevice_GetCurrentSuspendReason_Result, ordinal_) == offsetof(fidl_xunion_t, tag));
static_assert(offsetof(TestDevice_GetCurrentSuspendReason_Result, envelope_) == offsetof(fidl_xunion_t, envelope));
}
void ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDevicePerformanceState_Result::SizeAndOffsetAssertionHelper() {
static_assert(sizeof(TestDevice_GetCurrentDevicePerformanceState_Result) == sizeof(fidl_xunion_t));
static_assert(offsetof(TestDevice_GetCurrentDevicePerformanceState_Result, ordinal_) == offsetof(fidl_xunion_t, tag));
static_assert(offsetof(TestDevice_GetCurrentDevicePerformanceState_Result, envelope_) == offsetof(fidl_xunion_t, envelope));
}
void ::llcpp::fuchsia::device::power::test::TestDevice_AddDeviceWithPowerArgs_Result::SizeAndOffsetAssertionHelper() {
static_assert(sizeof(TestDevice_AddDeviceWithPowerArgs_Result) == sizeof(fidl_xunion_t));
static_assert(offsetof(TestDevice_AddDeviceWithPowerArgs_Result, ordinal_) == offsetof(fidl_xunion_t, tag));
static_assert(offsetof(TestDevice_AddDeviceWithPowerArgs_Result, envelope_) == offsetof(fidl_xunion_t, envelope));
}
namespace {
[[maybe_unused]]
constexpr uint64_t kTestDevice_AddDeviceWithPowerArgs_Ordinal = 0x5d89a15400000000lu;
[[maybe_unused]]
constexpr uint64_t kTestDevice_AddDeviceWithPowerArgs_GenOrdinal = 0x6f4b31b6d68abb48lu;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceAddDeviceWithPowerArgsRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceAddDeviceWithPowerArgsResponseTable;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentDevicePowerState_Ordinal = 0x724b2ef700000000lu;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentDevicePowerState_GenOrdinal = 0x15ff1a2b10784103lu;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentDevicePowerStateRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentDevicePowerStateResponseTable;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentSuspendReason_Ordinal = 0x4a634f300000000lu;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentSuspendReason_GenOrdinal = 0x5a021abc7938e00alu;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentSuspendReasonRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentSuspendReasonResponseTable;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentDevicePerformanceState_Ordinal = 0x3ee16b9700000000lu;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentDevicePerformanceState_GenOrdinal = 0x3f88876404832324lu;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentDevicePerformanceStateRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentDevicePerformanceStateResponseTable;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentDeviceAutoSuspendConfig_Ordinal = 0x109bde2f00000000lu;
[[maybe_unused]]
constexpr uint64_t kTestDevice_GetCurrentDeviceAutoSuspendConfig_GenOrdinal = 0x5a245a86e6eaba4blu;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentDeviceAutoSuspendConfigRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_power_test_TestDeviceGetCurrentDeviceAutoSuspendConfigResponseTable;
} // namespace
template <>
TestDevice::ResultOf::AddDeviceWithPowerArgs_Impl<TestDevice::AddDeviceWithPowerArgsResponse>::AddDeviceWithPowerArgs_Impl(::zx::unowned_channel _client_end, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePowerStateInfo> info, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePerformanceStateInfo> perf_state_info, bool make_visible) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<AddDeviceWithPowerArgsRequest, ::fidl::MessageDirection::kSending>();
std::unique_ptr _write_bytes_boxed = std::make_unique<::fidl::internal::AlignedBuffer<_kWriteAllocSize>>();
auto& _write_bytes_array = *_write_bytes_boxed;
AddDeviceWithPowerArgsRequest _request = {};
_request.info = std::move(info);
_request.perf_state_info = std::move(perf_state_info);
_request.make_visible = std::move(make_visible);
auto _linearize_result = ::fidl::Linearize(&_request, _write_bytes_array.view());
if (_linearize_result.status != ZX_OK) {
Super::SetFailure(std::move(_linearize_result));
return;
}
::fidl::DecodedMessage<AddDeviceWithPowerArgsRequest> _decoded_request = std::move(_linearize_result.message);
Super::SetResult(
TestDevice::InPlace::AddDeviceWithPowerArgs(std::move(_client_end), std::move(_decoded_request), Super::response_buffer()));
}
TestDevice::ResultOf::AddDeviceWithPowerArgs TestDevice::SyncClient::AddDeviceWithPowerArgs(::fidl::VectorView<::llcpp::fuchsia::device::DevicePowerStateInfo> info, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePerformanceStateInfo> perf_state_info, bool make_visible) {
return ResultOf::AddDeviceWithPowerArgs(::zx::unowned_channel(this->channel_), std::move(info), std::move(perf_state_info), std::move(make_visible));
}
TestDevice::ResultOf::AddDeviceWithPowerArgs TestDevice::Call::AddDeviceWithPowerArgs(::zx::unowned_channel _client_end, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePowerStateInfo> info, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePerformanceStateInfo> perf_state_info, bool make_visible) {
return ResultOf::AddDeviceWithPowerArgs(std::move(_client_end), std::move(info), std::move(perf_state_info), std::move(make_visible));
}
template <>
TestDevice::UnownedResultOf::AddDeviceWithPowerArgs_Impl<TestDevice::AddDeviceWithPowerArgsResponse>::AddDeviceWithPowerArgs_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePowerStateInfo> info, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePerformanceStateInfo> perf_state_info, bool make_visible, ::fidl::BytePart _response_buffer) {
if (_request_buffer.capacity() < AddDeviceWithPowerArgsRequest::PrimarySize) {
Super::SetFailure(::fidl::DecodeResult<AddDeviceWithPowerArgsResponse>(ZX_ERR_BUFFER_TOO_SMALL, ::fidl::internal::kErrorRequestBufferTooSmall));
return;
}
AddDeviceWithPowerArgsRequest _request = {};
_request.info = std::move(info);
_request.perf_state_info = std::move(perf_state_info);
_request.make_visible = std::move(make_visible);
auto _linearize_result = ::fidl::Linearize(&_request, std::move(_request_buffer));
if (_linearize_result.status != ZX_OK) {
Super::SetFailure(std::move(_linearize_result));
return;
}
::fidl::DecodedMessage<AddDeviceWithPowerArgsRequest> _decoded_request = std::move(_linearize_result.message);
Super::SetResult(
TestDevice::InPlace::AddDeviceWithPowerArgs(std::move(_client_end), std::move(_decoded_request), std::move(_response_buffer)));
}
TestDevice::UnownedResultOf::AddDeviceWithPowerArgs TestDevice::SyncClient::AddDeviceWithPowerArgs(::fidl::BytePart _request_buffer, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePowerStateInfo> info, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePerformanceStateInfo> perf_state_info, bool make_visible, ::fidl::BytePart _response_buffer) {
return UnownedResultOf::AddDeviceWithPowerArgs(::zx::unowned_channel(this->channel_), std::move(_request_buffer), std::move(info), std::move(perf_state_info), std::move(make_visible), std::move(_response_buffer));
}
TestDevice::UnownedResultOf::AddDeviceWithPowerArgs TestDevice::Call::AddDeviceWithPowerArgs(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePowerStateInfo> info, ::fidl::VectorView<::llcpp::fuchsia::device::DevicePerformanceStateInfo> perf_state_info, bool make_visible, ::fidl::BytePart _response_buffer) {
return UnownedResultOf::AddDeviceWithPowerArgs(std::move(_client_end), std::move(_request_buffer), std::move(info), std::move(perf_state_info), std::move(make_visible), std::move(_response_buffer));
}
::fidl::DecodeResult<TestDevice::AddDeviceWithPowerArgsResponse> TestDevice::InPlace::AddDeviceWithPowerArgs(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<AddDeviceWithPowerArgsRequest> params, ::fidl::BytePart response_buffer) {
TestDevice::SetTransactionHeaderFor::AddDeviceWithPowerArgsRequest(params);
auto _encode_request_result = ::fidl::Encode(std::move(params));
if (_encode_request_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::AddDeviceWithPowerArgsResponse>::FromFailure(
std::move(_encode_request_result));
}
auto _call_result = ::fidl::Call<AddDeviceWithPowerArgsRequest, AddDeviceWithPowerArgsResponse>(
std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer));
if (_call_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::AddDeviceWithPowerArgsResponse>::FromFailure(
std::move(_call_result));
}
return ::fidl::Decode(std::move(_call_result.message));
}
template <>
TestDevice::ResultOf::GetCurrentDevicePowerState_Impl<TestDevice::GetCurrentDevicePowerStateResponse>::GetCurrentDevicePowerState_Impl(::zx::unowned_channel _client_end) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentDevicePowerStateRequest, ::fidl::MessageDirection::kSending>();
::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined;
auto& _write_bytes_array = _write_bytes_inlined;
uint8_t* _write_bytes = _write_bytes_array.view().data();
memset(_write_bytes, 0, GetCurrentDevicePowerStateRequest::PrimarySize);
::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetCurrentDevicePowerStateRequest));
::fidl::DecodedMessage<GetCurrentDevicePowerStateRequest> _decoded_request(std::move(_request_bytes));
Super::SetResult(
TestDevice::InPlace::GetCurrentDevicePowerState(std::move(_client_end), Super::response_buffer()));
}
TestDevice::ResultOf::GetCurrentDevicePowerState TestDevice::SyncClient::GetCurrentDevicePowerState() {
return ResultOf::GetCurrentDevicePowerState(::zx::unowned_channel(this->channel_));
}
TestDevice::ResultOf::GetCurrentDevicePowerState TestDevice::Call::GetCurrentDevicePowerState(::zx::unowned_channel _client_end) {
return ResultOf::GetCurrentDevicePowerState(std::move(_client_end));
}
template <>
TestDevice::UnownedResultOf::GetCurrentDevicePowerState_Impl<TestDevice::GetCurrentDevicePowerStateResponse>::GetCurrentDevicePowerState_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(GetCurrentDevicePowerStateRequest)] = {};
::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes));
memset(_request_buffer.data(), 0, GetCurrentDevicePowerStateRequest::PrimarySize);
_request_buffer.set_actual(sizeof(GetCurrentDevicePowerStateRequest));
::fidl::DecodedMessage<GetCurrentDevicePowerStateRequest> _decoded_request(std::move(_request_buffer));
Super::SetResult(
TestDevice::InPlace::GetCurrentDevicePowerState(std::move(_client_end), std::move(_response_buffer)));
}
TestDevice::UnownedResultOf::GetCurrentDevicePowerState TestDevice::SyncClient::GetCurrentDevicePowerState(::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentDevicePowerState(::zx::unowned_channel(this->channel_), std::move(_response_buffer));
}
TestDevice::UnownedResultOf::GetCurrentDevicePowerState TestDevice::Call::GetCurrentDevicePowerState(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentDevicePowerState(std::move(_client_end), std::move(_response_buffer));
}
::fidl::DecodeResult<TestDevice::GetCurrentDevicePowerStateResponse> TestDevice::InPlace::GetCurrentDevicePowerState(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) {
constexpr uint32_t _write_num_bytes = sizeof(GetCurrentDevicePowerStateRequest);
::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes;
::fidl::BytePart _request_buffer = _write_bytes.view();
_request_buffer.set_actual(_write_num_bytes);
::fidl::DecodedMessage<GetCurrentDevicePowerStateRequest> params(std::move(_request_buffer));
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePowerStateRequest(params);
auto _encode_request_result = ::fidl::Encode(std::move(params));
if (_encode_request_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentDevicePowerStateResponse>::FromFailure(
std::move(_encode_request_result));
}
auto _call_result = ::fidl::Call<GetCurrentDevicePowerStateRequest, GetCurrentDevicePowerStateResponse>(
std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer));
if (_call_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentDevicePowerStateResponse>::FromFailure(
std::move(_call_result));
}
return ::fidl::Decode(std::move(_call_result.message));
}
template <>
TestDevice::ResultOf::GetCurrentSuspendReason_Impl<TestDevice::GetCurrentSuspendReasonResponse>::GetCurrentSuspendReason_Impl(::zx::unowned_channel _client_end) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentSuspendReasonRequest, ::fidl::MessageDirection::kSending>();
::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined;
auto& _write_bytes_array = _write_bytes_inlined;
uint8_t* _write_bytes = _write_bytes_array.view().data();
memset(_write_bytes, 0, GetCurrentSuspendReasonRequest::PrimarySize);
::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetCurrentSuspendReasonRequest));
::fidl::DecodedMessage<GetCurrentSuspendReasonRequest> _decoded_request(std::move(_request_bytes));
Super::SetResult(
TestDevice::InPlace::GetCurrentSuspendReason(std::move(_client_end), Super::response_buffer()));
}
TestDevice::ResultOf::GetCurrentSuspendReason TestDevice::SyncClient::GetCurrentSuspendReason() {
return ResultOf::GetCurrentSuspendReason(::zx::unowned_channel(this->channel_));
}
TestDevice::ResultOf::GetCurrentSuspendReason TestDevice::Call::GetCurrentSuspendReason(::zx::unowned_channel _client_end) {
return ResultOf::GetCurrentSuspendReason(std::move(_client_end));
}
template <>
TestDevice::UnownedResultOf::GetCurrentSuspendReason_Impl<TestDevice::GetCurrentSuspendReasonResponse>::GetCurrentSuspendReason_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(GetCurrentSuspendReasonRequest)] = {};
::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes));
memset(_request_buffer.data(), 0, GetCurrentSuspendReasonRequest::PrimarySize);
_request_buffer.set_actual(sizeof(GetCurrentSuspendReasonRequest));
::fidl::DecodedMessage<GetCurrentSuspendReasonRequest> _decoded_request(std::move(_request_buffer));
Super::SetResult(
TestDevice::InPlace::GetCurrentSuspendReason(std::move(_client_end), std::move(_response_buffer)));
}
TestDevice::UnownedResultOf::GetCurrentSuspendReason TestDevice::SyncClient::GetCurrentSuspendReason(::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentSuspendReason(::zx::unowned_channel(this->channel_), std::move(_response_buffer));
}
TestDevice::UnownedResultOf::GetCurrentSuspendReason TestDevice::Call::GetCurrentSuspendReason(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentSuspendReason(std::move(_client_end), std::move(_response_buffer));
}
::fidl::DecodeResult<TestDevice::GetCurrentSuspendReasonResponse> TestDevice::InPlace::GetCurrentSuspendReason(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) {
constexpr uint32_t _write_num_bytes = sizeof(GetCurrentSuspendReasonRequest);
::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes;
::fidl::BytePart _request_buffer = _write_bytes.view();
_request_buffer.set_actual(_write_num_bytes);
::fidl::DecodedMessage<GetCurrentSuspendReasonRequest> params(std::move(_request_buffer));
TestDevice::SetTransactionHeaderFor::GetCurrentSuspendReasonRequest(params);
auto _encode_request_result = ::fidl::Encode(std::move(params));
if (_encode_request_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentSuspendReasonResponse>::FromFailure(
std::move(_encode_request_result));
}
auto _call_result = ::fidl::Call<GetCurrentSuspendReasonRequest, GetCurrentSuspendReasonResponse>(
std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer));
if (_call_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentSuspendReasonResponse>::FromFailure(
std::move(_call_result));
}
return ::fidl::Decode(std::move(_call_result.message));
}
template <>
TestDevice::ResultOf::GetCurrentDevicePerformanceState_Impl<TestDevice::GetCurrentDevicePerformanceStateResponse>::GetCurrentDevicePerformanceState_Impl(::zx::unowned_channel _client_end) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentDevicePerformanceStateRequest, ::fidl::MessageDirection::kSending>();
::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined;
auto& _write_bytes_array = _write_bytes_inlined;
uint8_t* _write_bytes = _write_bytes_array.view().data();
memset(_write_bytes, 0, GetCurrentDevicePerformanceStateRequest::PrimarySize);
::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetCurrentDevicePerformanceStateRequest));
::fidl::DecodedMessage<GetCurrentDevicePerformanceStateRequest> _decoded_request(std::move(_request_bytes));
Super::SetResult(
TestDevice::InPlace::GetCurrentDevicePerformanceState(std::move(_client_end), Super::response_buffer()));
}
TestDevice::ResultOf::GetCurrentDevicePerformanceState TestDevice::SyncClient::GetCurrentDevicePerformanceState() {
return ResultOf::GetCurrentDevicePerformanceState(::zx::unowned_channel(this->channel_));
}
TestDevice::ResultOf::GetCurrentDevicePerformanceState TestDevice::Call::GetCurrentDevicePerformanceState(::zx::unowned_channel _client_end) {
return ResultOf::GetCurrentDevicePerformanceState(std::move(_client_end));
}
template <>
TestDevice::UnownedResultOf::GetCurrentDevicePerformanceState_Impl<TestDevice::GetCurrentDevicePerformanceStateResponse>::GetCurrentDevicePerformanceState_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(GetCurrentDevicePerformanceStateRequest)] = {};
::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes));
memset(_request_buffer.data(), 0, GetCurrentDevicePerformanceStateRequest::PrimarySize);
_request_buffer.set_actual(sizeof(GetCurrentDevicePerformanceStateRequest));
::fidl::DecodedMessage<GetCurrentDevicePerformanceStateRequest> _decoded_request(std::move(_request_buffer));
Super::SetResult(
TestDevice::InPlace::GetCurrentDevicePerformanceState(std::move(_client_end), std::move(_response_buffer)));
}
TestDevice::UnownedResultOf::GetCurrentDevicePerformanceState TestDevice::SyncClient::GetCurrentDevicePerformanceState(::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentDevicePerformanceState(::zx::unowned_channel(this->channel_), std::move(_response_buffer));
}
TestDevice::UnownedResultOf::GetCurrentDevicePerformanceState TestDevice::Call::GetCurrentDevicePerformanceState(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentDevicePerformanceState(std::move(_client_end), std::move(_response_buffer));
}
::fidl::DecodeResult<TestDevice::GetCurrentDevicePerformanceStateResponse> TestDevice::InPlace::GetCurrentDevicePerformanceState(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) {
constexpr uint32_t _write_num_bytes = sizeof(GetCurrentDevicePerformanceStateRequest);
::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes;
::fidl::BytePart _request_buffer = _write_bytes.view();
_request_buffer.set_actual(_write_num_bytes);
::fidl::DecodedMessage<GetCurrentDevicePerformanceStateRequest> params(std::move(_request_buffer));
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePerformanceStateRequest(params);
auto _encode_request_result = ::fidl::Encode(std::move(params));
if (_encode_request_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentDevicePerformanceStateResponse>::FromFailure(
std::move(_encode_request_result));
}
auto _call_result = ::fidl::Call<GetCurrentDevicePerformanceStateRequest, GetCurrentDevicePerformanceStateResponse>(
std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer));
if (_call_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentDevicePerformanceStateResponse>::FromFailure(
std::move(_call_result));
}
return ::fidl::Decode(std::move(_call_result.message));
}
template <>
TestDevice::ResultOf::GetCurrentDeviceAutoSuspendConfig_Impl<TestDevice::GetCurrentDeviceAutoSuspendConfigResponse>::GetCurrentDeviceAutoSuspendConfig_Impl(::zx::unowned_channel _client_end) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentDeviceAutoSuspendConfigRequest, ::fidl::MessageDirection::kSending>();
::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined;
auto& _write_bytes_array = _write_bytes_inlined;
uint8_t* _write_bytes = _write_bytes_array.view().data();
memset(_write_bytes, 0, GetCurrentDeviceAutoSuspendConfigRequest::PrimarySize);
::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetCurrentDeviceAutoSuspendConfigRequest));
::fidl::DecodedMessage<GetCurrentDeviceAutoSuspendConfigRequest> _decoded_request(std::move(_request_bytes));
Super::SetResult(
TestDevice::InPlace::GetCurrentDeviceAutoSuspendConfig(std::move(_client_end), Super::response_buffer()));
}
TestDevice::ResultOf::GetCurrentDeviceAutoSuspendConfig TestDevice::SyncClient::GetCurrentDeviceAutoSuspendConfig() {
return ResultOf::GetCurrentDeviceAutoSuspendConfig(::zx::unowned_channel(this->channel_));
}
TestDevice::ResultOf::GetCurrentDeviceAutoSuspendConfig TestDevice::Call::GetCurrentDeviceAutoSuspendConfig(::zx::unowned_channel _client_end) {
return ResultOf::GetCurrentDeviceAutoSuspendConfig(std::move(_client_end));
}
template <>
TestDevice::UnownedResultOf::GetCurrentDeviceAutoSuspendConfig_Impl<TestDevice::GetCurrentDeviceAutoSuspendConfigResponse>::GetCurrentDeviceAutoSuspendConfig_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(GetCurrentDeviceAutoSuspendConfigRequest)] = {};
::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes));
memset(_request_buffer.data(), 0, GetCurrentDeviceAutoSuspendConfigRequest::PrimarySize);
_request_buffer.set_actual(sizeof(GetCurrentDeviceAutoSuspendConfigRequest));
::fidl::DecodedMessage<GetCurrentDeviceAutoSuspendConfigRequest> _decoded_request(std::move(_request_buffer));
Super::SetResult(
TestDevice::InPlace::GetCurrentDeviceAutoSuspendConfig(std::move(_client_end), std::move(_response_buffer)));
}
TestDevice::UnownedResultOf::GetCurrentDeviceAutoSuspendConfig TestDevice::SyncClient::GetCurrentDeviceAutoSuspendConfig(::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentDeviceAutoSuspendConfig(::zx::unowned_channel(this->channel_), std::move(_response_buffer));
}
TestDevice::UnownedResultOf::GetCurrentDeviceAutoSuspendConfig TestDevice::Call::GetCurrentDeviceAutoSuspendConfig(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) {
return UnownedResultOf::GetCurrentDeviceAutoSuspendConfig(std::move(_client_end), std::move(_response_buffer));
}
::fidl::DecodeResult<TestDevice::GetCurrentDeviceAutoSuspendConfigResponse> TestDevice::InPlace::GetCurrentDeviceAutoSuspendConfig(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) {
constexpr uint32_t _write_num_bytes = sizeof(GetCurrentDeviceAutoSuspendConfigRequest);
::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes;
::fidl::BytePart _request_buffer = _write_bytes.view();
_request_buffer.set_actual(_write_num_bytes);
::fidl::DecodedMessage<GetCurrentDeviceAutoSuspendConfigRequest> params(std::move(_request_buffer));
TestDevice::SetTransactionHeaderFor::GetCurrentDeviceAutoSuspendConfigRequest(params);
auto _encode_request_result = ::fidl::Encode(std::move(params));
if (_encode_request_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentDeviceAutoSuspendConfigResponse>::FromFailure(
std::move(_encode_request_result));
}
auto _call_result = ::fidl::Call<GetCurrentDeviceAutoSuspendConfigRequest, GetCurrentDeviceAutoSuspendConfigResponse>(
std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer));
if (_call_result.status != ZX_OK) {
return ::fidl::DecodeResult<TestDevice::GetCurrentDeviceAutoSuspendConfigResponse>::FromFailure(
std::move(_call_result));
}
return ::fidl::Decode(std::move(_call_result.message));
}
bool TestDevice::TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) {
if (msg->num_bytes < sizeof(fidl_message_header_t)) {
zx_handle_close_many(msg->handles, msg->num_handles);
txn->Close(ZX_ERR_INVALID_ARGS);
return true;
}
fidl_message_header_t* hdr = reinterpret_cast<fidl_message_header_t*>(msg->bytes);
zx_status_t status = fidl_validate_txn_header(hdr);
if (status != ZX_OK) {
txn->Close(status);
return true;
}
switch (hdr->ordinal) {
case kTestDevice_AddDeviceWithPowerArgs_Ordinal:
case kTestDevice_AddDeviceWithPowerArgs_GenOrdinal:
{
auto result = ::fidl::DecodeAs<AddDeviceWithPowerArgsRequest>(msg);
if (result.status != ZX_OK) {
txn->Close(ZX_ERR_INVALID_ARGS);
return true;
}
auto message = result.message.message();
impl->AddDeviceWithPowerArgs(std::move(message->info), std::move(message->perf_state_info), std::move(message->make_visible),
Interface::AddDeviceWithPowerArgsCompleter::Sync(txn));
return true;
}
case kTestDevice_GetCurrentDevicePowerState_Ordinal:
case kTestDevice_GetCurrentDevicePowerState_GenOrdinal:
{
auto result = ::fidl::DecodeAs<GetCurrentDevicePowerStateRequest>(msg);
if (result.status != ZX_OK) {
txn->Close(ZX_ERR_INVALID_ARGS);
return true;
}
impl->GetCurrentDevicePowerState(
Interface::GetCurrentDevicePowerStateCompleter::Sync(txn));
return true;
}
case kTestDevice_GetCurrentSuspendReason_Ordinal:
case kTestDevice_GetCurrentSuspendReason_GenOrdinal:
{
auto result = ::fidl::DecodeAs<GetCurrentSuspendReasonRequest>(msg);
if (result.status != ZX_OK) {
txn->Close(ZX_ERR_INVALID_ARGS);
return true;
}
impl->GetCurrentSuspendReason(
Interface::GetCurrentSuspendReasonCompleter::Sync(txn));
return true;
}
case kTestDevice_GetCurrentDevicePerformanceState_Ordinal:
case kTestDevice_GetCurrentDevicePerformanceState_GenOrdinal:
{
auto result = ::fidl::DecodeAs<GetCurrentDevicePerformanceStateRequest>(msg);
if (result.status != ZX_OK) {
txn->Close(ZX_ERR_INVALID_ARGS);
return true;
}
impl->GetCurrentDevicePerformanceState(
Interface::GetCurrentDevicePerformanceStateCompleter::Sync(txn));
return true;
}
case kTestDevice_GetCurrentDeviceAutoSuspendConfig_Ordinal:
case kTestDevice_GetCurrentDeviceAutoSuspendConfig_GenOrdinal:
{
auto result = ::fidl::DecodeAs<GetCurrentDeviceAutoSuspendConfigRequest>(msg);
if (result.status != ZX_OK) {
txn->Close(ZX_ERR_INVALID_ARGS);
return true;
}
impl->GetCurrentDeviceAutoSuspendConfig(
Interface::GetCurrentDeviceAutoSuspendConfigCompleter::Sync(txn));
return true;
}
default: {
return false;
}
}
}
bool TestDevice::Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) {
bool found = TryDispatch(impl, msg, txn);
if (!found) {
zx_handle_close_many(msg->handles, msg->num_handles);
txn->Close(ZX_ERR_NOT_SUPPORTED);
}
return found;
}
void TestDevice::Interface::AddDeviceWithPowerArgsCompleterBase::Reply(::llcpp::fuchsia::device::power::test::TestDevice_AddDeviceWithPowerArgs_Result result) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<AddDeviceWithPowerArgsResponse, ::fidl::MessageDirection::kSending>();
FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize];
AddDeviceWithPowerArgsResponse _response = {};
TestDevice::SetTransactionHeaderFor::AddDeviceWithPowerArgsResponse(
::fidl::DecodedMessage<AddDeviceWithPowerArgsResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
AddDeviceWithPowerArgsResponse::PrimarySize,
AddDeviceWithPowerArgsResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes,
_kWriteAllocSize));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::AddDeviceWithPowerArgsCompleterBase::ReplySuccess() {
TestDevice_AddDeviceWithPowerArgs_Response response;
Reply(TestDevice_AddDeviceWithPowerArgs_Result::WithResponse(&response));
}
void TestDevice::Interface::AddDeviceWithPowerArgsCompleterBase::ReplyError(int32_t error) {
Reply(TestDevice_AddDeviceWithPowerArgs_Result::WithErr(&error));
}
void TestDevice::Interface::AddDeviceWithPowerArgsCompleterBase::Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::power::test::TestDevice_AddDeviceWithPowerArgs_Result result) {
if (_buffer.capacity() < AddDeviceWithPowerArgsResponse::PrimarySize) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
AddDeviceWithPowerArgsResponse _response = {};
TestDevice::SetTransactionHeaderFor::AddDeviceWithPowerArgsResponse(
::fidl::DecodedMessage<AddDeviceWithPowerArgsResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
AddDeviceWithPowerArgsResponse::PrimarySize,
AddDeviceWithPowerArgsResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::AddDeviceWithPowerArgsCompleterBase::ReplySuccess(::fidl::BytePart _buffer) {
TestDevice_AddDeviceWithPowerArgs_Response response;
Reply(std::move(_buffer), TestDevice_AddDeviceWithPowerArgs_Result::WithResponse(&response));
}
void TestDevice::Interface::AddDeviceWithPowerArgsCompleterBase::Reply(::fidl::DecodedMessage<AddDeviceWithPowerArgsResponse> params) {
TestDevice::SetTransactionHeaderFor::AddDeviceWithPowerArgsResponse(params);
CompleterBase::SendReply(std::move(params));
}
void TestDevice::Interface::GetCurrentDevicePowerStateCompleterBase::Reply(::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDevicePowerState_Result result) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentDevicePowerStateResponse, ::fidl::MessageDirection::kSending>();
FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize];
GetCurrentDevicePowerStateResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePowerStateResponse(
::fidl::DecodedMessage<GetCurrentDevicePowerStateResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentDevicePowerStateResponse::PrimarySize,
GetCurrentDevicePowerStateResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes,
_kWriteAllocSize));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentDevicePowerStateCompleterBase::ReplySuccess(::llcpp::fuchsia::device::DevicePowerState cur_state) {
TestDevice_GetCurrentDevicePowerState_Response response;
response.cur_state = std::move(cur_state);
Reply(TestDevice_GetCurrentDevicePowerState_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentDevicePowerStateCompleterBase::ReplyError(int32_t error) {
Reply(TestDevice_GetCurrentDevicePowerState_Result::WithErr(&error));
}
void TestDevice::Interface::GetCurrentDevicePowerStateCompleterBase::Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDevicePowerState_Result result) {
if (_buffer.capacity() < GetCurrentDevicePowerStateResponse::PrimarySize) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
GetCurrentDevicePowerStateResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePowerStateResponse(
::fidl::DecodedMessage<GetCurrentDevicePowerStateResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentDevicePowerStateResponse::PrimarySize,
GetCurrentDevicePowerStateResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentDevicePowerStateCompleterBase::ReplySuccess(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::DevicePowerState cur_state) {
TestDevice_GetCurrentDevicePowerState_Response response;
response.cur_state = std::move(cur_state);
Reply(std::move(_buffer), TestDevice_GetCurrentDevicePowerState_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentDevicePowerStateCompleterBase::Reply(::fidl::DecodedMessage<GetCurrentDevicePowerStateResponse> params) {
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePowerStateResponse(params);
CompleterBase::SendReply(std::move(params));
}
void TestDevice::Interface::GetCurrentSuspendReasonCompleterBase::Reply(::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentSuspendReason_Result result) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentSuspendReasonResponse, ::fidl::MessageDirection::kSending>();
FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize];
GetCurrentSuspendReasonResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentSuspendReasonResponse(
::fidl::DecodedMessage<GetCurrentSuspendReasonResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentSuspendReasonResponse::PrimarySize,
GetCurrentSuspendReasonResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes,
_kWriteAllocSize));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentSuspendReasonCompleterBase::ReplySuccess(uint8_t cur_suspend_reason) {
TestDevice_GetCurrentSuspendReason_Response response;
response.cur_suspend_reason = std::move(cur_suspend_reason);
Reply(TestDevice_GetCurrentSuspendReason_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentSuspendReasonCompleterBase::ReplyError(int32_t error) {
Reply(TestDevice_GetCurrentSuspendReason_Result::WithErr(&error));
}
void TestDevice::Interface::GetCurrentSuspendReasonCompleterBase::Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentSuspendReason_Result result) {
if (_buffer.capacity() < GetCurrentSuspendReasonResponse::PrimarySize) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
GetCurrentSuspendReasonResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentSuspendReasonResponse(
::fidl::DecodedMessage<GetCurrentSuspendReasonResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentSuspendReasonResponse::PrimarySize,
GetCurrentSuspendReasonResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentSuspendReasonCompleterBase::ReplySuccess(::fidl::BytePart _buffer, uint8_t cur_suspend_reason) {
TestDevice_GetCurrentSuspendReason_Response response;
response.cur_suspend_reason = std::move(cur_suspend_reason);
Reply(std::move(_buffer), TestDevice_GetCurrentSuspendReason_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentSuspendReasonCompleterBase::Reply(::fidl::DecodedMessage<GetCurrentSuspendReasonResponse> params) {
TestDevice::SetTransactionHeaderFor::GetCurrentSuspendReasonResponse(params);
CompleterBase::SendReply(std::move(params));
}
void TestDevice::Interface::GetCurrentDevicePerformanceStateCompleterBase::Reply(::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDevicePerformanceState_Result result) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentDevicePerformanceStateResponse, ::fidl::MessageDirection::kSending>();
FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize];
GetCurrentDevicePerformanceStateResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePerformanceStateResponse(
::fidl::DecodedMessage<GetCurrentDevicePerformanceStateResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentDevicePerformanceStateResponse::PrimarySize,
GetCurrentDevicePerformanceStateResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes,
_kWriteAllocSize));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentDevicePerformanceStateCompleterBase::ReplySuccess(int32_t cur_state) {
TestDevice_GetCurrentDevicePerformanceState_Response response;
response.cur_state = std::move(cur_state);
Reply(TestDevice_GetCurrentDevicePerformanceState_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentDevicePerformanceStateCompleterBase::ReplyError(int32_t error) {
Reply(TestDevice_GetCurrentDevicePerformanceState_Result::WithErr(&error));
}
void TestDevice::Interface::GetCurrentDevicePerformanceStateCompleterBase::Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDevicePerformanceState_Result result) {
if (_buffer.capacity() < GetCurrentDevicePerformanceStateResponse::PrimarySize) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
GetCurrentDevicePerformanceStateResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePerformanceStateResponse(
::fidl::DecodedMessage<GetCurrentDevicePerformanceStateResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentDevicePerformanceStateResponse::PrimarySize,
GetCurrentDevicePerformanceStateResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentDevicePerformanceStateCompleterBase::ReplySuccess(::fidl::BytePart _buffer, int32_t cur_state) {
TestDevice_GetCurrentDevicePerformanceState_Response response;
response.cur_state = std::move(cur_state);
Reply(std::move(_buffer), TestDevice_GetCurrentDevicePerformanceState_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentDevicePerformanceStateCompleterBase::Reply(::fidl::DecodedMessage<GetCurrentDevicePerformanceStateResponse> params) {
TestDevice::SetTransactionHeaderFor::GetCurrentDevicePerformanceStateResponse(params);
CompleterBase::SendReply(std::move(params));
}
void TestDevice::Interface::GetCurrentDeviceAutoSuspendConfigCompleterBase::Reply(::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDeviceAutoSuspendConfig_Result result) {
constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetCurrentDeviceAutoSuspendConfigResponse, ::fidl::MessageDirection::kSending>();
FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize];
GetCurrentDeviceAutoSuspendConfigResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentDeviceAutoSuspendConfigResponse(
::fidl::DecodedMessage<GetCurrentDeviceAutoSuspendConfigResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentDeviceAutoSuspendConfigResponse::PrimarySize,
GetCurrentDeviceAutoSuspendConfigResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes,
_kWriteAllocSize));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentDeviceAutoSuspendConfigCompleterBase::ReplySuccess(bool enabled, ::llcpp::fuchsia::device::DevicePowerState deepest_sleep_state) {
TestDevice_GetCurrentDeviceAutoSuspendConfig_Response response;
response.enabled = std::move(enabled);
response.deepest_sleep_state = std::move(deepest_sleep_state);
Reply(TestDevice_GetCurrentDeviceAutoSuspendConfig_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentDeviceAutoSuspendConfigCompleterBase::ReplyError(int32_t error) {
Reply(TestDevice_GetCurrentDeviceAutoSuspendConfig_Result::WithErr(&error));
}
void TestDevice::Interface::GetCurrentDeviceAutoSuspendConfigCompleterBase::Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::power::test::TestDevice_GetCurrentDeviceAutoSuspendConfig_Result result) {
if (_buffer.capacity() < GetCurrentDeviceAutoSuspendConfigResponse::PrimarySize) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
GetCurrentDeviceAutoSuspendConfigResponse _response = {};
TestDevice::SetTransactionHeaderFor::GetCurrentDeviceAutoSuspendConfigResponse(
::fidl::DecodedMessage<GetCurrentDeviceAutoSuspendConfigResponse>(
::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response),
GetCurrentDeviceAutoSuspendConfigResponse::PrimarySize,
GetCurrentDeviceAutoSuspendConfigResponse::PrimarySize)));
_response.result = std::move(result);
auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer));
if (_linearize_result.status != ZX_OK) {
CompleterBase::Close(ZX_ERR_INTERNAL);
return;
}
CompleterBase::SendReply(std::move(_linearize_result.message));
}
void TestDevice::Interface::GetCurrentDeviceAutoSuspendConfigCompleterBase::ReplySuccess(::fidl::BytePart _buffer, bool enabled, ::llcpp::fuchsia::device::DevicePowerState deepest_sleep_state) {
TestDevice_GetCurrentDeviceAutoSuspendConfig_Response response;
response.enabled = std::move(enabled);
response.deepest_sleep_state = std::move(deepest_sleep_state);
Reply(std::move(_buffer), TestDevice_GetCurrentDeviceAutoSuspendConfig_Result::WithResponse(&response));
}
void TestDevice::Interface::GetCurrentDeviceAutoSuspendConfigCompleterBase::Reply(::fidl::DecodedMessage<GetCurrentDeviceAutoSuspendConfigResponse> params) {
TestDevice::SetTransactionHeaderFor::GetCurrentDeviceAutoSuspendConfigResponse(params);
CompleterBase::SendReply(std::move(params));
}
void TestDevice::SetTransactionHeaderFor::AddDeviceWithPowerArgsRequest(const ::fidl::DecodedMessage<TestDevice::AddDeviceWithPowerArgsRequest>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_AddDeviceWithPowerArgs_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::AddDeviceWithPowerArgsResponse(const ::fidl::DecodedMessage<TestDevice::AddDeviceWithPowerArgsResponse>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_AddDeviceWithPowerArgs_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentDevicePowerStateRequest(const ::fidl::DecodedMessage<TestDevice::GetCurrentDevicePowerStateRequest>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentDevicePowerState_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentDevicePowerStateResponse(const ::fidl::DecodedMessage<TestDevice::GetCurrentDevicePowerStateResponse>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentDevicePowerState_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentSuspendReasonRequest(const ::fidl::DecodedMessage<TestDevice::GetCurrentSuspendReasonRequest>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentSuspendReason_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentSuspendReasonResponse(const ::fidl::DecodedMessage<TestDevice::GetCurrentSuspendReasonResponse>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentSuspendReason_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentDevicePerformanceStateRequest(const ::fidl::DecodedMessage<TestDevice::GetCurrentDevicePerformanceStateRequest>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentDevicePerformanceState_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentDevicePerformanceStateResponse(const ::fidl::DecodedMessage<TestDevice::GetCurrentDevicePerformanceStateResponse>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentDevicePerformanceState_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentDeviceAutoSuspendConfigRequest(const ::fidl::DecodedMessage<TestDevice::GetCurrentDeviceAutoSuspendConfigRequest>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentDeviceAutoSuspendConfig_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
void TestDevice::SetTransactionHeaderFor::GetCurrentDeviceAutoSuspendConfigResponse(const ::fidl::DecodedMessage<TestDevice::GetCurrentDeviceAutoSuspendConfigResponse>& _msg) {
fidl_init_txn_header(&_msg.message()->_hdr, 0, kTestDevice_GetCurrentDeviceAutoSuspendConfig_GenOrdinal);
_msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG;
}
} // namespace test
} // namespace power
} // namespace device
} // namespace fuchsia
} // namespace llcpp