diff options
Diffstat (limited to 'src/core/hle/service/btdrv/btdrv.cpp')
-rw-r--r-- | src/core/hle/service/btdrv/btdrv.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 46da438ef..088a1a18a 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -5,11 +5,10 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/k_event.h" -#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/btdrv/btdrv.h" +#include "core/hle/service/kernel_helpers.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" @@ -18,7 +17,7 @@ namespace Service::BtDrv { class Bt final : public ServiceFramework<Bt> { public: explicit Bt(Core::System& system_) - : ServiceFramework{system_, "bt"}, register_event{system.Kernel()} { + : ServiceFramework{system_, "bt"}, service_context{system_, "bt"} { // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "LeClientReadCharacteristic"}, @@ -35,8 +34,11 @@ public: // clang-format on RegisterHandlers(functions); - Kernel::KAutoObject::Create(std::addressof(register_event)); - register_event.Initialize("BT:RegisterEvent"); + register_event = service_context.CreateEvent("BT:RegisterEvent"); + } + + ~Bt() override { + service_context.CloseEvent(register_event); } private: @@ -45,10 +47,12 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(ResultSuccess); - rb.PushCopyObjects(register_event.GetReadableEvent()); + rb.PushCopyObjects(register_event->GetReadableEvent()); } - Kernel::KEvent register_event; + KernelHelpers::ServiceContext service_context; + + Kernel::KEvent* register_event; }; class BtDrv final : public ServiceFramework<BtDrv> { @@ -175,6 +179,10 @@ public: {143, nullptr, "GetAudioControlInputState"}, {144, nullptr, "AcquireAudioConnectionStateChangedEvent"}, {145, nullptr, "GetConnectedAudioDevice"}, + {146, nullptr, "CloseAudioControlInput"}, + {147, nullptr, "RegisterAudioControlNotification"}, + {148, nullptr, "SendAudioControlPassthroughCommand"}, + {149, nullptr, "SendAudioControlSetAbsoluteVolumeCommand"}, {256, nullptr, "IsManufacturingMode"}, {257, nullptr, "EmulateBluetoothCrash"}, {258, nullptr, "GetBleChannelMap"}, |