stubbed.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "core/hid/emulated_controller.h"
  4. #include "core/hid/hid_core.h"
  5. #include "core/hle/service/hid/hidbus/stubbed.h"
  6. namespace Service::HID {
  7. constexpr u8 DEVICE_ID = 0xFF;
  8. HidbusStubbed::HidbusStubbed(Core::HID::HIDCore& hid_core_,
  9. KernelHelpers::ServiceContext& service_context_)
  10. : HidbusBase(service_context_) {}
  11. HidbusStubbed::~HidbusStubbed() = default;
  12. void HidbusStubbed::OnInit() {
  13. return;
  14. }
  15. void HidbusStubbed::OnRelease() {
  16. return;
  17. };
  18. void HidbusStubbed::OnUpdate() {
  19. if (!is_activated) {
  20. return;
  21. }
  22. if (!device_enabled) {
  23. return;
  24. }
  25. if (!polling_mode_enabled || !is_transfer_memory_set) {
  26. return;
  27. }
  28. LOG_ERROR(Service_HID, "Polling mode not supported {}", polling_mode);
  29. }
  30. u8 HidbusStubbed::GetDeviceId() const {
  31. return DEVICE_ID;
  32. }
  33. std::vector<u8> HidbusStubbed::GetReply() const {
  34. return {};
  35. }
  36. bool HidbusStubbed::SetCommand(const std::vector<u8>& data) {
  37. LOG_ERROR(Service_HID, "Command not implemented");
  38. return false;
  39. }
  40. } // namespace Service::HID