From 81c03ff0b82ebe7437fd4e3b786b85b5a9cd4fd2 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 13 Dec 2017 14:30:53 +0100 Subject: [PATCH] a2dp: handle pin code request --- example/a2dp_sink_demo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example/a2dp_sink_demo.c b/example/a2dp_sink_demo.c index 8e056eedd..0402fc6c6 100644 --- a/example/a2dp_sink_demo.c +++ b/example/a2dp_sink_demo.c @@ -66,7 +66,6 @@ #include #include "btstack.h" -#include "classic/btstack_sbc.h" #define AVRCP_BROWSING_ENABLED 0 @@ -848,6 +847,13 @@ static void a2dp_sink_packet_handler(uint8_t packet_type, uint16_t channel, uint uint8_t status; if (packet_type != HCI_EVENT_PACKET) return; + if (hci_event_packet_get_type(packet) == HCI_EVENT_PIN_CODE_REQUEST) { + printf("Pin code request - using '0000'\n"); + hci_event_pin_code_request_get_bd_addr(packet, address); + gap_pin_code_response(address, "0000"); + return; + } + if (hci_event_packet_get_type(packet) != HCI_EVENT_A2DP_META) return; switch (packet[2]){