From afc28e0a5ab5a6890acbc825ba7b1553b2b5c047 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 16 Dec 2019 13:08:48 +0100 Subject: [PATCH] avdtp: add signal_identifier to avdtp_unpack_service_capabilities --- src/classic/avdtp_acceptor.c | 4 ++-- src/classic/avdtp_initiator.c | 2 +- src/classic/avdtp_util.c | 4 ++-- src/classic/avdtp_util.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/classic/avdtp_acceptor.c b/src/classic/avdtp_acceptor.c index c2d867863..1ba329230 100644 --- a/src/classic/avdtp_acceptor.c +++ b/src/classic/avdtp_acceptor.c @@ -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; diff --git a/src/classic/avdtp_initiator.c b/src/classic/avdtp_initiator.c index a984fd56d..4ce45c349 100644 --- a/src/classic/avdtp_initiator.c +++ b/src/classic/avdtp_initiator.c @@ -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: diff --git a/src/classic/avdtp_util.c b/src/classic/avdtp_util.c index 9141cc104..1db3c92e0 100644 --- a/src/classic/avdtp_util.c +++ b/src/classic/avdtp_util.c @@ -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; diff --git a/src/classic/avdtp_util.h b/src/classic/avdtp_util.h index 1df7f1735..f093b803e 100644 --- a/src/classic/avdtp_util.h +++ b/src/classic/avdtp_util.h @@ -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);