a2dp: handle pin code request

This commit is contained in:
Milanka Ringwald 2017-12-13 14:29:50 +01:00
parent c0a054f62c
commit a5c9fdc555

View File

@ -63,13 +63,9 @@
#include <string.h>
#include "btstack.h"
#include "classic/btstack_sbc.h"
#include "hxcmod.h"
#include "mods/mod.h"
#define AVRCP_BROWSING_ENABLED 0
#define NUM_CHANNELS 2
@ -433,7 +429,13 @@ static void a2dp_source_packet_handler(uint8_t packet_type, uint16_t channel, ui
return;
}
#endif
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]){
case A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED: