blob: 6999196a39713cda485392059d2cd6e9dc4fa2fa [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <fuchsia/camera2/debug/cpp/fidl.h>
#include <fuchsia/camera2/hal/cpp/fidl.h>
#include <fuchsia/hardware/camera/cpp/fidl.h>
#include <fuchsia/sys/cpp/fidl.h>
#include <lib/async-loop/cpp/loop.h>
#include <lib/sys/cpp/component_context.h>
namespace camera {
struct Service {
std::string name;
std::string service_path;
// DebugClient allow the simple exercise of passing arguments to the service side (camera
// controller). The arguments are passed as-is. Range checks must be done by the service side.
class DebugClient {
explicit DebugClient(async::Loop& loop);
void Start(uint32_t mode);
DebugClient(const DebugClient&) = delete;
DebugClient& operator=(const DebugClient&) = delete;
void Execute();
bool ConnectToServer();
void SendCommand(uint32_t mode);
void Quit();
async::Loop& loop_;
std::unique_ptr<sys::ComponentContext> context_;
fuchsia::hardware::camera::DeviceSyncPtr device_sync_ptr_;
fuchsia::camera2::debug::DebugPtr debug_ptr_;
} // namespace camera