From 4c97779b2e0c8b2f756c177b192115b8f471205b Mon Sep 17 00:00:00 2001 From: ndeadly <24677491+ndeadly@users.noreply.github.com> Date: Sat, 4 Jul 2020 21:24:03 +0200 Subject: [PATCH] btdrv-mitm: add handler for set shipping power state subcommand --- btdrv-mitm/source/btdrv_mitm_service.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/btdrv-mitm/source/btdrv_mitm_service.cpp b/btdrv-mitm/source/btdrv_mitm_service.cpp index e11ccdc..9cdafb3 100644 --- a/btdrv-mitm/source/btdrv_mitm_service.cpp +++ b/btdrv-mitm/source/btdrv_mitm_service.cpp @@ -209,6 +209,17 @@ namespace ams::mitm::btdrv { } break; + case bluetooth::SubCmd_SetShipPowerState: + { + 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, 0x00}; + + auto responseData = reinterpret_cast(reportData); + bluetooth::hid::report::WriteFakeHidData(&address, responseData); + } + break; + case bluetooth::SubCmd_SetMcuConfig: { s64 timer = os::ConvertToTimeSpan(os::GetSystemTick()).GetMilliSeconds();