mc.mitm: fix queue logic for async responses

This commit is contained in:
ndeadly 2023-06-06 21:37:57 +02:00
parent 6c1c8306ef
commit bfb1e6cb78

View file

@ -79,8 +79,8 @@ namespace ams::controller {
}
if (!m_future_responses.empty()) {
if ((m_future_responses.back()->GetType() == BtdrvHidEventType_Data) && (m_future_responses.back()->GetUserData() == report->data[0])) {
m_future_responses.back()->SetData(*event_info);
if ((m_future_responses.front()->GetType() == BtdrvHidEventType_Data) && (m_future_responses.front()->GetUserData() == report->data[0])) {
m_future_responses.front()->SetData(*event_info);
}
}
@ -107,8 +107,8 @@ namespace ams::controller {
Result SwitchController::HandleSetReportEvent(const bluetooth::HidReportEventInfo *event_info) {
if (!m_future_responses.empty()) {
if (m_future_responses.back()->GetType() == BtdrvHidEventType_SetReport) {
m_future_responses.back()->SetData(*event_info);
if (m_future_responses.front()->GetType() == BtdrvHidEventType_SetReport) {
m_future_responses.front()->SetData(*event_info);
}
R_SUCCEED();
@ -119,8 +119,8 @@ namespace ams::controller {
Result SwitchController::HandleGetReportEvent(const bluetooth::HidReportEventInfo *event_info) {
if (!m_future_responses.empty()) {
if (m_future_responses.back()->GetType() == BtdrvHidEventType_GetReport) {
m_future_responses.back()->SetData(*event_info);
if (m_future_responses.front()->GetType() == BtdrvHidEventType_GetReport) {
m_future_responses.front()->SetData(*event_info);
}
R_SUCCEED();