mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-09 21:45:54 +00:00
avrcp_target: add new lines
This commit is contained in:
parent
fe70eb3215
commit
0fd77db7e6
@ -1140,7 +1140,6 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
}
|
}
|
||||||
|
|
||||||
connection->target_scope = packet[pos++];
|
connection->target_scope = packet[pos++];
|
||||||
|
|
||||||
if (connection->target_scope >= AVRCP_BROWSING_RFU){
|
if (connection->target_scope >= AVRCP_BROWSING_RFU){
|
||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_PARAMETER);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_PARAMETER);
|
||||||
return;
|
return;
|
||||||
@ -1158,6 +1157,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->state = AVCTP_W2_CHECK_DATABASE;
|
connection->state = AVCTP_W2_CHECK_DATABASE;
|
||||||
avrcp_target_emit_add_to_now_playing_item(avrcp_target_context.avrcp_callback, connection->avrcp_cid, connection->target_uid_counter, connection->target_scope,connection->target_track_id);
|
avrcp_target_emit_add_to_now_playing_item(avrcp_target_context.avrcp_callback, connection->avrcp_cid, connection->target_uid_counter, connection->target_scope,connection->target_track_id);
|
||||||
break;
|
break;
|
||||||
@ -1173,6 +1173,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_PARAMETER);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_PARAMETER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(connection->target_track_id, &packet[pos], 8);
|
memcpy(connection->target_track_id, &packet[pos], 8);
|
||||||
pos += 8;
|
pos += 8;
|
||||||
uid_counter = big_endian_read_16(packet,pos);
|
uid_counter = big_endian_read_16(packet,pos);
|
||||||
@ -1180,6 +1181,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->state = AVCTP_W2_CHECK_DATABASE;
|
connection->state = AVCTP_W2_CHECK_DATABASE;
|
||||||
avrcp_target_emit_respond_play_item(avrcp_target_context.avrcp_callback, connection->avrcp_cid, connection->target_uid_counter, connection->target_scope,connection->target_track_id);
|
avrcp_target_emit_respond_play_item(avrcp_target_context.avrcp_callback, connection->avrcp_cid, connection->target_uid_counter, connection->target_scope,connection->target_track_id);
|
||||||
break;
|
break;
|
||||||
@ -1216,9 +1218,11 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AVRCP_PDU_ID_GET_PLAY_STATUS:
|
case AVRCP_PDU_ID_GET_PLAY_STATUS:
|
||||||
avrcp_target_emit_respond_vendor_dependent_query(avrcp_target_context.avrcp_callback, connection->avrcp_cid, AVRCP_SUBEVENT_PLAY_STATUS_QUERY);
|
avrcp_target_emit_respond_vendor_dependent_query(avrcp_target_context.avrcp_callback, connection->avrcp_cid, AVRCP_SUBEVENT_PLAY_STATUS_QUERY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVRCP_PDU_ID_REQUEST_ABORT_CONTINUING_RESPONSE:
|
case AVRCP_PDU_ID_REQUEST_ABORT_CONTINUING_RESPONSE:
|
||||||
if (length != 1){
|
if (length != 1){
|
||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
||||||
@ -1229,6 +1233,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
connection->state = AVCTP_W2_SEND_RESPONSE;
|
connection->state = AVCTP_W2_SEND_RESPONSE;
|
||||||
avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid);
|
avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVRCP_PDU_ID_REQUEST_CONTINUING_RESPONSE:
|
case AVRCP_PDU_ID_REQUEST_CONTINUING_RESPONSE:
|
||||||
if ((pos + 1) > size) return;
|
if ((pos + 1) > size) return;
|
||||||
if (packet[pos] != AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES){
|
if (packet[pos] != AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES){
|
||||||
@ -1240,6 +1245,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
connection->state = AVCTP_W2_SEND_RESPONSE;
|
connection->state = AVCTP_W2_SEND_RESPONSE;
|
||||||
avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid);
|
avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES:{
|
case AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES:{
|
||||||
if ((pos + 9) > size) return;
|
if ((pos + 9) > size) return;
|
||||||
uint8_t play_identifier[8];
|
uint8_t play_identifier[8];
|
||||||
@ -1271,6 +1277,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid);
|
avrcp_request_can_send_now(connection, connection->l2cap_signaling_cid);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AVRCP_PDU_ID_REGISTER_NOTIFICATION:{
|
case AVRCP_PDU_ID_REGISTER_NOTIFICATION:{
|
||||||
if ((pos + 1) > size) return;
|
if ((pos + 1) > size) return;
|
||||||
avrcp_notification_event_id_t event_id = (avrcp_notification_event_id_t) packet[pos];
|
avrcp_notification_event_id_t event_id = (avrcp_notification_event_id_t) packet[pos];
|
||||||
@ -1343,6 +1350,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AVRCP_PDU_ID_SET_ABSOLUTE_VOLUME: {
|
case AVRCP_PDU_ID_SET_ABSOLUTE_VOLUME: {
|
||||||
if (length != 1){
|
if (length != 1){
|
||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_PARAMETER_CONTENT_ERROR);
|
||||||
@ -1360,6 +1368,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec
|
|||||||
avrcp_target_vendor_dependent_response_accept(connection, pdu_id, connection->target_absolute_volume);
|
avrcp_target_vendor_dependent_response_accept(connection, pdu_id, connection->target_absolute_volume);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_info("AVRCP target: unhandled pdu id 0x%02x", pdu_id);
|
log_info("AVRCP target: unhandled pdu id 0x%02x", pdu_id);
|
||||||
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_COMMAND);
|
avrcp_target_response_vendor_dependent_reject(connection, pdu_id, AVRCP_STATUS_INVALID_COMMAND);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user