From 0fd69bb60e2392102d1f581f8edfa090a8968aac Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 9 Aug 2017 15:00:19 +0200 Subject: [PATCH] a2dp: remove address check --- src/classic/a2dp_sink.c | 3 --- src/classic/a2dp_source.c | 4 ---- src/classic/avdtp.c | 2 -- src/classic/avrcp.c | 2 -- 4 files changed, 11 deletions(-) diff --git a/src/classic/a2dp_sink.c b/src/classic/a2dp_sink.c index 7ab97182d..5c29767d3 100644 --- a/src/classic/a2dp_sink.c +++ b/src/classic/a2dp_sink.c @@ -271,8 +271,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe switch (packet[2]){ case AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED: avdtp_subevent_signaling_connection_established_get_bd_addr(packet, address); - if (memcmp(address, &sc.remote_addr, 6) != 0) break; - cid = avdtp_subevent_signaling_connection_established_get_avdtp_cid(packet); status = avdtp_subevent_signaling_connection_established_get_status(packet); if (status != 0){ @@ -280,7 +278,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe a2dp_streaming_emit_connection_established(a2dp_sink_context.a2dp_callback, cid, 0, 0, status); break; } - app_state = A2DP_CONNECTED; log_info("AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED, avdtp cid 0x%02x ---", cid); break; diff --git a/src/classic/a2dp_source.c b/src/classic/a2dp_source.c index 6f468716e..634f97aaa 100644 --- a/src/classic/a2dp_source.c +++ b/src/classic/a2dp_source.c @@ -200,8 +200,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe switch (packet[2]){ case AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED: avdtp_subevent_signaling_connection_established_get_bd_addr(packet, address); - if (memcmp(address, &sc.remote_addr, 6) != 0) break; - cid = avdtp_subevent_signaling_connection_established_get_avdtp_cid(packet); status = avdtp_subevent_signaling_connection_established_get_status(packet); if (status != 0){ @@ -218,7 +216,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe break; case AVDTP_SUBEVENT_SIGNALING_SEP_FOUND: - // TODO check cid if (app_state != A2DP_W2_DISCOVER_SEPS) return; sep.seid = avdtp_subevent_signaling_sep_found_get_remote_seid(packet); sep.in_use = avdtp_subevent_signaling_sep_found_get_in_use(packet); @@ -228,7 +225,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe break; case AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY:{ - // TODO check cid if (!sc.local_stream_endpoint) return; uint8_t sampling_frequency = avdtp_choose_sbc_sampling_frequency(sc.local_stream_endpoint, avdtp_subevent_signaling_media_codec_sbc_capability_get_sampling_frequency_bitmap(packet)); uint8_t channel_mode = avdtp_choose_sbc_channel_mode(sc.local_stream_endpoint, avdtp_subevent_signaling_media_codec_sbc_capability_get_channel_mode_bitmap(packet)); diff --git a/src/classic/avdtp.c b/src/classic/avdtp.c index 5468dcd55..c5cca00ba 100644 --- a/src/classic/avdtp.c +++ b/src/classic/avdtp.c @@ -512,7 +512,6 @@ void avdtp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet case L2CAP_EVENT_INCOMING_CONNECTION: l2cap_event_incoming_connection_get_address(packet, event_addr); local_cid = l2cap_event_incoming_connection_get_local_cid(packet); - connection = avdtp_connection_for_bd_addr(event_addr, context); if (!connection || connection->state == AVDTP_SIGNALING_CONNECTION_W4_L2CAP_CONNECTED){ @@ -551,7 +550,6 @@ void avdtp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet log_error("unexpected PSM - Not implemented yet, avdtp sink: L2CAP_EVENT_CHANNEL_OPENED"); return; } - // log_info("L2CAP_EVENT_CHANNEL_OPENED: Channel successfully opened: %s, handle 0x%02x, psm 0x%02x, local cid 0x%02x, remote cid 0x%02x", // bd_addr_to_str(event_addr), l2cap_event_channel_opened_get_handle(packet), psm, local_cid, l2cap_event_channel_opened_get_remote_cid(packet)); diff --git a/src/classic/avrcp.c b/src/classic/avrcp.c index 4e9fc3508..9a18fc090 100644 --- a/src/classic/avrcp.c +++ b/src/classic/avrcp.c @@ -565,8 +565,6 @@ void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet switch (hci_event_packet_get_type(packet)) { case HCI_EVENT_DISCONNECTION_COMPLETE: - // connection closed -> quit test app - // status = hci_event_disconnection_complete_get_status(packet); avrcp_emit_connection_closed(context->avrcp_callback, 0); break; case L2CAP_EVENT_INCOMING_CONNECTION: