// Normalize volume to the range 0...255 if applicable
if (cmd_a == MAIN_LEVEL || cmd_a == REAR_LEVEL || cmd_a == CENTER_LEVEL || cmd_a == SUB_LEVEL) {
cmd_b = static_cast<uint8_t>((static_cast<uint16_t>(cmd_b) * MAX_VOL) / 255);
}
// Update the specified parameter in the internal status buffer
status[cmd_a] = cmd_b;
// Update the checksum in the status buffer
status[STATUS_CHECKSUM] = LRC(status, status_len);
// Send the updated status buffer to the Z906 device
write(status, status_len);
// Discard the acknowledgment (ACK) message to maintain a clean serial buffer
flush();
Also, i see that the status for power always returns the 0 value. is it because it is defined as GET_STATUS and it should be defined as STATUS_STBY according to the data in the serial command table?