From 26c3f971edc32ffee99b9ab324d9212ded970ca1 Mon Sep 17 00:00:00 2001 From: ndeadly <24677491+ndeadly@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:19:02 +0200 Subject: [PATCH] btdrv-mitm: add case for handling Set MCU State subcommand --- btdrv-mitm/source/btdrv_mitm_service.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/btdrv-mitm/source/btdrv_mitm_service.cpp b/btdrv-mitm/source/btdrv_mitm_service.cpp index 44fc86c..ed142f6 100644 --- a/btdrv-mitm/source/btdrv_mitm_service.cpp +++ b/btdrv-mitm/source/btdrv_mitm_service.cpp @@ -232,6 +232,19 @@ namespace ams::mitm::btdrv { } break; + case bluetooth::SubCmd_SetMcuState: + { + //BTDRV_LOG_DATA_MSG((void *)requestData, requestData->length+2, "Set MCU State"); + + s64 timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds(); + u8 reportData[] = {0x31, 0x00, 0x21, timer & 0xff, 0x80, 0x00, 0x00, 0x00, 0x0b, 0xb8, 0x78, 0xd9, 0xd7, 0x81, 0x00, + 0x80, subCmdId}; + + auto responseData = reinterpret_cast(reportData); + bluetooth::hid::report::WriteFakeHidData(&address, responseData); + } + break; + case bluetooth::SubCmd_SetPlayerLeds: {