mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
avrcp_target: fix command handling (regression from 9970238)
This commit is contained in:
parent
3db60f785b
commit
810b0d8456
@ -796,13 +796,16 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
||||
break;
|
||||
}
|
||||
case AVRCP_CMD_OPCODE_PASS_THROUGH:{
|
||||
if (size < 9) return;
|
||||
log_info("AVRCP_OPERATION_ID 0x%02x, operands length %d, operand %d", packet[6], packet[7], packet[8]);
|
||||
if (size < 8) return;
|
||||
log_info("AVRCP_OPERATION_ID 0x%02x, operands length %d", packet[6], packet[7]);
|
||||
avrcp_operation_id_t operation_id = (avrcp_operation_id_t) packet[6];
|
||||
|
||||
uint8_t operand = 0;
|
||||
if ((packet[7] >= 1) && (size >= 9)){
|
||||
operand = packet[8];
|
||||
}
|
||||
if (avrcp_is_receive_pass_through_cmd(operation_id)){
|
||||
operation_id = (avrcp_operation_id_t) (packet[6] & 0x7F);
|
||||
avrcp_target_operation_accepted(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], packet[8]);
|
||||
avrcp_target_operation_accepted(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], operand);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -826,14 +829,14 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
||||
case AVRCP_OPERATION_ID_LEFT:
|
||||
case AVRCP_OPERATION_ID_RIGHT:
|
||||
case AVRCP_OPERATION_ID_ROOT_MENU:
|
||||
avrcp_target_operation_accepted(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], packet[8]);
|
||||
avrcp_target_emit_operation(avrcp_target_context.avrcp_callback, connection->avrcp_cid, operation_id, packet[7], packet[8]);
|
||||
avrcp_target_operation_accepted(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], operand);
|
||||
avrcp_target_emit_operation(avrcp_target_context.avrcp_callback, connection->avrcp_cid, operation_id, packet[7], operand);
|
||||
break;
|
||||
case AVRCP_OPERATION_ID_UNDEFINED:
|
||||
avrcp_target_operation_not_implemented(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], packet[8]);
|
||||
avrcp_target_operation_not_implemented(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], operand);
|
||||
return;
|
||||
default:
|
||||
avrcp_target_operation_not_implemented(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], packet[8]);
|
||||
avrcp_target_operation_not_implemented(connection->avrcp_cid, (avrcp_operation_id_t) packet[6], packet[7], operand);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user