feat: support Switch 2 controllers and expanded profiles

This commit is contained in:
Joey Yakimowich-Payne 2026-09-06 23:17:26 -06:00
commit a87917bf0b
51 changed files with 4371 additions and 365 deletions

View file

@ -5,6 +5,7 @@
#include "bt/uni_bt_service.h"
#include "parser/uni_hid_parser_switch.h"
#include "parser/uni_hid_parser_switch2.h"
#include "platform/uni_platform.h"
#include "uni_hid_device.h"
@ -22,6 +23,15 @@ static struct { uint16_t cid, len; uint8_t bytes[128]; } sent[256];
static uint32_t now_ms;
static struct { btstack_timer_source_t* timer; uint32_t deadline; bool active; } timers[32];
bool uni_hid_parser_switch2_is_ble_device(const uni_hid_device_t* d) {
(void)d;
return false; // This fixture exercises only Classic Switch devices.
}
void uni_hid_parser_switch2_teardown(uni_hid_device_t* d) {
(void)d;
assert(!"Switch 2 teardown reached a Classic Switch fixture");
}
static unsigned timer_index(btstack_timer_source_t* timer) {
for (unsigned i = 0; i < 32; ++i) {
if (timers[i].timer == timer) return i;