diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-24 02:32:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-24 02:32:32 +0100 |
commit | 6c40d75e47c7dc2d8ab5e11664cd40906f846de9 (patch) | |
tree | b3af659a01c967e1a3082447a9ada02e5b055717 /src/core/hle/service/btdrv | |
parent | Merge pull request #13141 from liamwhite/swap (diff) | |
parent | service: audio: Add missing logging properties of SetHeadphoneOutputLevelMode (diff) | |
download | yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.gz yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.bz2 yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.lz yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.xz yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.tar.zst yuzu-6c40d75e47c7dc2d8ab5e11664cd40906f846de9.zip |
Diffstat (limited to 'src/core/hle/service/btdrv')
-rw-r--r-- | src/core/hle/service/btdrv/btdrv.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 38cdd57ad..83618a956 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -5,6 +5,7 @@ #include "core/core.h" #include "core/hle/kernel/k_event.h" #include "core/hle/service/btdrv/btdrv.h" +#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/ipc_helpers.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/server_manager.h" @@ -13,9 +14,9 @@ namespace Service::BtDrv { -class Bt final : public ServiceFramework<Bt> { +class IBluetoothUser final : public ServiceFramework<IBluetoothUser> { public: - explicit Bt(Core::System& system_) + explicit IBluetoothUser(Core::System& system_) : ServiceFramework{system_, "bt"}, service_context{system_, "bt"} { // clang-format off static const FunctionInfo functions[] = { @@ -28,7 +29,7 @@ public: {6, nullptr, "SetLeResponse"}, {7, nullptr, "LeSendIndication"}, {8, nullptr, "GetLeEventInfo"}, - {9, &Bt::RegisterBleEvent, "RegisterBleEvent"}, + {9, C<&IBluetoothUser::RegisterBleEvent>, "RegisterBleEvent"}, }; // clang-format on RegisterHandlers(functions); @@ -36,17 +37,16 @@ public: register_event = service_context.CreateEvent("BT:RegisterEvent"); } - ~Bt() override { + ~IBluetoothUser() override { service_context.CloseEvent(register_event); } private: - void RegisterBleEvent(HLERequestContext& ctx) { + Result RegisterBleEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) { LOG_WARNING(Service_BTM, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 2, 1}; - rb.Push(ResultSuccess); - rb.PushCopyObjects(register_event->GetReadableEvent()); + *out_event = ®ister_event->GetReadableEvent(); + R_SUCCEED(); } KernelHelpers::ServiceContext service_context; @@ -54,9 +54,9 @@ private: Kernel::KEvent* register_event; }; -class BtDrv final : public ServiceFramework<BtDrv> { +class IBluetoothDriver final : public ServiceFramework<IBluetoothDriver> { public: - explicit BtDrv(Core::System& system_) : ServiceFramework{system_, "btdrv"} { + explicit IBluetoothDriver(Core::System& system_) : ServiceFramework{system_, "btdrv"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "InitializeBluetoothDriver"}, @@ -93,7 +93,7 @@ public: {31, nullptr, "EnableMcMode"}, {32, nullptr, "EnableLlrScan"}, {33, nullptr, "DisableLlrScan"}, - {34, nullptr, "EnableRadio"}, + {34, C<&IBluetoothDriver::EnableRadio>, "EnableRadio"}, {35, nullptr, "SetVisibility"}, {36, nullptr, "EnableTbfcScan"}, {37, nullptr, "RegisterHidReportEvent"}, @@ -195,13 +195,19 @@ public: RegisterHandlers(functions); } + +private: + Result EnableRadio() { + LOG_WARNING(Service_BTDRV, "(STUBBED) called"); + R_SUCCEED(); + } }; void LoopProcess(Core::System& system) { auto server_manager = std::make_unique<ServerManager>(system); - server_manager->RegisterNamedService("btdrv", std::make_shared<BtDrv>(system)); - server_manager->RegisterNamedService("bt", std::make_shared<Bt>(system)); + server_manager->RegisterNamedService("btdrv", std::make_shared<IBluetoothDriver>(system)); + server_manager->RegisterNamedService("bt", std::make_shared<IBluetoothUser>(system)); ServerManager::RunServer(std::move(server_manager)); } |