summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/btm/btm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/btm/btm.cpp')
-rw-r--r--src/core/hle/service/btm/btm.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp
index 463a79351..ef7398a23 100644
--- a/src/core/hle/service/btm/btm.cpp
+++ b/src/core/hle/service/btm/btm.cpp
@@ -6,8 +6,10 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/event.h"
#include "core/hle/kernel/hle_ipc.h"
+#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/readable_event.h"
+#include "core/hle/kernel/writable_event.h"
#include "core/hle/service/btm/btm.h"
#include "core/hle/service/service.h"
@@ -53,53 +55,55 @@ public:
};
// clang-format on
RegisterHandlers(functions);
+
+ auto& kernel = Core::System::GetInstance().Kernel();
+ scan_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::OneShot,
+ "IBtmUserCore:ScanEvent");
+ connection_event = Kernel::WritableEvent::CreateEventPair(
+ kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ConnectionEvent");
+ service_discovery = Kernel::WritableEvent::CreateEventPair(
+ kernel, Kernel::ResetType::OneShot, "IBtmUserCore:Discovery");
+ config_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::OneShot,
+ "IBtmUserCore:ConfigEvent");
}
private:
void GetScanEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_BTM, "(STUBBED) called");
- auto& kernel = Core::System::GetInstance().Kernel();
- scan_event =
- Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ScanEvent");
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(scan_event);
+ rb.PushCopyObjects(scan_event.readable);
}
+
void GetConnectionEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_BTM, "(STUBBED) called");
- auto& kernel = Core::System::GetInstance().Kernel();
- connection_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
- "IBtmUserCore:ConnectionEvent");
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(connection_event);
+ rb.PushCopyObjects(connection_event.readable);
}
+
void GetDiscoveryEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_BTM, "(STUBBED) called");
- auto& kernel = Core::System::GetInstance().Kernel();
- service_discovery =
- Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:Discovery");
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(service_discovery);
+ rb.PushCopyObjects(service_discovery.readable);
}
+
void GetConfigEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_BTM, "(STUBBED) called");
- auto& kernel = Core::System::GetInstance().Kernel();
- config_event =
- Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ConfigEvent");
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(config_event);
+ rb.PushCopyObjects(config_event.readable);
}
- Kernel::SharedPtr<Kernel::Event> scan_event;
- Kernel::SharedPtr<Kernel::Event> connection_event;
- Kernel::SharedPtr<Kernel::Event> service_discovery;
- Kernel::SharedPtr<Kernel::Event> config_event;
+
+ Kernel::EventPair scan_event;
+ Kernel::EventPair connection_event;
+ Kernel::EventPair service_discovery;
+ Kernel::EventPair config_event;
};
class BTM_USR final : public ServiceFramework<BTM_USR> {