diff options
| author | 2024-02-23 13:01:59 -0600 | |
|---|---|---|
| committer | 2024-02-23 18:58:51 -0600 | |
| commit | 7019023cbc1d0f6b82cf80e5970a41befdec71ca (patch) | |
| tree | 26c6c7b53ddd824b335b8b212a2807a6b957f2d5 /src/core/hle | |
| parent | service: friend: Add GetFriendCount, GetNewlyFriendCount, GetReceivedFriendRe... (diff) | |
| download | yuzu-7019023cbc1d0f6b82cf80e5970a41befdec71ca.tar.gz yuzu-7019023cbc1d0f6b82cf80e5970a41befdec71ca.tar.xz yuzu-7019023cbc1d0f6b82cf80e5970a41befdec71ca.zip | |
service: btdrv: Add EnableRadio for Qlaunch
Diffstat (limited to 'src/core/hle')
| -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 @@ | |||
| 5 | #include "core/core.h" | 5 | #include "core/core.h" |
| 6 | #include "core/hle/kernel/k_event.h" | 6 | #include "core/hle/kernel/k_event.h" |
| 7 | #include "core/hle/service/btdrv/btdrv.h" | 7 | #include "core/hle/service/btdrv/btdrv.h" |
| 8 | #include "core/hle/service/cmif_serialization.h" | ||
| 8 | #include "core/hle/service/ipc_helpers.h" | 9 | #include "core/hle/service/ipc_helpers.h" |
| 9 | #include "core/hle/service/kernel_helpers.h" | 10 | #include "core/hle/service/kernel_helpers.h" |
| 10 | #include "core/hle/service/server_manager.h" | 11 | #include "core/hle/service/server_manager.h" |
| @@ -13,9 +14,9 @@ | |||
| 13 | 14 | ||
| 14 | namespace Service::BtDrv { | 15 | namespace Service::BtDrv { |
| 15 | 16 | ||
| 16 | class Bt final : public ServiceFramework<Bt> { | 17 | class IBluetoothUser final : public ServiceFramework<IBluetoothUser> { |
| 17 | public: | 18 | public: |
| 18 | explicit Bt(Core::System& system_) | 19 | explicit IBluetoothUser(Core::System& system_) |
| 19 | : ServiceFramework{system_, "bt"}, service_context{system_, "bt"} { | 20 | : ServiceFramework{system_, "bt"}, service_context{system_, "bt"} { |
| 20 | // clang-format off | 21 | // clang-format off |
| 21 | static const FunctionInfo functions[] = { | 22 | static const FunctionInfo functions[] = { |
| @@ -28,7 +29,7 @@ public: | |||
| 28 | {6, nullptr, "SetLeResponse"}, | 29 | {6, nullptr, "SetLeResponse"}, |
| 29 | {7, nullptr, "LeSendIndication"}, | 30 | {7, nullptr, "LeSendIndication"}, |
| 30 | {8, nullptr, "GetLeEventInfo"}, | 31 | {8, nullptr, "GetLeEventInfo"}, |
| 31 | {9, &Bt::RegisterBleEvent, "RegisterBleEvent"}, | 32 | {9, C<&IBluetoothUser::RegisterBleEvent>, "RegisterBleEvent"}, |
| 32 | }; | 33 | }; |
| 33 | // clang-format on | 34 | // clang-format on |
| 34 | RegisterHandlers(functions); | 35 | RegisterHandlers(functions); |
| @@ -36,17 +37,16 @@ public: | |||
| 36 | register_event = service_context.CreateEvent("BT:RegisterEvent"); | 37 | register_event = service_context.CreateEvent("BT:RegisterEvent"); |
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | ~Bt() override { | 40 | ~IBluetoothUser() override { |
| 40 | service_context.CloseEvent(register_event); | 41 | service_context.CloseEvent(register_event); |
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | private: | 44 | private: |
| 44 | void RegisterBleEvent(HLERequestContext& ctx) { | 45 | Result RegisterBleEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) { |
| 45 | LOG_WARNING(Service_BTM, "(STUBBED) called"); | 46 | LOG_WARNING(Service_BTM, "(STUBBED) called"); |
| 46 | 47 | ||
| 47 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 48 | *out_event = ®ister_event->GetReadableEvent(); |
| 48 | rb.Push(ResultSuccess); | 49 | R_SUCCEED(); |
| 49 | rb.PushCopyObjects(register_event->GetReadableEvent()); | ||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | KernelHelpers::ServiceContext service_context; | 52 | KernelHelpers::ServiceContext service_context; |
| @@ -54,9 +54,9 @@ private: | |||
| 54 | Kernel::KEvent* register_event; | 54 | Kernel::KEvent* register_event; |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | class BtDrv final : public ServiceFramework<BtDrv> { | 57 | class IBluetoothDriver final : public ServiceFramework<IBluetoothDriver> { |
| 58 | public: | 58 | public: |
| 59 | explicit BtDrv(Core::System& system_) : ServiceFramework{system_, "btdrv"} { | 59 | explicit IBluetoothDriver(Core::System& system_) : ServiceFramework{system_, "btdrv"} { |
| 60 | // clang-format off | 60 | // clang-format off |
| 61 | static const FunctionInfo functions[] = { | 61 | static const FunctionInfo functions[] = { |
| 62 | {0, nullptr, "InitializeBluetoothDriver"}, | 62 | {0, nullptr, "InitializeBluetoothDriver"}, |
| @@ -93,7 +93,7 @@ public: | |||
| 93 | {31, nullptr, "EnableMcMode"}, | 93 | {31, nullptr, "EnableMcMode"}, |
| 94 | {32, nullptr, "EnableLlrScan"}, | 94 | {32, nullptr, "EnableLlrScan"}, |
| 95 | {33, nullptr, "DisableLlrScan"}, | 95 | {33, nullptr, "DisableLlrScan"}, |
| 96 | {34, nullptr, "EnableRadio"}, | 96 | {34, C<&IBluetoothDriver::EnableRadio>, "EnableRadio"}, |
| 97 | {35, nullptr, "SetVisibility"}, | 97 | {35, nullptr, "SetVisibility"}, |
| 98 | {36, nullptr, "EnableTbfcScan"}, | 98 | {36, nullptr, "EnableTbfcScan"}, |
| 99 | {37, nullptr, "RegisterHidReportEvent"}, | 99 | {37, nullptr, "RegisterHidReportEvent"}, |
| @@ -195,13 +195,19 @@ public: | |||
| 195 | 195 | ||
| 196 | RegisterHandlers(functions); | 196 | RegisterHandlers(functions); |
| 197 | } | 197 | } |
| 198 | |||
| 199 | private: | ||
| 200 | Result EnableRadio() { | ||
| 201 | LOG_WARNING(Service_BTDRV, "(STUBBED) called"); | ||
| 202 | R_SUCCEED(); | ||
| 203 | } | ||
| 198 | }; | 204 | }; |
| 199 | 205 | ||
| 200 | void LoopProcess(Core::System& system) { | 206 | void LoopProcess(Core::System& system) { |
| 201 | auto server_manager = std::make_unique<ServerManager>(system); | 207 | auto server_manager = std::make_unique<ServerManager>(system); |
| 202 | 208 | ||
| 203 | server_manager->RegisterNamedService("btdrv", std::make_shared<BtDrv>(system)); | 209 | server_manager->RegisterNamedService("btdrv", std::make_shared<IBluetoothDriver>(system)); |
| 204 | server_manager->RegisterNamedService("bt", std::make_shared<Bt>(system)); | 210 | server_manager->RegisterNamedService("bt", std::make_shared<IBluetoothUser>(system)); |
| 205 | ServerManager::RunServer(std::move(server_manager)); | 211 | ServerManager::RunServer(std::move(server_manager)); |
| 206 | } | 212 | } |
| 207 | 213 | ||