From 1a6859855ee875b3642ceaf37222d4c945476934 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 11 Aug 2026 12:23:07 +0900 Subject: [PATCH] Add protocol facade Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- switch_legacy_protocol.cpp | 23 +++++++++++++++++++++++ switch_protocol.h | 13 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 switch_legacy_protocol.cpp create mode 100644 switch_protocol.h diff --git a/switch_legacy_protocol.cpp b/switch_legacy_protocol.cpp new file mode 100644 index 0000000..9f21073 --- /dev/null +++ b/switch_legacy_protocol.cpp @@ -0,0 +1,23 @@ +#include "switch_protocol.h" + +#include "switch_pro_driver.h" + +void switch_protocol_init() { + switch_pro_init(); +} + +void switch_protocol_set_input(const SwitchInputState& state) { + switch_pro_set_input(state); +} + +void switch_protocol_task() { + switch_pro_task(); +} + +bool switch_protocol_is_ready() { + return switch_pro_is_ready(); +} + +void switch_protocol_set_rumble_callback(SwitchRumbleCallback callback) { + switch_pro_set_rumble_callback(callback); +} diff --git a/switch_protocol.h b/switch_protocol.h new file mode 100644 index 0000000..28b4c8a --- /dev/null +++ b/switch_protocol.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +#include "switch_input.h" + +using SwitchRumbleCallback = void (*)(const uint8_t rumble_data[8]); + +void switch_protocol_init(); +void switch_protocol_set_input(const SwitchInputState& state); +void switch_protocol_task(); +bool switch_protocol_is_ready(); +void switch_protocol_set_rumble_callback(SwitchRumbleCallback callback);