avdtp: add signal_identifier to avdtp_unpack_service_capabilities

This commit is contained in:
Matthias Ringwald 2019-12-16 13:08:48 +01:00
parent 390aa582e5
commit afc28e0a5a
4 changed files with 6 additions and 6 deletions

View File

@ -89,7 +89,7 @@ static void avdtp_acceptor_handle_configuration_command(avdtp_connection_t *conn
stream_endpoint->connection = connection;
avdtp_sep_t sep;
sep.seid = connection->signaling_packet.command[offset++] >> 2;
sep.configured_service_categories = avdtp_unpack_service_capabilities(connection, &sep.configuration, connection->signaling_packet.command+offset, packet_size-offset);
sep.configured_service_categories = avdtp_unpack_service_capabilities(connection, connection->signaling_packet.signal_identifier, &sep.configuration, connection->signaling_packet.command+offset, packet_size-offset);
sep.in_use = 1;
if (connection->error_code){
@ -278,7 +278,7 @@ void avdtp_acceptor_stream_config_subsm(avdtp_connection_t * connection, uint8_t
avdtp_sep_t sep;
sep.seid = connection->local_seid;
log_info("ACP: AVDTP_ACCEPTOR_W2_ANSWER_RECONFIGURE seid %d", sep.seid);
sep.configured_service_categories = avdtp_unpack_service_capabilities(connection, &sep.configuration, connection->signaling_packet.command+offset, packet_size-offset);
sep.configured_service_categories = avdtp_unpack_service_capabilities(connection, connection->signaling_packet.signal_identifier, &sep.configuration, connection->signaling_packet.command+offset, packet_size-offset);
if (connection->error_code){
// fire configuration parsing errors
connection->reject_signal_identifier = connection->signaling_packet.signal_identifier;

View File

@ -127,7 +127,7 @@ void avdtp_initiator_stream_config_subsm(avdtp_connection_t * connection, uint8_
case AVDTP_SI_GET_CAPABILITIES:
case AVDTP_SI_GET_ALL_CAPABILITIES:
sep.registered_service_categories = avdtp_unpack_service_capabilities(connection, &sep.capabilities, packet+offset, size-offset);
sep.registered_service_categories = avdtp_unpack_service_capabilities(connection, connection->signaling_packet.signal_identifier, &sep.capabilities, packet+offset, size-offset);
avdtp_emit_capabilities(context->avdtp_callback, connection->avdtp_cid, connection->local_seid, connection->remote_seid, &sep.capabilities, sep.registered_service_categories);
break;
case AVDTP_SI_DELAYREPORT:

View File

@ -374,7 +374,7 @@ static int avdtp_unpack_service_capabilities_has_errors(avdtp_connection_t * con
return 0;
}
uint16_t avdtp_unpack_service_capabilities(avdtp_connection_t * connection, avdtp_capabilities_t * caps, uint8_t * packet, uint16_t size){
uint16_t avdtp_unpack_service_capabilities(avdtp_connection_t * connection, avdtp_signal_identifier_t signal_identifier, avdtp_capabilities_t * caps, uint8_t * packet, uint16_t size){
int i;
@ -394,7 +394,7 @@ uint16_t avdtp_unpack_service_capabilities(avdtp_connection_t * connection, avdt
return 0;
}
if (avdtp_unpack_service_capabilities_has_errors(connection, connection->signaling_packet.signal_identifier, category, cap_len)) return 0;
if (avdtp_unpack_service_capabilities_has_errors(connection, signal_identifier, category, cap_len)) return 0;
int category_valid = 1;

View File

@ -73,7 +73,7 @@ uint16_t store_bit16(uint16_t bitmap, int position, uint8_t value);
int get_bit16(uint16_t bitmap, int position);
int avdtp_pack_service_capabilities(uint8_t * buffer, int size, avdtp_capabilities_t caps, avdtp_service_category_t category, uint8_t pack_all_capabilities);
uint16_t avdtp_unpack_service_capabilities(avdtp_connection_t * connection, avdtp_capabilities_t * caps, uint8_t * packet, uint16_t size);
uint16_t avdtp_unpack_service_capabilities(avdtp_connection_t * connection, avdtp_signal_identifier_t signal_identifier, avdtp_capabilities_t * caps, uint8_t * packet, uint16_t size);
void avdtp_prepare_capabilities(avdtp_signaling_packet_t * signaling_packet, uint8_t transaction_label, uint16_t registered_service_categories, avdtp_capabilities_t configuration, uint8_t identifier);
int avdtp_signaling_create_fragment(uint16_t cid, avdtp_signaling_packet_t * signaling_packet, uint8_t * out_buffer);