Update Disable_Function_Req response

This commit is contained in:
Allen Hill
2026-08-01 13:15:06 -07:00
parent 76f5da0125
commit f3d0d99ce4
+9 -6
View File
@@ -85,17 +85,20 @@ void CDChanger::handle(const Frame &in, Frame &out) {
out.reaction = r_StatusReport; out.reaction = r_StatusReport;
break; break;
case Disable_Function_Req: 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()) { if (isPlaying()) {
stopPlaying(); 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; state = 0;
flags2 = 0x80; flags2 = 0x80;
out.is_unicast = true;
out.reaction = r_StatusReport; out.reaction = r_StatusReport;
} } else
out.reaction = r_SendOnly;
break; break;
case Eject: { case Eject: {
// "Eject" label is multiply wrong; proper meaning unclear: // "Eject" label is multiply wrong; proper meaning unclear: