a2dp: handle pin code request

This commit is contained in:
Milanka Ringwald 2017-12-13 14:30:53 +01:00
parent a5c9fdc555
commit 81c03ff0b8

View File

@ -66,7 +66,6 @@
#include <string.h>
#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]){