From f3d0d99ce4c7dc6b37e4dc1dd539b90c8105a0d4 Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Sat, 1 Aug 2026 13:15:06 -0700 Subject: [PATCH] Update Disable_Function_Req response --- src/avclan/cdchanger.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/avclan/cdchanger.cc b/src/avclan/cdchanger.cc index 6ce355e..e451ff0 100644 --- a/src/avclan/cdchanger.cc +++ b/src/avclan/cdchanger.cc @@ -85,17 +85,20 @@ void CDChanger::handle(const Frame &in, Frame &out) { out.reaction = r_StatusReport; break; case Disable_Function_Req: - // No change/response needed if we're already not playing + // Head unit always expects a response, but the state change can be + // conditional + out.is_unicast = true; + out.length = sizeof(function_change_resp); + memcpy(out.data, function_change_resp, sizeof(function_change_resp)); + out.data[2] = to_underlying(from); + out.data[3] = to_underlying(Disable_Function_Resp); if (isPlaying()) { stopPlaying(); - out.length = sizeof(function_change_resp); - memcpy(out.data, function_change_resp, sizeof(function_change_resp)); - out.data[3] = to_underlying(Disable_Function_Resp); state = 0; flags2 = 0x80; - out.is_unicast = true; out.reaction = r_StatusReport; - } + } else + out.reaction = r_SendOnly; break; case Eject: { // "Eject" label is multiply wrong; proper meaning unclear: